fabric-cli-powerbi

작성자: microsoft

Fabric CLI를 사용하여 Power BI 작업(의미 체계 모델, 보고서, DAX 쿼리, 새로 고침, 게이트웨이)을 수행합니다. 사용자가 Power BI 항목으로 작업하거나 필요할 때 활성화됩니다.

npx skills add https://github.com/microsoft/fabric-cli --skill fabric-cli-powerbi

Fabric CLI Power BI Operations

Expert guidance for working with Power BI items (semantic models, reports, dashboards) using the fab CLI.

When to Use This Skill

Activate automatically when tasks involve:

  • Semantic model (dataset) operations — get, export, refresh, update
  • Report management — export, clone, rebind to different model
  • Executing DAX queries against semantic models
  • Managing refresh schedules and troubleshooting failures
  • Gateway and data source configuration
  • TMDL (Tabular Model Definition Language) operations

Prerequisites

  • Load fabric-cli-core skill first for foundational CLI guidance
  • User must be authenticated: fab auth status
  • Appropriate workspace permissions for target items

Automation Scripts

Ready-to-use Python scripts for Power BI tasks. Run any script with --help for full options.

ScriptPurposeUsage
refresh_model.pyTrigger and monitor semantic model refreshpython scripts/refresh_model.py <model> [--wait] [--timeout 300]
list_refresh_history.pyShow refresh history and failure detailspython scripts/list_refresh_history.py <model> [--last N]
rebind_report.pyRebind report to different semantic modelpython scripts/rebind_report.py <report> --model <new-model>

Scripts are located in the scripts/ folder of this skill.

1 - Power BI Item Types

Entity SuffixTypeDescription
.SemanticModelSemantic ModelPower BI dataset (tabular model)
.ReportReportPower BI report (visualizations)
.DashboardDashboardPower BI dashboard (pinned tiles)
.DataflowDataflowPower Query dataflow
.PaginatedReportPaginated ReportRDL-based paginated report

Path Examples

# Semantic model
Production.Workspace/Sales.SemanticModel

# Report connected to model
Production.Workspace/SalesReport.Report

# Dashboard
Production.Workspace/ExecutiveDash.Dashboard

2 - Semantic Model Operations

Get Model Information

# Check if model exists
fab exists "ws.Workspace/Model.SemanticModel"

# Get model properties
fab get "ws.Workspace/Model.SemanticModel"

# Get model ID (needed for Power BI API calls)
fab get "ws.Workspace/Model.SemanticModel" -q "id"

# Get full definition (TMDL)
fab get "ws.Workspace/Model.SemanticModel" -q "definition"

Export Model

# Export to local directory (PBIP format with TMDL)
fab export "ws.Workspace/Model.SemanticModel" -o ./exports -f

Creates folder structure:

Model.SemanticModel/
├── .platform
├── definition.pbism
└── definition/
    ├── model.tmdl
    ├── tables/
    │   ├── Sales.tmdl
    │   └── Date.tmdl
    └── relationships.tmdl

Import/Update Model

# Import from PBIP folder
fab import "ws.Workspace/Model.SemanticModel" -i ./exports/Model.SemanticModel -f

# Copy between workspaces
fab cp "Dev.Workspace/Model.SemanticModel" "Prod.Workspace/Model.SemanticModel" -f

3 - Refresh Operations

Trigger Refresh

# Get IDs
WS_ID=$(fab get "ws.Workspace" -q "id" | tr -d '"')
MODEL_ID=$(fab get "ws.Workspace/Model.SemanticModel" -q "id" | tr -d '"')

# Trigger full refresh
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes" -X post -i '{"type":"Full"}'

# Check refresh status
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes?\$top=1"

Enhanced Refresh (Partition-Level)

# Refresh specific tables
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes" -X post -i '{
  "type": "Full",
  "commitMode": "transactional",
  "objects": [
    {"table": "Sales"},
    {"table": "Inventory"}
  ]
}'

