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

Win a FREE 3 Day Ticket to FabCon Vienna. Apply now

Reply
sarvesh1993
Frequent Visitor

Power BI : Paginated Visual from Visualization Throwing Unauthorized Error 401 when being Selected

We have developed a page where user can upload a power bi report (pbix) as well as RDL Report in direct query mode. We are using service principle to get power bi client and then perform different operation with the report in workspace. There is a Preview Section in page where user can see report preview ,For previewing we are using Iframe div container popup ,when user clicks on preview button we are hitting a class with tokenrequestparamater and getting token response back and setting our embedconfig (have added some piece of code for better understanding).

Now the Requirement is user want to see RDL Report within PBIX Report. I know We have paginated report visualization feature from microsoft within pbix report where user can select and click on connect to report but seems when I do in my application ,when I select I am getting below unauthorized error in console, can someone help me regarding resolution. I want to see list of rdl reports in my Iframe when user select paginated report visual feature and click on connect to report like in power bi app service or desktop.

 

Basically I see two Error in console.

  1. The first Error when i hit preview ,the report loaded fine but I get this error in console.

  2. The second error when I select paginated report visual feature.

 

Error 1: 

https://xxx-xxxx-north-b-redirect.analysis.windows.net/metadata/tenantsettings/properties 401 (Unauthorized)


 Error 2:

 https://xxx-xxxx-north-b-redirect.analysis.windows.net/metadata/rdlreports 401 (Unauthorized) visual

 TokenGeneration:

 

var RequestParameters = new GenerateTokenRequest(accessLevel: accLvl, allowSaveAs: allowSaveAs);

 var tokenResponse = powerbiclient.Reports.GenerateTokenInGroup(groupID, reportID, RequestParameters );

                     var Config = new EmbedConfig()
                     {
                         EmbedToken = tokenResponse,
                         EmbedUrl = "xxx",
                         Id ="xxx",
                         ItemType = "xxx",
                         Name = "xxxx",
                         DisplayName = "XX",
                         Description =  "XX",
                         PageName = "XX",
                         EditingAllowed = allowEditing
                     };

 

3 REPLIES 3
Anonymous
Not applicable

Hi @sarvesh1993 ,

 

The 401 error means that there’s no permission to access the resource.

 

Here are some steps you can take to troubleshoot and resolve this issue:

1. Check your Service Principal permissions: Make sure your service principal has the necessary permissions to access the resources. You can do this by going to the Azure portal, navigating to the Azure Active Directory section, and checking the permissions of your service principal.

2. Check your token: Ensure that the token you're using is valid and has the necessary scopes to access the resources. 

3. Check your report settings: Make sure that the RDL report you're trying to access is in the same workspace as the PBIX report and that it's accessible to the service principal.

4. Check your code: Ensure that your code is correctly generating the token and setting the embed configuration. You might want to try hardcoding some values to see if the issue is with the token generation or the embed configuration.

 

Maybe the token is not fetched, you can add an await:

var tokenResponse = await powerbiclient.Reports.GenerateTokenInGroup(groupID, reportID, RequestParameters );

 

Hope it helps!

 

Best regards,
Community Support Team_ Scott Chang

 

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

We are generating token for a selected report which user want to preview by passing report ID:

My questions is:

1) Is it even possible to replicate paginated visual feature in IFrame the way we have in Power BI Desktop or service. In Power BI Desktop/service user logged in with their email ,they have access to workspace and reports so when they select paginated visual feature in any report page ,they are able to see all RDL Reports and can connect by clicking connect to report button or I would see embed RDL report within pbix.

2) In IFrame we generate token for that specific report to preview ,power bi visualization along with filters everything coming in Iframe but when we select paginated visual we end up with above error,how can we see all RDL reports in iframe the way we see in powerbidesktop or powerbi service ,  this token is for that particular selected report ,do we need to generate any other token (token at workspace level ?) to see all rdl reports and how can we replicate similar behaviour *embedding rdl within pbix) what we have in desktop or power bi service in Iframe.

sarvesh1993
Frequent Visitor

@lbendlin  , @Ahmedx  @Ritaf1983 need your suggestions

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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