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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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 Solution Authors
Top Kudoed Authors