# Refresh with retry
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes" -X post -i '{
  "type": "Full",
  "retryCount": 3
}'

Refresh Schedule

# Get current schedule
fab api -A powerbi "datasets/$MODEL_ID/refreshSchedule"

# Set daily refresh at 6 AM UTC
fab api -A powerbi "datasets/$MODEL_ID/refreshSchedule" -X patch -i '{
  "enabled": true,
  "days": ["Monday","Tuesday","Wednesday","Thursday","Friday"],
  "times": ["06:00"],
  "localTimeZoneId": "UTC"
}'

Troubleshoot Refresh Failures

# Get refresh history
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes"

# Common failure patterns:
# - "credentials" → Update data source credentials
# - "gateway" → Check gateway status
# - "timeout" → Use enhanced refresh with smaller batches
# - "memory" → Optimize model or use incremental refresh

4 - DAX Query Execution

Execute DAX queries against semantic models:

MODEL_ID=$(fab get "ws.Workspace/Model.SemanticModel" -q "id" | tr -d '"')

# Simple query
fab api -A powerbi "datasets/$MODEL_ID/executeQueries" -X post -i '{
  "queries": [{"query": "EVALUATE VALUES(Date[Year])"}]
}'

# Aggregation query
fab api -A powerbi "datasets/$MODEL_ID/executeQueries" -X post -i '{
  "queries": [{
    "query": "EVALUATE SUMMARIZECOLUMNS(Date[Year], \"Total\", SUM(Sales[Amount]))"
  }]
}'

# TOPN query
fab api -A powerbi "datasets/$MODEL_ID/executeQueries" -X post -i '{
  "queries": [{
    "query": "EVALUATE TOPN(10, Product, [Total Sales], DESC)"
  }]
}'

# Query with parameters
fab api -A powerbi "datasets/$MODEL_ID/executeQueries" -X post -i '{
  "queries": [{
    "query": "EVALUATE FILTER(Sales, Sales[Year] = @Year)",
    "parameters": [{"name": "@Year", "value": "2024"}]
  }]
}'

5 - Report Operations

Get Report Info

# Check exists
fab exists "ws.Workspace/Report.Report"

# Get properties
fab get "ws.Workspace/Report.Report"

# Get connected model
fab get "ws.Workspace/Report.Report" -q "definition.parts[?contains(path, 'definition.pbir')].payload | [0]"

Export Report

# Export to PBIP format
fab export "ws.Workspace/Report.Report" -o ./exports -f

Clone Report

# Copy within workspace
fab cp "ws.Workspace/Report.Report" "ws.Workspace/ReportCopy.Report" -f

# Copy to another workspace
fab cp "Dev.Workspace/Report.Report" "Prod.Workspace/Report.Report" -f

Rebind Report to Different Model

WS_ID=$(fab get "ws.Workspace" -q "id" | tr -d '"')
REPORT_ID=$(fab get "ws.Workspace/Report.Report" -q "id" | tr -d '"')
NEW_MODEL_ID=$(fab get "ws.Workspace/NewModel.SemanticModel" -q "id" | tr -d '"')

fab api -A powerbi "groups/$WS_ID/reports/$REPORT_ID/Rebind" -X post -i "{
  \"datasetId\": \"$NEW_MODEL_ID\"
}"

Export Report to File (PDF/PPTX)

# Export to PDF
fab api -A powerbi "groups/$WS_ID/reports/$REPORT_ID/ExportTo" -X post -i '{
  "format": "PDF"
}'

# Poll for completion, then download

6 - Gateway Operations

List Gateways

# Tenant-level gateways (hidden entity)
fab ls .gateways

# Get gateway details
fab get ".gateways/MyGateway.Gateway"

Data Source Management

GATEWAY_ID=$(fab get ".gateways/MyGateway.Gateway" -q "id" | tr -d '"')

# List data sources on gateway
fab api -A powerbi "gateways/$GATEWAY_ID/datasources"

# Get data source status
fab api -A powerbi "gateways/$GATEWAY_ID/datasources/$DATASOURCE_ID"

