Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
How do I give my service principal profile access to a gateway datasource?
I'm currently trying to call https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/add-datasource-user with gatewayid, datasourceid, identifier (service principal app id) and profile (service principal profile).
The API call is authenticated using the service principal in question. (not the profile)
The service principal is member of an AD security group that is "Admin" for the gateway, and "Owner" for the datasource.
The API call results in an "Unathourized" response.
Solved! Go to Solution.
Problem was solved by sending the correct object id as "identifier" to the API. Ref https://docs.microsoft.com/en-us/power-bi/developer/embedded/embedded-troubleshoot#what-is-the-diffe...
Problem was solved by sending the correct object id as "identifier" to the API. Ref https://docs.microsoft.com/en-us/power-bi/developer/embedded/embedded-troubleshoot#what-is-the-diffe...
Thanks, this was useful, I will only add this in case someone else needs it. The correct payload for a service principal profile is the one below:
{
"datasourceAccessRight": "Read",
"identifier": "{{Object ID}}", //fix, this is the enterprise application
"principalType":"App", //enterprise application
"profile": {
"id": "{{Service Principal Profile ID}}",
"displayName": "{{Service Principal Profile Name}}" //this is optional.
}
}
Gateway data sources are consumed by developer personas. The regular report users do not need to know about that setup at all. Are you saying that your service principal is a developer?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |