PowerBi Embedded 使用 .NET SDK 暂停和恢复容量

PowerBi Embedded suspend and resume capacity using .NET SDK

我想弄清楚是否有一个 Azure 管理 NuGet 包,我可以使用它与 this part of the API 通信以暂停和恢复我的 powerbi 嵌入式功能。

一直找不到。我要找的东西存在吗?

Does what I'm looking for exist?

简而言之,没有。由于您提供的 link,因此需要 azure_auth 才能访问 Power BI Embedded。

您可以使用下面的 获取 access_token 并调用您提供的其余 api。

    private static string redirectUri = "https://login.live.com/oauth20_desktop.srf";
    private static string resourceUri = "https://analysis.windows.net/powerbi/api";
    private static string authorityUri = "https://login.windows.net/common/oauth2/authorize";
    // Obtain at https://dev.powerbi.com/apps
    private static string clientId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";

    private static AuthenticationContext authContext = new AuthenticationContext(authorityUri, new TokenCache());

    private async void btnAuthenticate_ClickAsync(object sender, EventArgs e)
    {
        var authenticationResult = await authContext.AcquireTokenAsync(resourceUri, clientId, new Uri(redirectUri), new PlatformParameters(PromptBehavior.Auto));
        if (authenticationResult == null)
            MessageBox.Show("Call failed.");
        else
            MessageBox.Show(authenticationResult.AccessToken);
    }

您可以参考有关Power BI for .NET. Also you could use powershell to Resume-AzPowerBIEmbeddedCapacity的文章。