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 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.