Forum Discussion
Power BI Deployment Automation through RestAPI
Hi Team,
We are trying to automate PowerBI Deployment through Pipeline.
Currently we have achieved a partial automation using rest API (scripting language - Python). In this partial automation we are able to deploy the existing objects but not the new ones.
We are having issues while deploying a new report/semantic model for the following subtasks:
1. Updating gateway connection in datasource -
we have multiple gateways(one for each enviornment) and currently one has to manually select among them. to automate this task, we are not able to find the appropriate Rest api.
2. Adding a new report to the App-
We are unable to find the appropriate RestAPI for the same.
Kindly assist to resolve these two issues. Also let us know if there is any known limitation.
thanks
Shruti Trivedi
Hi ShrutiTrivedi ,
Thanks for reaching out to the Microsoft fabric community forum.
To automate switching gateways for a dataset, you’ll need to use a combination of these REST API endpoints:
Update Datasource
- Endpoint: PATCH https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId}
- Purpose: Updates credentials for a datasource on a specific gateway.
Update Datasources in Group
- Endpoint: PATCH https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/Default.UpdateDatasources
- Purpose: Allows you to change the server/database name in the dataset to match the target environment.
Bind to Gateway
- Endpoint: POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/bindToGateway
Workaround
- Use Power BI Cmdlets (Add-PowerBIReport, Update-PowerBIApp) for App-level automation.
- Parameterize your PBIX files to make gateway switching easier.
- Use service principals for secure automation across environments.
Automate deployment pipelines with APIs for Power BI items - Microsoft Fabric | Microsoft Learn
If you still have any questions or need further assistance, please don’t hesitate to reach out. We’re more than happy to continue supporting you.
We appreciate your engagement and thank you for being an active part of the community.
Best Regards,
Lakshmi.
4 Replies
- v-lgarikapatCommunity Support
Hi ShrutiTrivedi ,
Thanks for reaching out to the Microsoft fabric community forum.
To automate switching gateways for a dataset, you’ll need to use a combination of these REST API endpoints:
Update Datasource
- Endpoint: PATCH https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources/{datasourceId}
- Purpose: Updates credentials for a datasource on a specific gateway.
Update Datasources in Group
- Endpoint: PATCH https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/Default.UpdateDatasources
- Purpose: Allows you to change the server/database name in the dataset to match the target environment.
Bind to Gateway
- Endpoint: POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/bindToGateway
Workaround
- Use Power BI Cmdlets (Add-PowerBIReport, Update-PowerBIApp) for App-level automation.
- Parameterize your PBIX files to make gateway switching easier.
- Use service principals for secure automation across environments.
Automate deployment pipelines with APIs for Power BI items - Microsoft Fabric | Microsoft Learn
If you still have any questions or need further assistance, please don’t hesitate to reach out. We’re more than happy to continue supporting you.
We appreciate your engagement and thank you for being an active part of the community.
Best Regards,
Lakshmi.- v-lgarikapatCommunity Support
Hi ShrutiTrivedi ,
I wanted to follow up and confirm whether you’ve had the opportunity to review the information we provide Should you have any questions or require further clarification, please don't hesitate to reach out.
We appreciate your engagement and thank you for being an active part of the community.
Best regards,
Lakshmi- v-lgarikapatCommunity Support
Hi ShrutiTrivedi ,
We’d like to confirm whether your issue has been successfully resolved. If you still have any questions or need further assistance, please don’t hesitate to reach out. We’re more than happy to continue supporting you.
We appreciate your engagement and thank you for being an active part of the community.
Best Regards,
Lakshmi.