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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Acquired token gives 401 Unauthorized when trying to create DataSet

Hi

im building an app to push data to a dataset in Power Bi

 

the token i got from azure does not seam to have te persissions i gave til ap in "app registrations"

the code om using to acquire the token is 

 

string resourceUri = "https://analysis.windows.net/powerbi/api";
string authorityUri = "https://login.windows.net/common/";
           
AuthenticationContext authenticationContext = new AuthenticationContext(authorityUri);
var AuthResult = authenticationContext.AcquireTokenAsync(resourceUrinew ClientCredential(ClientIDAppSecret)).Result;
 
return AuthResult.AccessToken;

and the permissions that is grated in azure ad

pbi.png

but when i try to create the dataset it gives me an 401

i can create the dataset when i generate the token for a user with powershell but not with the token generated from client_id and client_secret

 

Hope you can help

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Solved it myself 

 

App registration (service principal) needs to be a member of a Security group

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Solved it myself 

 

App registration (service principal) needs to be a member of a Security group

I am facing same issues.  Could you please explain the solution? I dont understand how App registration can become a service principal? which service group should that be added to?

Can you please explian or direct how the service principal added to security group

Anonymous
Not applicable

Can you tell me, how exactly you have added the application security group.

In Roles and administrator i have added the below role, But still i am getting the error.

 
 

ad.JPGAD1.JPG

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.