I am trying to follow this PowerBI embedded example and am getting an error:
'PowerBIToken' does not contain a definition for 'CreateProvisionToken'
This MSDN article describes the CreateProvisionToken()
method.
I installed latest
Microsoft.PowerBI.Core
andMicrosoft.PowerBI.Api
using NuGet package managerincluded
Microsoft.PowerBI.Security
andMicrosoft.PowerBI.Api.V1
in my project.
I also tried changing CreateProvisionToken()
part to the following:
var credentials = new TokenCredentials(accessKey, "AppKey");
var client = new PowerBIClient(credentials);
var devToken = PowerBIToken. CreateDevToken(reportID, workspaceID);
using (client)
{
var embedToken = PowerBIToken.CreateReportEmbedToken(
collectionName,
workspaceID,
reportID);
var embedTokenString = embedToken.Generate(accessKey);
}
Which generates a token which "looks about right", but using this token in the example html in the end of the article results in an error This content is not available
when rendering the report.
What am I missing?