Microsoft Power BI CLI

The Paradime SDK provides CLI commands to interact with Microsoft Power BI, allowing you to trigger dataset refreshes and list available datasets with real-time monitoring capabilities.

Refresh Power BI Datasets

Trigger refreshes for one or more Power BI datasets with parallel execution and comprehensive status reporting.

CLI Command

paradime run power-bi-refresh

Options

Flag
Type
Description

--dataset-name

Required, TEXT (multiple)

The name of the Power BI dataset(s) you want to refresh. Can specify multiple datasets by repeating the flag.

--client-id

Required, TEXT

Your Azure AD application client ID. Can be set via POWER_BI_CLIENT_ID environment variable.

--client-secret

Required, TEXT

Your Azure AD application client secret. Can be set via POWER_BI_CLIENT_SECRET environment variable.

--tenant-id

Required, TEXT

Your Azure AD tenant ID. Can be set via POWER_BI_TENANT_ID environment variable.

--group-id

Required, TEXT

The Power BI workspace group ID. Can be set via POWER_BI_GROUP_ID environment variable.

--refresh-request-body-b64

Optional, TEXT

Base64 encoded JSON string for refresh parameters. Can be set via POWER_BI_REFRESH_REQUEST_BODY_B64 environment variable.

Recommended Setup

For security and convenience, set your Power BI credentials as environment variables:

POWER_BI_CLIENT_ID="your_client_id"
POWER_BI_CLIENT_SECRET="your_client_secret"
POWER_BI_TENANT_ID="your_tenant_id"
POWER_BI_GROUP_ID="your_workspace_group_id"

Dataset Refresh Examples

Refresh a single dataset

# Using environment variables (recommended)
paradime run power-bi-refresh --dataset-name "Sales Dashboard"

# Or with explicit flags
paradime run power-bi-refresh \
  --client-id "your_client_id" \
  --client-secret "your_client_secret" \
  --tenant-id "your_tenant_id" \
  --group-id "your_group_id" \
  --dataset-name "Sales Dashboard"

Refresh multiple datasets in parallel

# Using environment variables (recommended)
paradime run power-bi-refresh \
  --dataset-name "Sales Dashboard" \
  --dataset-name "Marketing Analytics" \
  --dataset-name "Financial Reports"

# Or with explicit flags
paradime run power-bi-refresh \
  --client-id "your_client_id" \
  --client-secret "your_client_secret" \
  --tenant-id "your_tenant_id" \
  --group-id "your_group_id" \
  --dataset-name "Sales Dashboard" \
  --dataset-name "Marketing Analytics" \
  --dataset-name "Financial Reports"

Refresh with custom parameters

# Refresh with specific partition or table refresh
export POWER_BI_REFRESH_REQUEST_BODY_B64='eyJ0eXBlIjoiZnVsbCIsImNvbW1pdE1vZGUiOiJ0cmFuc2FjdGlvbmFsIiwibWF4UGFyYWxsZWxpc20iOjJ9'

paradime run power-bi-refresh \
  --dataset-name "Large Dataset" \
  --refresh-request-body-b64 "$POWER_BI_REFRESH_REQUEST_BODY_B64"

Sample Output

List Power BI Datasets

List all available Power BI datasets in a workspace with their IDs, names, and refresh status.

CLI Command

paradime run power-bi-list-datasets

Options

Flag
Type
Description

--client-id

Required, TEXT

Your Azure AD application client ID. Can be set via POWER_BI_CLIENT_ID environment variable.

--client-secret

Required, TEXT

Your Azure AD application client secret. Can be set via POWER_BI_CLIENT_SECRET environment variable.

--tenant-id

Required, TEXT

Your Azure AD tenant ID. Can be set via POWER_BI_TENANT_ID environment variable.

--group-id

Required, TEXT

The Power BI workspace group ID. Can be set via POWER_BI_GROUP_ID environment variable.

Usage Examples

# List all datasets (using environment variables)
paradime run power-bi-list-datasets

# With explicit credentials
paradime run power-bi-list-datasets \
  --client-id "your_client_id" \
  --client-secret "your_client_secret" \
  --tenant-id "your_tenant_id" \
  --group-id "your_group_id"

Dataset Status Reference

Understanding the refresh capabilities and status indicators:

Refresh States

  • ✅ Refreshable: Dataset can be refreshed programmatically

  • ❌ Not Refreshable: Dataset cannot be refreshed (e.g., streaming datasets, live connections)

Important Notes

  • Parallel Execution: Multiple datasets refresh simultaneously for efficiency

  • Authentication: Uses Azure AD service principal authentication

  • Workspace Permissions: Service principal must have workspace access

  • Refresh Limits: Subject to Power BI capacity and refresh quotas

  • Timeout Handling: Individual dataset refreshes timeout after 60 seconds for triggering

  • Dataset Identification: Use exact dataset names from your Power BI workspace

Environment Variable Reference

Environment Variable
Description

POWER_BI_CLIENT_ID

Azure AD application client ID

POWER_BI_CLIENT_SECRET

Azure AD application client secret

POWER_BI_TENANT_ID

Azure AD tenant ID

POWER_BI_GROUP_ID

Power BI workspace group ID

POWER_BI_REFRESH_REQUEST_BODY_B64

Base64 encoded refresh parameters (optional)

Troubleshooting

Authentication Errors

Ensure your Azure AD application has proper permissions:

# Check if credentials are valid by listing datasets first
paradime run power-bi-list-datasets
Dataset Not Found

Use the list command to find exact dataset names:

paradime run power-bi-list-datasets
Insufficient Permissions

Service principal needs at least "Contributor" role in the Power BI workspace.

Non-Refreshable Datasets

Some dataset types cannot be refreshed via API. Check the dataset type in Power BI service.

Workflow Integration

These Microsoft Power BI CLI commands are designed to integrate seamlessly into your data pipeline workflows. Common use cases include:

  1. Post-dbt Refresh: Trigger Microsoft Power BI refreshes after dbt model runs complete

  2. Scheduled Data Updates: Automate regular refresh cycles for critical dashboards

  3. CI/CD Integration: Include Microsoft Power BI refreshes in your deployment pipelines

  4. Resource Discovery: Use list commands to programmatically discover available workbooks and data sources

For more information about integrating Tableau refreshes into your Paradime workflows, see the Bolt Schedules documentation.

Last updated

Was this helpful?