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

Join 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.

Reply
dosborne
New Member

Can't grant ReadOverrideEffectiveIdentity as a Service Principal

Hi, I'm working on a multi-tenant embedded report project where we are using Service Principal Profiles to manage customer permissions, and ReadOverrideEffectiveIdentity to enable RLS. When onboarding a new customer, we create a new Service Principal Profile for them, and grant it ReadOverrideEffectiveIdentity permission to the datasource. To automate this, we have created an 'admin' Service Principal that is a Gateway admin. The 'user' Service Principal that the new Profile belongs to does not have these permissions, it is only allowed to read a basic set of reports.

 

When trying to use the new admin Service Principal grant ReadOverrideEffectiveIdentity on the datasource to the profile however we receive a 401 Unauthorized error:

Request:

POST https://api.powerbi.com/v1.0/myorg/gateways/<gateway-id>/datasources/<datasource-id>/users
Bearer <token for Admin service principal>
Content:
{
	"datasourceAccessRight":"ReadOverrideEffectiveIdentity",
	"identifier":"<user Service Principal id>",
	"principalType":"App",
	"profile":{
		"id":"<user Service Principal profile id>"
	}
}

Response:

{
	"error": {
		"code": "Unauthorized",
		"message": "Gateway.ReadWrite.All is required when adding a datasource user with OverrideEffectiveIdentity access right"
	}
}

 

However, the admin Service Principal does have Gateway.ReadWrite.All permission. Also, if I try and grant "Read" instead of "ReadOverrideEffectiveIdentity", the request succeeds, it's only when requesting "ReadOverrideEffectiveIdentity" that it fails. I don't get the error when calling the API when authenticated with my own user login (which is also a Gateway admin) either, only when calling the API as the admin service principal.

 

Is there something special about "ReadOverrideEffectiveIdentity" that means it can't be granted by a Service Principal?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @dosborne ,

Please check whether you done the steps below:

1. Enable the Allow service principals to use Power BI APIs switch either for the entire organization or for the specific security group you created in Azure AD

yingyinr_1-1669101937251.png

2. Add the service principal as a member or admin to the workspace.

yingyinr_0-1669101921117.png

Best Regards

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @dosborne ,

Whether your problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem as yours. Thank you.

Best Regards

Anonymous
Not applicable

Hi @dosborne ,

Please check whether you done the steps below:

1. Enable the Allow service principals to use Power BI APIs switch either for the entire organization or for the specific security group you created in Azure AD

yingyinr_1-1669101937251.png

2. Add the service principal as a member or admin to the workspace.

yingyinr_0-1669101921117.png

Best Regards

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.