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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
wasimCG
New Member

Automate Deployment Pipelines | Power BI API and Invoke-PowerBIRestMethod

Hello

 

I’m trying to automate the creation of Power BI deployment pipeline with stages using  azure yaml pipeline. My yaml code got the inspiration from the below example PowerShell script that was provided my Microsoft https://github.com/microsoft/PowerBI-Developer-Samples/blob/master/PowerShell%20Scripts/DeploymentPi...

 

 

I’m just wondering if the below two options are possible

 

 

I’m using the Power BI Rest API and Invoke-PowerBIRestMethod command to create deployment pipeline where it would have more than three stages Dev, Test and  Pre-Production and Production. After reading through lot of documentation, it seems to me that Power BI Rest API and Invoke-PowerBIRestMethod would only allow me to create three fixed default stages and I wont be able to add Pre-Production stage between Test and production. Is my statement correct?

 

 

The alternative approach is to create the deployment pipeline manually within the GUI itself where there is no stage restriction. Let’s say I create four stages in GUI, then I create a yaml automation pipeline that uses Power BI Rest API and Invoke-PowerBIRestMethod command. Would the Power BI Rest API and Invoke-PowerBIRestMethod command recognize and identify the existing deployment pipeline that was created manually especially the Pre-Production stage?

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2 ACCEPTED SOLUTIONS

Sample Scripts
Microsoft provides sample PowerShell scripts for various deployment scenarios:

 

https://github.com/microsoft/PowerBI-Developer-Samples/blob/master/PowerShell%20Scripts/DeploymentPi...

https://github.com/microsoft/PowerBI-Developer-Samples/blob/master/PowerShell%20Scripts/DeploymentPi...

https://github.com/microsoft/PowerBI-Developer-Samples/blob/master/PowerShell%20Scripts/DeploymentPi...

These scripts demonstrate how to authenticate, create pipelines, assign workspaces, and perform deployments using the Power BI REST API with PowerShell.

Feel free to explore these resources to tailor your deployment automation to your specific needs!

 

View solution in original post

V-yubandi-msft
Community Support
Community Support

Hi @wasimCG ,

Thank you for contacting the Microsoft Fabric Community.
Special thanks to @Ilgar_Zarbali , for the clarification and for sharing the sample scripts.
Please feel free to explore the resources provided to tailor them to your scenario as suggested.

 

Stay connected with the community for any future questions or discussions we're here to help.

 

Regards,

Yugandhar.

View solution in original post

4 REPLIES 4
V-yubandi-msft
Community Support
Community Support

Hi @wasimCG ,

Thank you for contacting the Microsoft Fabric Community.
Special thanks to @Ilgar_Zarbali , for the clarification and for sharing the sample scripts.
Please feel free to explore the resources provided to tailor them to your scenario as suggested.

 

Stay connected with the community for any future questions or discussions we're here to help.

 

Regards,

Yugandhar.

Ilgar_Zarbali
Super User
Super User

Yes, you're right — the Power BI REST API only allows 3 default stages (Dev, Test, Prod). You can't add a custom stage like Pre-Production through the API. But if you create the 4-stage pipeline manually in the GUI, the API can still recognize and interact with it.

Thanks for your reply. Could you please let me know which command can interact with existing pipelines or could you please point me to any existing example PowerShell scripts that does this?

Sample Scripts
Microsoft provides sample PowerShell scripts for various deployment scenarios:

 

https://github.com/microsoft/PowerBI-Developer-Samples/blob/master/PowerShell%20Scripts/DeploymentPi...

https://github.com/microsoft/PowerBI-Developer-Samples/blob/master/PowerShell%20Scripts/DeploymentPi...

https://github.com/microsoft/PowerBI-Developer-Samples/blob/master/PowerShell%20Scripts/DeploymentPi...

These scripts demonstrate how to authenticate, create pipelines, assign workspaces, and perform deployments using the Power BI REST API with PowerShell.

Feel free to explore these resources to tailor your deployment automation to your specific needs!

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.