Forum Discussion
FUAM Load_FUAM_Data_E2E error
- 1 year ago
Just an update on this. I discovered my issue was that the group with the SP account in it was not a member of the Admin Monitoring Workspace. When i added the group to this the pipeline ran successfully.
You do not need to add ANY permissions to the SP account in Azure.
Sure, here’s a step-by-step guide to setting up a service principal for use with Fabric APIs and pipelines. This assumes you're using it for automation (like notebooks or pipelines) and need access to capacity or workspace-level resources.
✅ Step 1: Register the App (Service Principal) in Azure AD
- Go to Azure Portal > Azure Active Directory > App registrations
- Click New registration
- Give it a name (e.g., fabric-sp)
- Set the redirect URI to https://localhost (you can leave it blank if not needed)
- Click Register
✅ Step 2: Assign API Permissions
- In the app you just registered, go to API permissions
- Click Add a permission > APIs my organization uses
- Search for Power BI Service and select it
- Add the following Application permissions:
- Tenant.Read.All
- Capacity.Read.All
- Click Grant admin consent (must be done by a global admin)
✅ Step 3: Create a Client Secret
- Go to Certificates & secrets
- Click New client secret
- Set an expiration and copy the value (you’ll need this for token generation)
✅ Step 4: Add the Service Principal to a Security Group (Optional but recommended)
- Create a security group in Azure AD (e.g., fabric-api-access)
- Add the service principal as a member
- Use this group to manage access in Fabric
✅ Step 5: Assign Roles in Microsoft Fabric
- Go to Microsoft Fabric Admin Portal
- Under Tenant settings, make sure service principals are allowed
- Go to Workspaces or Capacities
- Add the service principal (or its security group) as:
- Admin or Contributor on the workspace
- Capacity Admin if needed
✅ Step 6: Generate a Token
Use a tool like Postman or a script to get a token:
Token URL:
https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/tokenBody (x-www-form-urlencoded):
client_id: <your-app-id> client_secret: <your-client-secret> scope: https://analysis.windows.net/powerbi/api/.default grant_type: client_credentials
✅ Step 7: Test the API Call
Try calling a simple endpoint like:
GET https://api.powerbi.com/v1.0/myorg/capacities Authorization: Bearer <your-access-token>
If this works, your setup is good.7
Thank you i will give this a go. However, the instructions are not very clear then as it says
- Create a new service principal with client secret within Azure Entra ID, without any API permissions.
It specifically says without any api permissions then in your instructions you are assigning api permissions? Should the github not say what permissions need added instead of don't give any permissions ?
Step 2: Assign API Permissions
- In the app you just registered, go to API permissions
- Click Add a permission > APIs my organization uses
- burakkaragoz1 year ago
Super User
Great catch, and I totally get why that might seem confusing.
Here’s the clarification:
When the documentation says the service principal should have “no permissions,” it usually refers to not assigning any user-level roles or workspace access manually at first — especially when testing token generation or basic connectivity.
However, for the service principal to actually call Fabric or Power BI APIs, it absolutely needs API permissions assigned in Azure AD (Step 2 in the guide). These are application-level permissions like Tenant.Read.All or Capacity.Read.All, and they must be granted with admin consent.
So in short:
- No user-level roles initially → to keep the setup clean and testable
- Yes to API permissions → required for the token to work with Power BI endpoints
Let me know if you want me to walk through the permission scopes or show how to verify them in Azure.
- higgy71 year ago
Advocate II
Thanks for this, i guess my query then is isn't the permission applied via the following:
So within the admin settings of Fabric/Power BI rather than within the app registration? If this is the case i have added the SP to a security group and then added the group to the 2 settings stated