Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
Qondor_AM
New Member

Gateways and Datasources with Service Principal Profile

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.

1 ACCEPTED SOLUTION
Qondor_AM
New Member

3 REPLIES 3
Qondor_AM
New Member

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.
  }
  
}
lbendlin
Super User
Super User

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?

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Kudoed Authors