【问题标题】:PowerBi Embedded suspend and resume capacity using .NET SDKPowerBi Embedded 使用 .NET SDK 暂停和恢复容量
【发布时间】:2019-07-03 07:58:52
【问题描述】:

我正在尝试确定是否有一个 Azure 管理 NuGet 包可用于与 this part of the API 通信,以暂停和恢复我的 powerbi 嵌入式功能。

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

【问题讨论】:

  • 我有完全相同的要求,需要恢复 PowerBI Embedded 以处理一些导出报告,并在生成并下载报告后再次暂停 PowerBI Embedded 容量。实际上我很想用 C# 在单个 Azure 函数中执行此操作

标签: azure powerbi-embedded azure-management-api


【解决方案1】:

我要找的东西存在吗?

简而言之,。正如您提供的链接,它需要 azure_auth 才能访问 Power BI Embedded。

您可以使用下面的code 来获取 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的文章。你也可以使用 powershell 来Resume-AzPowerBIEmbeddedCapacity

【讨论】:

    猜你喜欢
    • 2013-07-19
    • 2015-07-28
    • 2014-12-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多