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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
belvoir99
Resolver III
Resolver III

Publish .pbip using Python script

Is it possible to use Python to publish a .pbip to a workspace? I have a Power BI Premium workspace.

I have 3 reports (1 fat, 2 thin) and the semantic model to publish to the workspace. I use .pbip and Python to check the fat report and create the 2 thin reports (variants of the fat report).

Having read this from @Ritaf1983, I suspect I can't, but just wanted to get a confirm!
https://community.fabric.microsoft.com/t5/Desktop/Publich-PBIP-on-fabric-workspace-programatically/m... 

And doesn't seem to have anything here either:
https://learn.microsoft.com/en-us/rest/api/power-bi/ 

There does seem to be a method using Fabric APIs, so perhaps the correct solution is to migrate over to Fabric (which I'll probably do anyway at some point):
https://learn.microsoft.com/en-us/rest/api/fabric/articles/get-started/deploy-project?toc=%2Fpower-b... 

And this on the Ideas site seems to confirm too:
https://community.fabric.microsoft.com/t5/Custom-Visuals-Ideas-read-only/Publish-pbip-to-Power-BI-Se... 

I already have my Dev .pbip in my Dev workspace git integrated to Azure DevOps, and that works well. 

Some general advice and pointers on this would be most appreciated. Thanks!


2 ACCEPTED SOLUTIONS
AdamMichael
Regular Visitor

Hello, At present, there is no official Power BI REST API that allows you to directly publish a .pbip (Power BI Project) folder to a Power BI Premium workspace in the same way that a .pbix file can be imported. The Power BI REST APIs were primarily designed around PBIX-based deployments, and Microsoft has not yet provided a direct "publish PBIP" endpoint. Therefore, if your Python process generates or modifies PBIP files, you cannot simply call a REST API to upload those project files directly to the workspace.

 

For your scenario, where you have one semantic model (fat report) and two thin reports that are created programmatically using Python, the recommended approach is to continue using the PBIP and Git-based development workflow. Since your Dev workspace is already integrated with Azure DevOps through Git integration, you are already aligned with Microsoft's preferred development model. In this approach, Python can generate or update the PBIP artifacts, commit the changes to the repository, and then allow Fabric or Power BI Git integration to synchronize those changes into the workspace.

 

If you require a fully automated deployment process, Microsoft is increasingly positioning the Fabric APIs and Git-based deployment workflows as the strategic direction. Fabric APIs provide capabilities for deploying and managing workspace items programmatically and are more compatible with project-based development models such as PBIP. Because of this, migrating toward a Fabric-centric deployment strategy would likely be a better long-term investment than attempting to build custom solutions around PBIX publishing.

 

In summary, your understanding is correct: Python can create and manipulate PBIP files, but it cannot directly publish those PBIP projects to a Power BI Premium workspace using the traditional Power BI REST APIs. The recommended solution is to use Git integration, deployment pipelines, and, where necessary, Fabric APIs to automate the deployment process. Since you already have Azure DevOps and Git integration working successfully, you are already using the approach that Microsoft currently recommends for PBIP-based development and deployment.

View solution in original post

You can deploy pbip using Fabric APIs, with premium or just pro, no xmla endpoint required.

- createItem

- updateItemDefinition

 

A good wrapper for this is fabric-cicd. I have a blog post on how to use it. I've also written about having multiple repos points to the same workspace, or the same repo pointing to multiple workspaces. Using fabric-cicd gives alot more flexibility than git intergration. That being said with git intergration you have different branches pointing to different workspaces. You can have as many fabric items as you like in a repo (i.e. semantic model, reports).

 

git-integration

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

4 REPLIES 4
AdamMichael
Regular Visitor

Hello, At present, there is no official Power BI REST API that allows you to directly publish a .pbip (Power BI Project) folder to a Power BI Premium workspace in the same way that a .pbix file can be imported. The Power BI REST APIs were primarily designed around PBIX-based deployments, and Microsoft has not yet provided a direct "publish PBIP" endpoint. Therefore, if your Python process generates or modifies PBIP files, you cannot simply call a REST API to upload those project files directly to the workspace.

 

For your scenario, where you have one semantic model (fat report) and two thin reports that are created programmatically using Python, the recommended approach is to continue using the PBIP and Git-based development workflow. Since your Dev workspace is already integrated with Azure DevOps through Git integration, you are already aligned with Microsoft's preferred development model. In this approach, Python can generate or update the PBIP artifacts, commit the changes to the repository, and then allow Fabric or Power BI Git integration to synchronize those changes into the workspace.

 

If you require a fully automated deployment process, Microsoft is increasingly positioning the Fabric APIs and Git-based deployment workflows as the strategic direction. Fabric APIs provide capabilities for deploying and managing workspace items programmatically and are more compatible with project-based development models such as PBIP. Because of this, migrating toward a Fabric-centric deployment strategy would likely be a better long-term investment than attempting to build custom solutions around PBIX publishing.

 

In summary, your understanding is correct: Python can create and manipulate PBIP files, but it cannot directly publish those PBIP projects to a Power BI Premium workspace using the traditional Power BI REST APIs. The recommended solution is to use Git integration, deployment pipelines, and, where necessary, Fabric APIs to automate the deployment process. Since you already have Azure DevOps and Git integration working successfully, you are already using the approach that Microsoft currently recommends for PBIP-based development and deployment.

@AdamMichael thank you so much for such a clear and comprehensive answer!

I won't pursue any further attempts to get pbip automation with Power BI Premium and instead I will begin planning the move to Fabric.

Can I ask just one more question?
I may have this wrong but I believe that, because the workspace (and not the workspace objects) connects to the repo, I can only have one git-integrated report in the workspace. Therefore I would need a workspace for every generated report, fat or thin. 
I cannot see anything in the documentation that would enable me to connect multiple reports or semantic models to repo branches within the same workspace.
Indeed, having had a quick read of the CI/CD documentation for Fabric, this seems to be a fundamental principal - one workspace is connected to one repo.
see - https://learn.microsoft.com/en-gb/fabric/cicd/git-integration/intro-to-git-integration and especially see - https://learn.microsoft.com/en-gb/fabric/cicd/git-integration/manage-branches 
 I am learning so much....! 

You can deploy pbip using Fabric APIs, with premium or just pro, no xmla endpoint required.

- createItem

- updateItemDefinition

 

A good wrapper for this is fabric-cicd. I have a blog post on how to use it. I've also written about having multiple repos points to the same workspace, or the same repo pointing to multiple workspaces. Using fabric-cicd gives alot more flexibility than git intergration. That being said with git intergration you have different branches pointing to different workspaces. You can have as many fabric items as you like in a repo (i.e. semantic model, reports).

 

git-integration

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Hi @Deku thanks very much for this! Looks great! I will go away and get some studying done.....

 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Kudoed Authors