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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
erico_vincentci
New Member

publish and create workspace security using power bi and azure

i wanna publish my report on power bi service,

 

i create some report and publish into custom workspace named : 'testing-id'

 

but i got issue  on step 

 

erico_vincentci_3-1747880153819.jpeg

 

 

 

erico_vincentci_0-1747879971528.jpeg

 

 

i use library : Microsoft.PowerBI.Api version 3.9.0

 

i use frame work : ASP.NET MVC 4 version : 4.8

i use   programming language : C#

 

how to get the authorized

 

this is on azure 

 

erico_vincentci_5-1747880546632.png

 

i think i got stuck on power bi, could some one help me get authorize ??

 

thank you

 

 

refference 

1 ACCEPTED SOLUTION
v-pnaroju-msft
Community Support
Community Support

Thankyou, @Deku, for your response.

Hi erico_vincentci,

We appreciate your inquiry submitted through the Microsoft Fabric Community Forum.

Based on my understanding of your setup and the 'Unauthorized' error you are encountering, the issue appears to be related to Service Principal authorization within Power BI.

Kindly follow the steps outlined below, which may help resolve the issue:

  1. Navigate to the Power BI Admin Portal and enable the options "Allow service principals to use Power BI APIs" and "Allow service principals to create and view content." You may assign access to a security group or temporarily allow access for the entire organisation.

  2. Proceed to the Azure Portal, go to App Registrations, and select your application. Add and grant admin consent for the required application permissions, such as Dataset.ReadWrite.All, Report.ReadWrite.All, and Workspace.ReadWrite.All.

  3. In the Power BI Service, open your workspace (testing-id). Go to Access and add your Azure AD App as a Contributor or Admin.

  4. Ensure that your application is registered in the same tenant where Power BI is hosted. Also, verify that you are not using a personal or guest account.

  5. Confirm that your application is registered in Azure AD with a valid Client ID, Tenant ID, and Client Secret. Ensure your app uses the correct Client ID, Client Secret, and Tenant ID to authenticate with the Power BI API. 

For your reference, please find the following link:
Embed Power BI content in an embedded analytics application with service principal and an applicatio...

If you find our response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members facing similar issues.

Should you have any further queries, please feel free to contact the Microsoft Fabric community.

Thank you.

View solution in original post

5 REPLIES 5
v-pnaroju-msft
Community Support
Community Support

Hi erico_vincentci,

We are following up to see if your query has been resolved. Should you have identified a solution, we kindly request you to share it with the community to assist others facing similar issues.

If our response was helpful, please mark it as the accepted solution and provide kudos, as this helps the broader community.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi erico_vincentci,

We wanted to check in regarding your query, as we have not heard back from you. If you have resolved the issue, sharing the solution with the community would be greatly appreciated and could help others encountering similar challenges.

If you found our response useful, kindly mark it as the accepted solution and provide kudos to guide other members.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Hi erico_vincentci,

We have not received a response from you regarding the query and were following up to check if you have found a resolution. If you have identified a solution, we kindly request you to share it with the community, as it may be helpful to others facing a similar issue.

If you find the response helpful, please mark it as the accepted solution and provide kudos, as this will help other members with similar queries.

Thank you.

v-pnaroju-msft
Community Support
Community Support

Thankyou, @Deku, for your response.

Hi erico_vincentci,

We appreciate your inquiry submitted through the Microsoft Fabric Community Forum.

Based on my understanding of your setup and the 'Unauthorized' error you are encountering, the issue appears to be related to Service Principal authorization within Power BI.

Kindly follow the steps outlined below, which may help resolve the issue:

  1. Navigate to the Power BI Admin Portal and enable the options "Allow service principals to use Power BI APIs" and "Allow service principals to create and view content." You may assign access to a security group or temporarily allow access for the entire organisation.

  2. Proceed to the Azure Portal, go to App Registrations, and select your application. Add and grant admin consent for the required application permissions, such as Dataset.ReadWrite.All, Report.ReadWrite.All, and Workspace.ReadWrite.All.

  3. In the Power BI Service, open your workspace (testing-id). Go to Access and add your Azure AD App as a Contributor or Admin.

  4. Ensure that your application is registered in the same tenant where Power BI is hosted. Also, verify that you are not using a personal or guest account.

  5. Confirm that your application is registered in Azure AD with a valid Client ID, Tenant ID, and Client Secret. Ensure your app uses the correct Client ID, Client Secret, and Tenant ID to authenticate with the Power BI API. 

For your reference, please find the following link:
Embed Power BI content in an embedded analytics application with service principal and an applicatio...

If you find our response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members facing similar issues.

Should you have any further queries, please feel free to contact the Microsoft Fabric community.

Thank you.

Deku
Super User
Super User

I've not used the c# library but some point below from using the rest API.

 

Assume you are using a service principal as per the link.

 

Did you grant the SPN permission to run APIs in the tenent setting?

 

If you are running a non admin API the SPN will also need permissions in the workspace, looks like contributor might be sufficient in your case.

 

Some detail here that might be useful

 

https://www.youtube.com/live/swnGlrRy588?si=qVfeM45oaGulcjqc


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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