Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
LeifB
Advocate II
Advocate II

Azure DevOps + Deployment Pipeline Integration Error

I am trying to set up ADO integration with a new Deployment Pipeline using the BI Automation Tools ADO addon. I created an ADO pipeline in the classic editor with the following task (workspace/pipeline details blacked out):

 

LeifB_1-1761672012239.png

When I run this pipeline, I receive a 404 error with the response:

{"error":{"code":"ALM_InvalidRequest_PipelineStageNotFound","pbi.error":{"code":"ALM_InvalidRequest_PipelineStageNotFound","parameters":{},"details":[],"exceptionCulprit":1}}}
 
The two things I've tried are:
  • Changed the Production stage's name from "Prod" back to "Production" - same error
  • Granted the Pipeline.ReadWrite.All permission to the SPN - same error

This is the only thing holding us up from having a slick solution set up for source control, so any help with resolving this is appreciated!

8 REPLIES 8
KevinChant
Super User
Super User

I would advise looking to try this in a YAML pipeline instead, using the PowerShell script provided by Microsoft instead of the task.

 

I have a post that covers how to do that below:
https://www.kevinrchant.com/2024/06/11/update-fabric-deployment-pipeline-stages-with-deploymentpipel...

 

I hope this helps, if so give it some kudos and/or mark it as the solution.

v-dineshya
Community Support
Community Support

Hi @LeifB ,

Thank you for reaching out to the Microsoft Community Forum.

 

The error indicates that the Power BI Deployment Pipeline stage name provided in your ADO task does not match what Power BI expects.

 

Please try below things to fix the issue.

 

1. Go to Power BI Service --> Deployment Pipelines --> Your Pipeline. Check the stage names are same for Development, Test, and Production all are case-sensitive.

 

2. Go to Power BI, open the pipeline and copy its ID from the URL. And check the ADO task references the correct pipeline.

 

3. Go to Power BI Admin Portal --> Deployment Pipelines, confirm the SPN is an Admin. Also check workspace permissions for each stage.

 

4. Please use the latest version of BI Automation Tools for ADO.

 

I hope this information helps. Please do let us know if you have any further queries.

 

Regards,

Dinesh

 

Hi Dinesh, thanks for the reply. I followed your steps and unfortunately still got the same error. Can you confirm that this is the setting the SPN should be on? If so, I did confirm that it is.

LeifB_0-1761741429335.png

To clarify, we only have Test and Production workspaces/stages. Is it required to have Development as well in order to use the BI Automation Tools?

 

Edit: I tried deleting and recreating the Deployment Pipeline to have all 3 stages and ran it again, but now it's saying that it can't find the pipeline. I did confirm that I added the SPN as an admin on the pipeline and all workspaces.

Hi @LeifB ,

The SPN is correctly added as an Admin on the pipeline. So permissions are not the issue.


Is it required to have Development as well in order to use the BI Automation Tools?

 

Yes, the Power BI Deployment Pipeline API expects all three stages to exist. Even if you only plan to use Test and Production, the pipeline object must include all three stages because the API schema is fixed. If Development is missing, the API call will fail with "PipelineStageNotFound" error.

 

The error “pipeline not found” refers to when you recreated the pipeline, the pipeline ID changed. Your ADO task might still be referencing the old pipeline name or ID. The BI Automation Tools task uses the pipeline name internally, but if the service connection cached the old ID, it can cause this error.


Please check below things to fix the issue.

 

1. Go to the new pipeline in Power BI. Copy the ID from the below URL.'

 

https://app.powerbi.com/groups/me/deploymentpipelines/{pipelineId}

 

Use this ID in your ADO task if the add-on supports direct ID entry.

 

2. Go to the task settings, re-select the pipeline from the dropdown. Save and queue the pipeline again.

 

I hope this information helps. Please do let us know if you have any further queries.

 

Regards,

Dinesh

 

Hi Dinesh, I did already switch it to use the new ID and still received the error. I looked at the GitHub repo for this add-on and found other people with the same issue, and there did not seem to be any responses, so I'm suspecting there's an issue with the add-on. I'm going to attempt to use the sample PowerShell scripts rather than the add-on, as some folks said they had success with that.

