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
MattMessina
New Member

Error 401 when attempting to switch embedded reports

Hello, I am attempting to embed several PowerBI reports onto the same page in my React application, both paginated and non-paginated.   I am using the "App owns data" method of embedding. We have a workspace, of which we get a list of reports so that we can display a list to a user for selection. When a user clicks one of those, we want to embed it onto the page, replacing whatever report may have been there before.  Currently, we are able to display whatever report the user clicks first, but when they attempt to navigate to another report, an error message appears saying "content isn't available" and we get the following errors in the console:

MattMessina_0-1639776365544.png

If the user then attempts to navigate back to the previously working report, it either does not render fully, or not at all.

 

I have tried generating one embed token for all of the reports (following the advice given here), but that produced the exact same result.

I also noticed in the dotnet sample AppOwnsData solution, there are different ways of generating a token for an RDL report and a non-RDL report.  Is it possible to generate a single token for every type of report that might appear in a workspace?

 

Thanks in advance and let me know if more information is needed!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @MattMessina ,

 

Here I have some suggestions for you.

1. There are two kinds of authentation method to App owns data, Master User Or Service Principal.

When using a service principal for authentication, refer to Embed Power BI content with service principal and Considerations and limitations.

When using Master User you need to check the API Permission.

Required scope:

All of the following, unless a requirement doesn't apply:

  • Content.Create, required if a target workspace is specified in GenerateTokenRequestV2.
  • Report.ReadWrite.All or Report.Read.All, required if a report is specified in GenerateTokenRequestV2.
  • Report.ReadWrite.All, required if the allowEdit flag is specified for at least one report in GenerateTokenRequestV2.
  • Dataset.ReadWrite.All or Dataset.Read.All

2. Please check whether all workspace you get report from are new workspace.

For reference: 

  • You can only create a report in workspaces specified by the targetWorkspaces parameter.
  • All reports and datasets must reside in a V2 workspace.
  • All target workspaces must be V2 workspaces.
  • Maximum 50 reports.
  • Maximum 50 datasets.
  • Maximum 50 target workspaces.
  • For Azure Analysis Services or Analysis Services on-premises live connection reports, generating an embed token with row-level security might not work for several minutes after a rebind

3. To create an embed token for all reports by generate token option, you need to add all Dataset IDs and Report IDs you need in your code. You can have a test in post man. You will get 200 return if you succeed.

{
  "datasets": [
    {
      "id": "..."
    },
    {
      "id": "..."
    }
  ],
  "reports": [
    {
      "id": "..."
    },
    {
      "id": "..."
    }
]
}

 

4. You may refer to this offical blog to get more details about your error.

For reference:

API call returning 401

API call returning 403

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @MattMessina ,

 

Here I have some suggestions for you.

1. There are two kinds of authentation method to App owns data, Master User Or Service Principal.

When using a service principal for authentication, refer to Embed Power BI content with service principal and Considerations and limitations.

When using Master User you need to check the API Permission.

Required scope:

All of the following, unless a requirement doesn't apply:

  • Content.Create, required if a target workspace is specified in GenerateTokenRequestV2.
  • Report.ReadWrite.All or Report.Read.All, required if a report is specified in GenerateTokenRequestV2.
  • Report.ReadWrite.All, required if the allowEdit flag is specified for at least one report in GenerateTokenRequestV2.
  • Dataset.ReadWrite.All or Dataset.Read.All

2. Please check whether all workspace you get report from are new workspace.

For reference: 

  • You can only create a report in workspaces specified by the targetWorkspaces parameter.
  • All reports and datasets must reside in a V2 workspace.
  • All target workspaces must be V2 workspaces.
  • Maximum 50 reports.
  • Maximum 50 datasets.
  • Maximum 50 target workspaces.
  • For Azure Analysis Services or Analysis Services on-premises live connection reports, generating an embed token with row-level security might not work for several minutes after a rebind

3. To create an embed token for all reports by generate token option, you need to add all Dataset IDs and Report IDs you need in your code. You can have a test in post man. You will get 200 return if you succeed.

{
  "datasets": [
    {
      "id": "..."
    },
    {
      "id": "..."
    }
  ],
  "reports": [
    {
      "id": "..."
    },
    {
      "id": "..."
    }
]
}

 

4. You may refer to this offical blog to get more details about your error.

For reference:

API call returning 401

API call returning 403

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

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.