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
MaartenInc
Frequent Visitor

C# Embed dashboard and tiles missing in dot.net core api?

Hello,

 

I'm using the Nuget package from https://github.com/microsoft/PowerBI-CSharp (v4.0.6/latest) within my C# projects to embed reports. ...

 

According to the API documentation (dashboards-generate-token-in-group &  generate-embed-token )  of EmbedToken, I should be able to also embed Dashboards and Tiles into my a...

 

 

 

            var identities = await CreateEffectiveIdentities(...);
            var pbiDashboard = pbiClient.Dashboards.GetDashboard(workspaceGUID, dashboardGUID);
            var tokenRequest = new GenerateTokenRequestV2(
                datasets: null,
                reports: null,
                targetWorkspaces: new List<GenerateTokenRequestV2TargetWorkspace>() { new(worksapceGUID) },
                identities: identities
                )

            var result = await pbiClient.EmbedToken.GenerateTokenAsync(tokenRequest);

 

 

 

 

To generate a Report token, I provide my datasets and reports (GenerateTokenRequestV2Report).

 

But there doesn't seem to be property or parameter to set something for Tiles or Dashboard. There is...

 

I feel like I am missing something. Is this currently not support within the Nuget package for .NET ...

 

Thanks,

1 ACCEPTED SOLUTION
MaartenInc
Frequent Visitor

 

 

            var p = new GenerateTokenRequest(TokenAccessLevel.View);
            pbiClient.Dashboards.GenerateTokenAsync(request.WorkspaceId, pbiDashboard.Id, p);

 

As I  finished, this question. I found I can use the old 'v1' with following code. 

View solution in original post

1 REPLY 1
MaartenInc
Frequent Visitor

 

 

            var p = new GenerateTokenRequest(TokenAccessLevel.View);
            pbiClient.Dashboards.GenerateTokenAsync(request.WorkspaceId, pbiDashboard.Id, p);

 

As I  finished, this question. I found I can use the old 'v1' with following code. 

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.