Update Data Source Credentials

# Update credentials (basic auth example)
fab api -A powerbi "gateways/$GATEWAY_ID/datasources/$DATASOURCE_ID" -X patch -i '{
  "credentialDetails": {
    "credentialType": "Basic",
    "credentials": "{\"credentialData\":[{\"name\":\"username\",\"value\":\"user\"},{\"name\":\"password\",\"value\":\"pass\"}]}",
    "encryptedConnection": "Encrypted",
    "encryptionAlgorithm": "None",
    "privacyLevel": "Organizational"
  }
}'

7 - Take Over Ownership

When a semantic model owner leaves the organization:

WS_ID=$(fab get "ws.Workspace" -q "id" | tr -d '"')
MODEL_ID=$(fab get "ws.Workspace/Model.SemanticModel" -q "id" | tr -d '"')

# Take over semantic model ownership
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/Default.TakeOver" -X post

8 - Common Patterns

Dev to Production Deployment

#!/bin/bash
DEV_WS="Dev.Workspace"
PROD_WS="Prod.Workspace"

# 1. Export from dev
fab export "$DEV_WS/Sales.SemanticModel" -o ./deploy -f
fab export "$DEV_WS/SalesReport.Report" -o ./deploy -f

# 2. Import to prod
fab import "$PROD_WS/Sales.SemanticModel" -i ./deploy/Sales.SemanticModel -f
fab import "$PROD_WS/SalesReport.Report" -i ./deploy/SalesReport.Report -f

# 3. Trigger refresh
PROD_WS_ID=$(fab get "$PROD_WS" -q "id" | tr -d '"')
MODEL_ID=$(fab get "$PROD_WS/Sales.SemanticModel" -q "id" | tr -d '"')
fab api -A powerbi "groups/$PROD_WS_ID/datasets/$MODEL_ID/refreshes" -X post -i '{"type":"Full"}'

# 4. Verify
fab api -A powerbi "groups/$PROD_WS_ID/datasets/$MODEL_ID/refreshes?\$top=1" -q "value[0].status"

Backup Semantic Model

# Export definition for version control
fab export "Prod.Workspace/Model.SemanticModel" -o ./backups/$(date +%Y%m%d) -f
git add ./backups/
git commit -m "Backup Model $(date +%Y-%m-%d)"

Incremental Refresh Setup

For large models, use incremental refresh:

  1. Configure in Power BI Desktop with RangeStart/RangeEnd parameters
  2. Publish to workspace
  3. First refresh creates partitions:
# Monitor partition creation
fab api -A powerbi "groups/$WS_ID/datasets/$MODEL_ID/refreshes?\$top=5"

9 - Safety Guidelines

  • Always verify workspace context before refresh operations
  • Test in dev first — never refresh production without testing
  • Monitor refresh duration — set appropriate timeouts
  • Backup before major changes — export definition before updates
  • Use enhanced refresh for large models to avoid timeouts

10 - References

For detailed patterns, see:

microsoft의 다른 스킬