Hi @LeifB ,

Thank you for the update. As you mentioned in your previous response, you want to use the PowerShell scripts rather than the add-on. Please try below PowerShell script that authenticates using SPN, retrieves the pipeline details, and deploys content from Test --> Production using the Power BI REST API.

 

 

$tenantId = "<TENANT_ID>"
$clientId = "<SP_CLIENT_ID>"
$clientSecret = "<SP_CLIENT_SECRET>"
$pipelineId = "<PIPELINE_ID>" # Take from Power BI URL
$sourceStage = 1 # Test stage
$targetStage = 2 # Production stage

$tokenUrl = "https://login.microsoftonline.com/$tenantId/oauth2/v2.0/token"
$body = @{
grant_type = "client_credentials"
client_id = $clientId
client_secret = $clientSecret
scope = "https://analysis.windows.net/powerbi/api/.default"
}

Write-Host "Requesting OAuth token..."
$tokenResponse = Invoke-RestMethod -Uri $tokenUrl -Method POST -Body $body
$accessToken = $tokenResponse.access_token

$headers = @{
Authorization = "Bearer $accessToken"
"Content-Type" = "application/json"
}

Write-Host "Fetching pipeline details..."
$pipelineUrl = "https://api.powerbi.com/v1.0/myorg/deploymentPipelines/$pipelineId"
$pipelineDetails = Invoke-RestMethod -Uri $pipelineUrl -Headers $headers -Method GET

Write-Host "Pipeline Name: $($pipelineDetails.displayName)"
Write-Host "Stages:"
$pipelineDetails.stages | ForEach-Object { Write-Host "Order: $($_.order) Name: $($_.displayName)" }

$deployUrl = "https://api.powerbi.com/v1.0/myorg/deploymentPipelines/$pipelineId/deploy"
$deployBody = @{
sourceStageOrder = $sourceStage
targetStageOrder = $targetStage
} | ConvertTo-Json

Write-Host "Deploying from Test to Production..."
$deployResponse = Invoke-RestMethod -Uri $deployUrl -Headers $headers -Method POST -Body $deployBody

Write-Host "Deployment Status: $($deployResponse.status)"
Write-Host "Deployment ID: $($deployResponse.id)"


Please try below steps.

 

1. Uses OAuth 2.0 client credentials flow for SPN.

 

2. Please Confirm the pipeline exists and lists all stages.

 

3. Calls the /deploy endpoint to move artifacts from Test --> Production.

 

Note: SPN must have Pipeline.ReadWrite.All permission. SPN must be Admin on
The pipeline and All workspaces in the pipeline stages. Power BI pipeline must have Development, Test, Production stages .

 

Please refer below link.

Automate deployment pipelines with APIs for Power BI items - Microsoft Fabric | Microsoft Learn

Pipelines - REST API (Power BI Power BI REST APIs) | Microsoft Learn

Solved: Automate Deployment Pipelines | Power BI API and I... - Microsoft Fabric Community

 

I hope this information helps. Please do let us know if you have any further queries.

 

Regards,

Dinesh

I gave your script a try and got the following error, it seems to be the same as when I tried the task from the add-on. I triple-checked that the SPN has all of the required access, and the pipeline ID is correct.

LeifB_1-1761919626000.png

One of the GitHub issues I saw mentioned that they thought this problem was due to the workspace having Git integration set up - we also have this on the Test workspace, but this was a core piece of the version control setup, so removing it would render the solution useless. Is this a known limitation?

Hi @LeifB ,

Thank you for the update.  It appears this issue might require deeper investigation from the Microsoft  Fabric support team. I recommend opening a Microsoft support ticket so they can trace the issue. To raise a support ticket for Fabric and Power BI, kindly follow the steps outlined in the following guide:

How to create a Fabric and Power BI Support ticket - Power BI | Microsoft Learn

 

Regards,

Dinesh

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors