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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

How can a Deamon app (authorised by secret/certificate ) access PowerBI RestAPI?

I have an Deamon app registered in AAD with the following API permissions which has been granted by an admin

Power BI Service> "Tenant.REad.All" type "Application"

 

I am able to get the access token using MSAL. I intend to use this access token to access Power BI RestAPI of "Admin" catagory which requires "Tenant.REad.All". However, I get 401:unauthorized when I use the access token against the RestAPI.

 

Following is the code snippet with successfully obtains the access token:

ConfidentialClientApplication app = ConfidentialClientApplication.builder(
CONFIDENTIAL_CLIENT_ID,
ClientCredentialFactory.createFromCertificate(targetStream, "sindhu"))
.authority(TENANT_SPECIFIC_AUTHORITY)
.build();

ClientCredentialParameters clientCredentialParam = ClientCredentialParameters.builder(
Collections.singleton(SCOPE))
.build();
CompletableFuture<IAuthenticationResult> future = app.acquireToken(clientCredentialParam);

Other elevent settings for the application is "Default client type >Treat application as a public client" is marked as "NO".

 

What additional steps needs to be taken to be able to access the RestAPI?

0 REPLIES 0

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.