oss-growth
microsoft
OSS 성장 해커 페르소나
official
microsoft-foundry
microsoft
Foundry 에이전트를 엔드투엔드로 배포, 평가 및 관리: Docker 빌드, ACR 푸시, 호스팅/프롬프트 에이전트 생성, 컨테이너 시작, 배치 평가, 지속적 평가, 프롬프트 최적화 워크플로, agent.yaml, 트레이스에서 데이터셋 큐레이션. 용도: Foundry에 에이전트 배포, 호스팅 에이전트, 에이전트 생성, 에이전트 호출, 에이전트 평가, 배치 평가 실행, 지속적 평가, 지속적 모니터링, 지속적 평가 상태, 프롬프트 최적화, 프롬프트 개선, 프롬프트 최적화 도구, 에이전트 지침 최적화, 에이전트 개선...
officialdevelopmentdevops
azure-ai
microsoft
Azure AI: Search, Speech, OpenAI, Document Intelligence에 사용됩니다. 검색, 벡터/하이브리드 검색, 음성-텍스트 변환, 텍스트-음성 변환, 전사, OCR을 지원합니다. 사용 시점: AI Search, 쿼리 검색, 벡터 검색, 하이브리드 검색, 의미 검색, 음성-텍스트 변환, 텍스트-음성 변환, 전사, OCR, 텍스트를 음성으로 변환.
officialdevelopmentapi
azure-deploy
microsoft
이미 준비된 애플리케이션에 대해 기존 .azure/deployment-plan.md 및 인프라 파일이 있는 경우 Azure 배포를 실행합니다. 사용자가 새 애플리케이션 생성을 요청할 때는 이 스킬을 사용하지 말고 azure-prepare를 사용하세요. 이 스킬은 azd up, azd deploy, terraform apply, az deployment 명령을 내장된 오류 복구 기능과 함께 실행합니다. azure-prepare의 .azure/deployment-plan.md와 azure-validate의 검증 상태가 필요합니다. 사용 시점: "run azd up", "run azd deploy", "execute deployment",...
officialdevopsaws
azure-storage
microsoft
Azure Storage Services는 Blob Storage, File Shares, Queue Storage, Table Storage, Data Lake를 포함합니다. 스토리지 액세스 계층(hot, cool, cold, archive), 각 계층 사용 시기 및 계층 비교에 대한 질문에 답변합니다. 객체 스토리지, SMB 파일 공유, 비동기 메시징, NoSQL 키-값, 빅데이터 분석을 제공합니다. 수명 주기 관리를 포함합니다. 사용 용도: blob 스토리지, 파일 공유, 큐 스토리지, 테이블 스토리지, 데이터 레이크, 파일 업로드, blob 다운로드, 스토리지 계정, 액세스 계층,...
officialdevelopmentdatabase
azure-diagnostics
microsoft
Azure에서 AppLens, Azure Monitor, 리소스 상태 및 안전한 트라이지를 사용하여 Azure 프로덕션 문제를 디버그합니다. 사용 시기: 프로덕션 문제 디버그, 앱 서비스 문제 해결, 앱 서비스 높은 CPU, 앱 서비스 배포 실패, 컨테이너 앱 문제 해결, 함수 문제 해결, AKS 문제 해결, kubectl 연결 불가, kube-system/CoreDNS 오류, pod 보류 중, crashloop, 노드 준비 안 됨, 업그레이드 실패, 로그 분석, KQL, 인사이트, 이미지 풀 실패, 콜드 스타트 문제, 상태 프로브 실패,...
officialdevopsdevelopment
azure-prepare
microsoft
Azure 앱을 배포용으로 준비합니다(인프라 Bicep/Terraform, azure.yaml, Dockerfiles). 생성/현대화 또는 생성+배포에 사용하며, 크로스 클라우드 마이그레이션에는 사용하지 않습니다(azure-cloud-migrate 사용). 다음에는 사용하지 마십시오: copilot-sdk 앱(azure-hosted-copilot-sdk 사용). 사용 시점: "앱 생성", "웹 앱 빌드", "API 생성", "서버리스 HTTP API 생성", "프론트엔드 생성", "백엔드 생성", "서비스 빌드", "애플리케이션 현대화", "애플리케이션 업데이트", "인증 추가", "캐싱 추가", "Azure에 호스팅", "생성 및...
officialdevelopmentdevops
azure-validate
microsoft
Azure 배포 전 준비 상태 검증. 구성, 인프라(Bicep 또는 Terraform), RBAC 역할 할당, 관리 ID 권한, 사전 요구 사항에 대한 심층 점검을 실행합니다. 사용 시점: 내 앱 검증, 배포 준비 상태 확인, 사전 점검 실행, 구성 확인, 배포 가능 여부 확인, azure.yaml 검증, Bicep 검증, 배포 전 테스트, 배포 오류 문제 해결, Azure Functions 검증, 함수 앱 검증, 서버리스 검증...
officialdevopstesting