Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Power BI Report Promotion

Manage and promote Power BI .pbix reports across Dev → Test → UAT → Prod workspaces via GitHub Actions.


Repository Structure

powerbi analytics/
├── .github/workflows/
│   └── promote-report.yml      # Manual promotion pipeline
├── reports/
│   └── <report-folder>/
│       ├── <report>.pbix       # The report file (committed to git)
│       └── report.config.json  # Report metadata + workspace IDs per env
├── environments/
│   ├── dev.json
│   ├── test.json
│   ├── uat.json
│   └── prod.json               # Workspace IDs per environment
├── scripts/
│   ├── deploy.ps1              # Deployment logic (PowerShell)
│   └── list-reports.ps1        # List reports in a workspace
└── .gitignore

One-time Setup

1. Create an Azure AD Service Principal

In Azure Portal → App Registrations → New registration:

  • Note the Application (client) ID and Tenant ID
  • Under Certificates & secrets, create a new client secret

In Power BI Admin Portal → Tenant settings:

  • Enable "Allow service principals to use Power BI APIs"
  • Add your service principal's security group

Add the service principal as a Member to each workspace (Dev, Test, UAT, Prod).

2. Populate environment configs

Edit each file in /environments/ with your actual workspace IDs:

{
  "tenantId":      "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "workspaceId":   "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "workspaceName": "PowerBI-DEV"
}

3. Add GitHub Secrets

In your GitHub repo → Settings → Secrets and variables → Actions:

Secret name Value
PBI_CLIENT_ID Service Principal Application (client) ID
PBI_CLIENT_SECRET Service Principal client secret

4. Configure GitHub Environments (for approvals)

In Settings → Environments, create four environments: dev, test, uat, prod.

For uat and prod, add Required reviewers — those people will receive an approval request before any deployment runs.


Adding a New Report

  1. Create a folder under /reports/:

    reports/
    └── my-new-report/
        ├── my-new-report.pbix
        └── report.config.json
    
  2. Copy the template report.config.json and fill in the details:

    {
      "reportName": "My New Report",
      "pbixFile": "my-new-report.pbix",
      "owner": "your-team@company.com",
      "datasetName": "My Dataset",
      "environments": {
        "dev":  { "reportId": "", "datasetId": "" },
        "test": { "reportId": "", "datasetId": "" },
        "uat":  { "reportId": "", "datasetId": "" },
        "prod": { "reportId": "", "datasetId": "" }
      }
    }
  3. Add the folder name to the report_folder options in .github/workflows/promote-report.yml:

    options:
      - sample-report
      - my-new-report    # <-- add here
  4. Commit and push.


Promoting a Report

  1. Go to GitHub → Actions → Promote Power BI Report
  2. Click Run workflow
  3. Select:
    • Report folder — the report you want to deploy
    • Target environmentdev, test, uat, or prod
  4. Click Run workflow

For uat and prod, the pipeline will pause and send an approval notification before deploying.

After a successful deployment, report.config.json is automatically updated with the new report and dataset IDs for that environment.


Running Locally

# Deploy a report to dev
.\scripts\deploy.ps1 `
  -ReportFolder "my-new-report" `
  -Environment  "dev" `
  -ClientId     "your-client-id" `
  -ClientSecret "your-client-secret"

# List all reports in prod
.\scripts\list-reports.ps1 `
  -Environment  "prod" `
  -ClientId     "your-client-id" `
  -ClientSecret "your-client-secret"
  1. Fill in environments/*.json — add your real tenantId and workspaceId for each workspace
  2. Create scout-model.pbix — follow the Option 1 steps (Save As from your existing Scout .pbix, delete all pages)
  3. Add GitHub Secrets — PBI_CLIENT_ID, PBI_CLIENT_SECRET, and DB credentials per env
  4. Push everything to GitHub — then the pipelines will be ready to run

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages