У меня проблема с Power BI Embedded.
Я хочу встроить отчет Power BI в частичное представление.
Следуя инструкции, я создал эти методы на своем контроллере:
public ActionResult Report()
{
credential = new UserCredential(username, passwordPowerBI);
Authorize().Wait();
ReportEmbed myReport = new ReportEmbed();
using (var client = new PowerBIClient(new Uri(apiUrl), tokenCredentials))
{
EmbedToken embedToken = client.Reports.GenerateTokenInGroup(groupId, reportID, new GenerateTokenRequest(accessLevel: "View"));
Report report = client.Reports.GetReportInGroup(groupId, reportID);
myReport.reportID = reportID;
myReport.embedURL = report.EmbedUrl;
myReport.embedToken = embedToken.Token;
}
return PartialView(myReport);
}
private static Task Authorize()
{
return Task.Run(async () => {
authenticationResult = null;
tokenCredentials = null;
var authenticationContext = new AuthenticationContext(authorityUrl);
authenticationResult = await authenticationContext.AcquireTokenAsync(resourceUrl, clientID, credential);
if (authenticationResult != null)
{
tokenCredentials = new TokenCredentials(authenticationResult.AccessToken, "Bearer");
}
});
}
И в представлении я просто пытаюсь просмотреть свой отчет.
Но приложение идет к этому исключению:

(извините, часть текста на итальянском языке. "Невозможный метод" означает "Метод не найден").
В чем проблема? Чего-то не хватает в файле web.config?