The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi Team,
I am using API (https:// api. powerbi. com/ v1.0/ myorg/ groups) to create a Power BI workspace using java code. For authenticationpurpose I am using Azure Service Principle.
I would like to use User Assigned Managed Identity instead of SP. My code is running in AKS cluster.
Please give me documentation list if any.
What roles we have to assign to User Assigned Managed Identity.
Solved! Go to Solution.
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-admin...
Steps performed is
1. Workload identity configuration in AKS cluster
2. Assign Fabric Administrator role
The setting "Allow service principals to use Power BI APIs" is found at:
4. Add UAMI to capacity group in azure
Thank you all..
Look like Power Bi roles renamed to Fabric.
https://powerbi.microsoft.com/en-us/blog/power-bi-administrator-role-will-be-renamed-to-fabric-admin...
Hi @Koteswara
When you want to switch from using a Service Principal (SP) to a User Assigned Managed Identity (UAMI) for creating a Power BI workspace via the Power BI REST API (https://api.powerbi.com/v1.0/myorg/groups) from your Java code running in Azure Kubernetes Service (AKS), the key change is in how you authenticate. Managed identities allow your AKS workloads to obtain Azure AD tokens without storing credentials. You will need to enable Managed Identity for your AKS workload (using Azure AD workload identity or aad-pod-identity) and configure your Java code to acquire an access token from Azure Instance Metadata Service (IMDS) for the Power BI resource (https://analysis.windows.net/powerbi/api). After obtaining the token, you use it as a Bearer token in your REST API calls just like before. The User Assigned Managed Identity must be: (1) granted Power BI Admin or Contributor permissions on the target Power BI tenant through the Microsoft 365 Admin Center (or via Power BI Admin portal, enabling Service Principal access for this identity), and (2) have the Azure role assignment (Reader or Contributor) only if you are managing Azure resources—but for Power BI REST API, the critical step is to allow the identity in the Power BI Admin portal under "Tenant settings → Developer settings → Allow service principals to use Power BI APIs" and optionally assign it to specific security groups. In summary, after assigning the UAMI to AKS, enabling workload identity, and granting API access in the Power BI Admin portal, your Java code can seamlessly authenticate with MSI instead of storing client secrets.
Hi @Koteswara ,
Thank you for reaching out to the Microsoft Community Forum.
Hi @jaineshp , @rohit1991 , Thank you for your prompt response.
Hi @Koteswara , Could you please try the proposed solution shared by @jaineshp , @rohit1991 . Please do let us know if you have any further queries.
Regards,
Dinesh
Hi @jaineshp , @rohit1991 , @Poojara_D12 and @v-dineshya
Thanks for your assistance.
Allow me for some time. I will check and confirm you here.
Thanks.
Hi Team,
I got reply form my IT team saying they did not find respective role.
Please help me
Hey @Koteswara,
Let me clarify the same.
This is not an Azure AD role but a Power BI-specific admin role. Your IT team needs to:
The setting "Allow service principals to use Power BI APIs" is found at:
Instead of Power BI admin role, you can assign Microsoft Graph API permissions to the UAMI:
Required API Permissions:
Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
Best regards,
Jainesh Poojara / Power BI Developer
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-admin...
Steps performed is
1. Workload identity configuration in AKS cluster
2. Assign Fabric Administrator role
The setting "Allow service principals to use Power BI APIs" is found at:
4. Add UAMI to capacity group in azure
Thank you all..
Hey @Koteswara,
Sounds great!
Mark as Solution – help others too!
Best Regards,
Jainesh Poojara | Power BI Developer
Hi @jaineshp
Alternative Approach that you provided using Graph API permission,
if i'm correct are you looking for the Azure - app registration service with Microsoft Graph api access ?
Our UAMI will not display in this app registration list right
Hey @Koteswara,
You're absolutely correct!
User-Assigned Managed Identities (UAMI) do NOT appear in App Registrations - this is a key distinction that many people get confused about.
Here's the clarification:
You would need to:
For your UAMI to work with Power BI APIs, stick with Option 1 - the Power BI Admin Portal tenant setting.
The Graph API permissions I mentioned earlier would only apply if you were using an App Registration instead of a UAMI.
Thanks for catching that important distinction! 👍
Did it work? ✔ Give a Kudo • Mark as Solution – help others too!
Best regards,
Jainesh Poojara / Power BI Developer
Hi @jaineshp Thank you for your prompt response.
Hi @Koteswara , In addition to @jaineshp response, I am adding Microsoft official document.
Please do let us know if you have any further queries.
Regards,
Dinesh
Hi @Koteswara ,
Using a User Assigned Managed Identity (UAMI) is fully supported for calling the Power BI REST API from AKS. Here’s the streamlined approach:
1. Scope: Stick with https://analysis.windows.net/powerbi/api/.default as your scope when acquiring tokens for Power BI REST API. This is the same as with a Service Principal.
2. Permissions/Roles: Assign your UAMI either the Power BI Service Admin role (for full API control) or just Admin/Member rights on specific workspaces, depending on what your automation needs. In Power BI Admin Portal, make sure “Allow service principals to use Power BI APIs” is enabled—this is required for managed identities too.
3. AKS Setup: If your AKS pod is already using the UAMI for Azure Storage, you’re set. In your Java code, use the Azure SDK’s DefaultAzureCredential to authenticate—no secrets or SP credentials needed.
You don’t have to change your scope or approach when switching from SP to Managed Identity. As long as the right roles are in place and workload identity is configured, UAMI works great for Power BI API automation in AKS.
Hi @Koteswara,
Yes, it’s possible to use User Assigned Managed Identity (UAMI) instead of a Service Principal when calling the Power BI REST API — especially in an AKS (Azure Kubernetes Service) environment. Below is a summary of what you need:
Assign the following Azure AD and Power BI roles to the UAMI:
Azure AD App Role:
Assign Power BI Service Administrator or Power BI Admin API permission via Microsoft Graph/App Registrations.
Power BI Tenant Setting:
Ensure "Allow service principals to use Power BI APIs" is enabled under Admin Portal > Tenant Settings.
Workspace Access (optional):
For managing content inside the workspace, assign the UAMI as Admin to that workspace (if applicable).
Here’s the official documentation you’ll find useful:
Since your code runs in AKS:
Ensure your AKS pod is configured with the UAMI using Azure AD Workload Identity or Azure AD Pod Identity (depending on your setup).
Use DefaultAzureCredential (Azure SDK) to authenticate via the managed identity.
Example (Java SDK):
TokenCredential credential = new DefaultAzureCredentialBuilder().build();
Let me know if you need a sample token acquisition flow or role assignment script.
—
Best regards,
Jainesh Poojara / Power BI Developer
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.
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.
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:
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/token
With query parameters:
Add Header:
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
Please note that useful documentation links are not opening. Please do needful
Here’s the official documentation you’ll find useful:
Use Managed Identity to authenticate your Azure Stream Analytics job to Power BI