Forum Discussion
Power BI Deployment Pipeline
- 11 months ago
Hey dmkblesser ,
Currently, Power BI REST API provides extensive capabilities for managing deployment pipelines such as creating pipelines, assigning workspaces, deploying content, and retrieving pipeline details. However, there is no dedicated REST API endpoint specifically designed for "bulk updating deployment rules" (parameter or data source rules) on semantic models within deployment pipelines at once.
Deployment rules in Power BI pipelines must be set per dataset in the UI or via individual scripts. REST APIs cover pipeline and workspace management but don’t support bulk editing of deployment rules.
For automation scenarios, the typical approach is:
-
Use the Power BI REST API to get the pipeline details, stage artifacts (datasets/models).
-
Programmatically update parameter values or data source references using Power BI dataset APIs or PowerShell scripts.
-
Apply these updates per dataset/semantic model programmatically, effectively performing a "bulk" update by iterating through all models in your script.
Integrate this scripting with Azure DevOps (ADO) or other CI/CD tools to trigger deployments and configuration updates in a pipeline workflow.
So, bulk editing deployment rules in a single API call isn’t supported, but you can script with REST API and PowerShell to update each semantic model individually.
Script Outline for Automating Deployment Rule Updates:
1) Authenticate to Power BI REST API
-
Use Azure AD app or service principal with required API permissions.
-
Get access token for API calls.
2) Get Deployment Pipeline Information
-
Call GET /pipelines to list pipelines.
-
Call GET /pipelines/{pipelineId}/stages to get stages (dev, uat, prd).
-
Call GET /pipelines/{pipelineId}/stages/{stageId}/artifacts to list datasets/models in each stage.
3) For Each Semantic Model / Dataset in a Stage
-
Retrieve current deployment rules or data source parameters.
-
Prepare updated parameter values based on target environment (dev, uat, prd).
4) Update Deployment Rules for Each Dataset
-
Currently, no direct API to update deployment rule in bulk.
-
Use Dataset/Model APIs or embed parameter update commands in scripts.
-
For each dataset, apply updated parameters using PATCH or equivalent calls or PowerShell cmdlets that support dataset parameters update.
5) Trigger Deployment if Needed: Use deployment pipeline API to deploy content from one stage to another after updating rules.
6) Integrate with ADO Pipeline
-
Wrap the above steps in PowerShell or other scripting language.
-
Use ADO pipeline tasks to authenticate, run scripts, and manage stages.
For Detailed Information:
Deployment Pipelines Automation with REST API
Power BI Dataset REST API (for parameters and datasets)
Best Regards,
Nasif Azam -
Hi Nasif_Azam, thank you for your reply. This is helpful.
I'm curious to know which REST API I can use to update the deployment rule? I do use Powershell script outside of the UI. We integrated the powershell script with an ADO pipeline so when move stages, ADO triggeres the Power BI pipeline to deploy reports and semantic models. However, I couldn't find the relating API call that I can use to "bulk edit" the rules. Can you help me to point that out? thanks!
Hey dmkblesser ,
Currently, Power BI REST API provides extensive capabilities for managing deployment pipelines such as creating pipelines, assigning workspaces, deploying content, and retrieving pipeline details. However, there is no dedicated REST API endpoint specifically designed for "bulk updating deployment rules" (parameter or data source rules) on semantic models within deployment pipelines at once.
Deployment rules in Power BI pipelines must be set per dataset in the UI or via individual scripts. REST APIs cover pipeline and workspace management but don’t support bulk editing of deployment rules.
For automation scenarios, the typical approach is:
-
Use the Power BI REST API to get the pipeline details, stage artifacts (datasets/models).
-
Programmatically update parameter values or data source references using Power BI dataset APIs or PowerShell scripts.
-
Apply these updates per dataset/semantic model programmatically, effectively performing a "bulk" update by iterating through all models in your script.
Integrate this scripting with Azure DevOps (ADO) or other CI/CD tools to trigger deployments and configuration updates in a pipeline workflow.
So, bulk editing deployment rules in a single API call isn’t supported, but you can script with REST API and PowerShell to update each semantic model individually.
Script Outline for Automating Deployment Rule Updates:
1) Authenticate to Power BI REST API
-
Use Azure AD app or service principal with required API permissions.
-
Get access token for API calls.
2) Get Deployment Pipeline Information
-
Call GET /pipelines to list pipelines.
-
Call GET /pipelines/{pipelineId}/stages to get stages (dev, uat, prd).
-
Call GET /pipelines/{pipelineId}/stages/{stageId}/artifacts to list datasets/models in each stage.
3) For Each Semantic Model / Dataset in a Stage
-
Retrieve current deployment rules or data source parameters.
-
Prepare updated parameter values based on target environment (dev, uat, prd).
4) Update Deployment Rules for Each Dataset
-
Currently, no direct API to update deployment rule in bulk.
-
Use Dataset/Model APIs or embed parameter update commands in scripts.
-
For each dataset, apply updated parameters using PATCH or equivalent calls or PowerShell cmdlets that support dataset parameters update.
5) Trigger Deployment if Needed: Use deployment pipeline API to deploy content from one stage to another after updating rules.
6) Integrate with ADO Pipeline
-
Wrap the above steps in PowerShell or other scripting language.
-
Use ADO pipeline tasks to authenticate, run scripts, and manage stages.
For Detailed Information:
Deployment Pipelines Automation with REST API
Power BI Dataset REST API (for parameters and datasets)
Best Regards,
Nasif Azam