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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Irshad_aj
New Member

Forbidden Issue with PowerBiClient

Hi Geeks,
Currently I am working with Power Bi apis and embedding. I have tried to get embed token using powerBi client by pbiClient.Reports.GenerateTokenAsync() method. But I got exception , says "Operation returned an invalid status code 'Forbidden'" .
I have given 'workspaceId', 'reportId', 'tokenRequest ' as parameters. wokspaceId and reportId are correct. tokenRequest is a GenerateTokenRequest object and value of it when it passes to pbiClient.Reports.GenerateTokenAsync() method is :

AccessLevel : {View}
AllowSaveAs : null
DatasetId : //a dataset id
Identities : null
LifetimeInMinutes : null

 

Do I have to enable something while creating or publishing report for embed a pbi report either in PowerBi Desktop or in my code ?
What do you think about the conditions to get that exception ?

Did I miss any any information ? please let me know.

Note:
**I am incharge for generate tokens, embedURLs etc and, powerBi report making and publishing is done by some one else**
My project have already embedded so many report as far. I am experiencing this issue while trying to adding/embedding newly created Bi reports.
Woking on .NET6

 

0 REPLIES 0

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.