There might be few potential causes for this issue.
Lack of Power BI Subscription - so your organization must have an active Power BI subscription or be allowed to use Power BI services to integrate with Power BI APIs. This includes Power BI Pro for users who will be distributing content and Power BI Premium for capacity-based service features, including embedding analytics.
Insufficient Permissions in Azure AD
The specific permissions you need to grant depend on what your application aims to do with Power BI. However, common permissions include:
- Dataset.Read.All: Allows the app to read all datasets.
- Report.Read.All: Allows the app to read all reports.
- Dashboard.Read.All: Allows the app to read all dashboards.
- Group.Read.All: Allows reading metadata and the content of groups.
- Content.Create: Allows the app to create content in Power BI.
For embedding scenarios, you might also need permissions like
App.Read.All
andWorkspace.ReadWrite.All
, depending on whether your app needs to read app metadata or manage workspaces.
Step by step to grant permissions:
- Navigate to Azure Active Directory: Log in to the Azure Portal and select Azure Active Directory from the services list.
- App Registrations: Go to "App registrations" and select the application you're working with (e.g., "PBI Embedded Demo").
- API Permissions: In the application's overview page, find and click on "API permissions".
- Add a Permission: Click on "Add a permission", then choose "APIs my organization uses". Search for "Power BI Service" and select it.
- Request Permissions: You'll see options for Delegated Permissions and Application Permissions:
- Delegated Permissions are used when calls are made on behalf of a user.
- Application Permissions are used when calls are made as the application itself.
- Select Required Permissions: Based on your application's needs, select the appropriate permissions (e.g.,
Dataset.Read.All
,Report.Read.All
). After selecting, click on "Add permissions" at the bottom. - Grant Admin Consent: Once the permissions are added, you need to grant admin consent for these permissions to take effect. This step requires Azure AD admin privileges. Click on "Grant admin consent for [Your Organization]" and confirm.
Power BI Service Not Registered in Azure AD - for your Azure AD tenant to interact with Power BI services, PBI must be registered within your Azure Active Directory (Azure AD) as an API permission. It should be pre-registered application in Azure AD so this should not be an issue.If it's not registered or recognized, you might need to look at this as well.