Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I’m trying to implement a CI/CD setup for the reporting in Power BI (workspaces), but I’m hitting several blockades in the automation around updating Power BI workspaces, I hope I am missing something?
I will first explain what I already tried and the issues I hit. To go straight to the summarized questions, go to the bottom of this post.
For internal reasons my mainframe uses SQL/python to do the lifting/building of the data(marts) into SQL Azure databases, it is fully versioned using git, no manual actions needed in databases when the related branch is updated. Works like a charm.
The git also contains the workspace/Power BI Reports and this is where it gets problematic. I am currently using the REST API to complete the automation for the Power BI part.
Method 1:
I first had connected all the workspaces to git and thought of updating them via the branch-releases of their specific connected branch. After that I used two different approaches (After updating the workspace to its git manually):
In both cases it failed at the point where:
Method 2:
Another method I tried is using (Power BI) Deployment Pipelines, but there I also hit a bunch of issues. I created them programmatically at first, but when doing it failed at other items:
Summarized questions:
Currently I am stuck with releasing using a combination of dev in git (OK), and releasing using Deployment Pipelines, doing some shenanigans, cleaning the mess remaining by the Deployment Pipelines with a script, praying the connections don’t get reset and with every new dataset a run through all the ‘released’ workspaces at night to update the connectors by hand. This, to be honest, does not sound like healthy CI/CD to me when using Power BI Workspaces.. So I hope I am missing something!
Solved! Go to Solution.
Hi Leroy Lu,
Thanks for your extended response, I appreciate it. For the links you provided, I think they are really helpful, even though they didn't solve the issue. More background info is on the bottom of this post. It took me some time to test some other options and I think I found the solution (note, the answers on the questions stated are technically still 'no' for CI/CD with Power BI Workspaces, Service Principles and/or Cloud Connections).
Solution:
I ended up finding a solution to work around these limitations and make my Power BI Workspaces be fully automated for releases after development, and it is integrated in a git-repository, making the whole CI/CD data-pipeline from source to reports versioned in git.
What I did:
Whenever I now release a new version (that does not contain new models/datasource) it keeps the connections intact since no changes are made to the connection of the branches, even if the dataset content changes, like, added tables/columns.
Pro's:
Con's:
Hope this helps other people that hit the same roadblock(s). I can tag this as an answer if needed.
Other info:
These are the references I used and Leroy pointed at:
Power BI REST APIs for embedded analytics and automation - Power BI REST API | Microsoft Learn (the base for REST API's)
CI/CD workflow options in Fabric - Microsoft Fabric | Microsoft Learn (also a great read but doesn't solve the issue due to limitations on git-updates being restriced to actual users, it is a Fabric (UI) 'shell' that basically calls the same API's with therefore the same limitations)
Another thing I tried was using the Deployment Pipelines of Power BI (since git-sync could not be automated with an SP) and keep them alive (instead of rebuilding them) so I can update them with the right connections after the building of a new target workspace, but apparently you also cannot use the same workspace as a source for different pipelines in the Deployment Pipelines, so that didn't work. You can of course 'chain' all the workspaces of the users on the same pipeline of that specific version needed, but that becomes pretty messy if you have to switch workspaces to a different version because it will/can create gaps in the pipeline.
To address the issues mentioned, here’s a solution:
Cloud Connection Mapping via REST API
Instead of manually re-mapping connections after adding or modifying a dataset, you can use the following REST API to automate the mapping process:
API Endpoint:
Payload Example:
Implementation Tip:
Hi Datansh,
As mentioned in the original post, Cloud Connections are not supported to map via the REST API:
"REST API doesn’t allow selection of cloud connections, only on-premise gateways (gateways REST call returns an empty list, we work in the cloud)...". As far as I know this issue was not fixed/changed, but I must admint I didn't check because the whole system is basically running like a train.
Hi Leroy Lu,
Thanks for your extended response, I appreciate it. For the links you provided, I think they are really helpful, even though they didn't solve the issue. More background info is on the bottom of this post. It took me some time to test some other options and I think I found the solution (note, the answers on the questions stated are technically still 'no' for CI/CD with Power BI Workspaces, Service Principles and/or Cloud Connections).
Solution:
I ended up finding a solution to work around these limitations and make my Power BI Workspaces be fully automated for releases after development, and it is integrated in a git-repository, making the whole CI/CD data-pipeline from source to reports versioned in git.
What I did:
Whenever I now release a new version (that does not contain new models/datasource) it keeps the connections intact since no changes are made to the connection of the branches, even if the dataset content changes, like, added tables/columns.
Pro's:
Con's:
Hope this helps other people that hit the same roadblock(s). I can tag this as an answer if needed.
Other info:
These are the references I used and Leroy pointed at:
Power BI REST APIs for embedded analytics and automation - Power BI REST API | Microsoft Learn (the base for REST API's)
CI/CD workflow options in Fabric - Microsoft Fabric | Microsoft Learn (also a great read but doesn't solve the issue due to limitations on git-updates being restriced to actual users, it is a Fabric (UI) 'shell' that basically calls the same API's with therefore the same limitations)
Another thing I tried was using the Deployment Pipelines of Power BI (since git-sync could not be automated with an SP) and keep them alive (instead of rebuilding them) so I can update them with the right connections after the building of a new target workspace, but apparently you also cannot use the same workspace as a source for different pipelines in the Deployment Pipelines, so that didn't work. You can of course 'chain' all the workspaces of the users on the same pipeline of that specific version needed, but that becomes pretty messy if you have to switch workspaces to a different version because it will/can create gaps in the pipeline.
Hi, @Jan_Mateboer
Thank you for sharing your trial-and-error experiences. Your insights are invaluable to community members facing similar issues, helping them find feasible solutions more quickly.
Let’s address your questions step by step:
1.Firstly, there is currently no API that directly supports cloud gateway connections. Below is a screenshot from the relevant documentation:
For detailed information, please refer to the following link:
Gateways - Create Datasource - REST API (Power BI Power BI REST APIs) | Microsoft Learn
2.Secondly, regarding the automatic management of workspace synchronization, I also think of the pipeline deployment method, which aligns with your second approach. However, as you mentioned, it still has several limitations.
Below is a screenshot from the official documentation:
For detailed information, please refer to:
The Microsoft Fabric deployment pipelines process - Microsoft Fabric | Microsoft Learn
Here are the API documentation links related to pipelines, which I hope will be helpful to you:
Pipelines - REST API (Power BI Power BI REST APIs) | Microsoft Learn
3.Lastly, Power BI Deployment Pipelines do not inherently support the automatic deletion of non-existent or deleted items. You might consider integrating pipeline deployment with Azure DevOps.
Here are some relevant documents that I hope will be helpful to you:
Azure DevOps build pipeline integration with Power BI Desktop projects - Power BI | Microsoft Learn
Of course, if you have any new ideas, you are welcome to contact us.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
4 | |
4 | |
4 | |
4 | |
4 |