Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have an issue getting the access token.
I tried downloading the code from official link (https://github.com/microsoft/PowerBI-Developer-Samples) and made all necessary changes to the appsettings.json
appsettings.json
{
"AzureAd": {
"AuthenticationMode": "MasterUser",
"AuthorityUri": "https://login.microsoftonline.com/organizations/",
"ClientId": "<correct values have been specified>",
"TenantId": "<correct values have been specified>",
"Scope": [ "https://analysis.windows.net/powerbi/api/.default" ],
"PbiUsername": "<correct values have been specified>",
"PbiPassword": "<correct values have been specified>",
"ClientSecret": ""
},
"PowerBI": {
"WorkspaceId": "<correct values have been specified>",
"ReportId": "<correct values have been specified>"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}
When I run the application I get this following error
Error Details:
Operation returned an invalid status code 'NotFound'
at Microsoft.PowerBI.Api.EmbedTokenOperations.GenerateTokenWithHttpMessagesAsync(GenerateTokenRequestV2 requestParameters, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.PowerBI.Api.EmbedTokenOperationsExtensions.GenerateTokenAsync(IEmbedTokenOperations operations, GenerateTokenRequestV2 requestParameters, CancellationToken cancellationToken)
at Microsoft.PowerBI.Api.EmbedTokenOperationsExtensions.GenerateToken(IEmbedTokenOperations operations, GenerateTokenRequestV2 requestParameters)
at AppOwnsData.Services.PbiEmbedService.GetEmbedToken(Guid reportId, IList`1 datasetIds, Guid targetWorkspaceId) in D:\Users\inflexion\Documents\IA Projects\Ebits\PowerBI-Developer-Samples-master\.NET Core\Embed for your customers\AppOwnsData\Services\PbiEmbedService.cs:line 150
at AppOwnsData.Services.PbiEmbedService.GetEmbedParams(Guid workspaceId, Guid reportId, Guid additionalDatasetId) in D:\Users\inflexion\Documents\IA Projects\Ebits\PowerBI-Developer-Samples-master\.NET Core\Embed for your customers\AppOwnsData\Services\PbiEmbedService.cs:line 69
at AppOwnsData.Controllers.EmbedInfoController.GetEmbedInfo() in D:\Users\inflexion\Documents\IA Projects\Ebits\PowerBI-Developer-Samples-master\.NET Core\Embed for your customers\AppOwnsData\Controllers\EmbedInfoController.cs:line 45
Looks like the error is rasied at below line of PbiEmbedService.cs file. This is part of GetEmbedToken function.
var embedToken = pbiClient.EmbedToken.GenerateToken(tokenRequest);
I am not sure what is causing this issue, looking for a solution to this.
Thanks & Regards,
Shahabaz Shafi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.