Forum Discussion
Anyone able to use Get Model API with Power Platform custom connector?
- 1 year ago
Hi arpost,
Thank you for your follow-up.
When using the HTTP with Azure AD action in Power Automate, pre-authorization is managed automatically through client credentials. You only need to configure the action with the appropriate Azure AD details, and Power Automate will handle token acquisition seamlessly in the background.
If you find our response helpful, kindly consider marking it as the accepted solution and providing kudos. This will greatly assist other members of the community who may have similar queries.
Should you have any further questions, please feel free to reach out to the Microsoft Fabric community.
Thank you.
Thankyou, burakkaragoz, for your response.
Hi arpost,
Based on my understanding of the error message, you are currently using delegated permissions with a service principal. This is not supported for certain APIs, such as the Get Model API in Microsoft Fabric/Power BI. Delegated permissions function only with signed-in users, whereas service principals require application permissions.
Kindly follow the steps outlined below, which may help you resolve the issue:
- As you are using a service principal, you need to switch from delegated permissions to application permissions in your Azure App Registration.
- Navigate to Azure Portal > App registrations > [Your App] > API permissions. Click on "Add a permission." Select "Power BI Service," then switch to the "Application permissions" tab (and not "Delegated"). Add the required permissions such as Dataset.Read.All, SemanticModel.Read.All, and any others needed, for example, Workspace.Read.All. Click "Add permissions" and ensure you grant admin consent for your tenant. This is essential for service principals, as admin consent is mandatory for application permissions.
- Custom connectors cannot be used with service principals because they don’t support client credentials flow.
- Since service principals authenticate without user interaction, it is necessary to use the client credentials flow rather than the authorization code or delegated flows. However, custom connectors in Power Platform do not natively support the client credentials flow. A recommended solution is to use a custom connector backed by an Azure Function or Azure API Management, which obtains a token using the client credentials grant and proxies the request. Alternatively, you may use the Power Automate HTTP action instead of a custom connector by using the HTTP with Azure AD connector. Configure it with the Tenant ID, Client ID, Client Secret, and Resource set to https://analysis.windows.net/powerbi/api and call the Get Model API directly with this token.
- Lastly, please ensure that the service principal has at least Member access in the workspace and that the dataset/model you intend to query is published and accessible from that workspace.
For your reference, please review the following link:
Authenticate your API and connector with Microsoft Entra ID | Microsoft Learn
If you find this response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members facing similar challenges. Should you have any further queries, please feel free to reach out to the Microsoft Fabric community.
Thank you.
v-pnaroju-msft, thank you for the reply. Regarding the Get Model and Get Model Definition APIs, the MS documentation states that these are supported for Use authenticated scenarios (see Get Model and Get Model Definition).
Also, Application Permissions for the App Registration in Azure doesn't include any of the stated permissions. That tab only includes tenant-wide items.