Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Trying to use the Add Datasource User operation (https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/adddatasourceuser)
I am an owner of the data gateway in question, and I can read the gateway info and datasources fine using the API, but when I try to add a service principal to a datasource I get a 401 error (with no additional detail in the response).
Are there any special permissions required for adding a user to a datasource?
The documentation only mentions users and email enabled security groups. Service principals are not mentioned.
https://docs.microsoft.com/en-us/power-bi/connect-data/service-gateway-data-sources#manage-users