Forum Discussion
Power BI workspace creation using API
- 1 year ago
HI jaineshp
We have achieved the target.
Please note that Power BI roles renamed to Fabric.
https://powerbi.microsoft.com/en-us/blog/power-bi-administrator-role-will-be-renamed-to-fabric-administrator/
Steps performed is
1. Workload identity configuration in AKS cluster2. Assign Fabric Administrator role
3. Tenant Setting Location
The setting "Allow service principals to use Power BI APIs" is found at:
- Power BI Admin Portal → Tenant settings → Developer settings
- Look for "Allow service principals to use Power BI APIs"
4. Add UAMI to capacity group in azure
Thank you all..
Hi Jainesh Poojara,
Thanks for your reply.
Yes. Workload identity configured to in AKS cluster. I am using UAMI already for azure storage APIs.
For Azure storage I am passing scope as https://storage.azure.com/.default
What value we should pass here? Will it accept my old one (Which I am using with SP) https://analysis.windows.net/powerbi/api/.default ?
Hi Koteswara,
Yes, you're absolutely on the right track!
Since you're already using a User Assigned Managed Identity (UAMI) for Azure Storage in your AKS cluster, integrating the same identity for accessing Power BI REST APIs is entirely possible — and the scope you're referring to is correct.
Required Scope for Power BI REST API
When authenticating using a Managed Identity, you should continue to use the following scope:
https://analysis.windows.net/powerbi/api/.default
This scope is consistent across all types of Azure AD identities (Service Principals, Managed Identities, etc.) when accessing the Power BI API.
Summary of What You Need
Correct Scope:
Tenant Settings:
Make sure the Power BI tenant has enabled:
Admin Portal → Tenant Settings → "Allow service principals to use Power BI APIs" (must be enabled for your UAMI or its security group).
Azure Role Assignments:
Assign your UAMI one of the following roles via Azure AD:
Power BI Service Administrator (for full control)
Or assign specific dataset/workspace access via Power BI workspace permissions (e.g., Admin, Member).
AKS Workload Identity Setup:
Since workload identity is already working with Azure Storage, you can use the same mechanism.
Use DefaultAzureCredential from the Azure SDK (Java) to acquire tokens:
TokenCredential credential = new DefaultAzureCredentialBuilder().build();
Token Acquisition Example (Optional):
If you're manually acquiring tokens via HTTP for debug/testing:Make a request to:
http://169.254.169.254/metadata/identity/oauth2/tokenWith query parameters:
resource=https://analysis.windows.net/powerbi/api
&api-version=2018-02-01Add Header:
Metadata: true
Let me know if you need a working Java code snippet or role assignment script.
Glad to help!
Best regards,
Jainesh Poojara
Power BI Developer