Forum Discussion

dmkblesser's avatar
dmkblesser
Icon for Advocate II rankAdvocate II
11 months ago
Solved

Power BI Deployment Pipeline

Hi there,    I'd like to know what's the best way to set up the deployment rules for Power BI deployment pipeline.    I have 3 workspaces assigned to dev, uat and prd stages. I have multiple sema...
  • Nasif_Azam's avatar
    Nasif_Azam
    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:

    Power BI Pipelines REST API

    Deployment Pipelines Automation with REST API

    Power BI Dataset REST API (for parameters and datasets)

     

    Best Regards,
    Nasif Azam