March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have the challenge, want to host a PowerBI report embedded where the Row filter is to be implemented via the CustomData feature.
When I use the CustomData property, I have the problem that when calling the GenerateTokenInGroupAsync function, it always throws a BadRequest error message.
When I call the GenerateTokenInGroupAsync function without a CustomData property I get back a valid result, only the report is not filtered.
Code
GenerateTokenRequest generateTokenRequestParameters = new GenerateTokenRequest( accessLevel: "View", identity: new EffectiveIdentity( username: PowerBiAuthConstants.Username, datasets: new List<string> { reportConfig.DatasetId }, roles: new List<string> { "Username" }, customData: fgnr)); var tokenResponse = await client.Reports.GenerateTokenInGroupAsync( groupId: reportConfig.GroupId, reportKey: report.Id, requestParameters: generateTokenRequestParameters);
Exception
Massage: Operation returned an invalid status code 'BadRequest'
StackTrace: at Microsoft.PowerBI.Api.V2.Reports.<GenerateTokenInGroupWithHttpMessagesAsync>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerBI.Api.V2.ReportsExtensions.<GenerateTokenInGroupAsync>d__55.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at KIND.PowerBI.WebApi.DataAccess.PowerBiAdapter.<CreateEmbedConfig>d__0.MoveNext() in D:\TFS\PH1\Dev\services\KIND.PowerBI.WebApi\KIND.PowerBI.WebApi\DataAccess\PowerBiAdapter.cs:line 100
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
8 | |
1 | |
1 | |
1 | |
1 |
User | Count |
---|---|
9 | |
3 | |
2 | |
2 | |
2 |