- Recorded Tutorial on YouTube: https://goto.pbi.tools/howto-pbi-rest-api-vscode
- Official Power BI REST API Docs
- vscode REST Client Extension, 0.24.6 version
- Interactive login via browser using Device Code Flow
- Create AAD application
- Allow "Public client flows"
- Configure Power BI Service permissions (delegated)
Authorization: Bearer {{$aadV2Token scopes:https://analysis.windows.net/powerbi/api/.default clientId:00000000-0000-0000-0000-000000000000}}
Use the new keyword to force fetching a new access token:
Authorization: Bearer {{$aadV2Token new scopes:https://analysis.windows.net/powerbi/api/.default clientId:00000000-0000-0000-0000-000000000000}}
- Automated login using service principal credentials
- Service principal needs to be authorized using Power BI Admin Portal: "Allow service principals to use Power BI APIs"
- Service principal needs to be granted workspace-level permissions
- Configure service principal credentials
aadV2TenantId,aadV2ClientId,aadV2ClientSecret"aadV2AppUri": "https://analysis.windows.net/powerbi/api"
Authorization: Bearer {{$aadV2Token appOnly}}
- Use any of the API endpoints starting with /admin
- Interactive login via browser using Device Code Flow
- AAD application needs to have
Tenant.ReadWrite.All(orTenant.Read.All) permission configured and have admin consent granted
Authorization: Bearer {{$aadV2Token scopes:https://analysis.windows.net/powerbi/api/.default clientId:00000000-0000-0000-0000-000000000000}}
- Use any of the Read-Only API endpoints starting with /admin
- Service principal needs to be authorized using Power BI Admin Portal: "Allow service principals to use read-only Power BI APIs"
Authorization: Bearer {{$aadV2Token appOnly}}