【问题标题】:How do I configure the Service Principal credentials expiration on refresh to connect Power BI Sql Azure Data Source?如何在刷新时配置服务主体凭据过期以连接 Power BI Sql Azure 数据源?
【发布时间】:2021-08-21 20:28:32
【问题描述】:

我正在使用 Powershell 更新基于 Sql Azure 的 Power BI 数据源上的凭据。

凭据是服务主体的凭据,我获取 Sql 访问令牌并提交更改。

payload lokos 如下:

$UpdateUserCredential = @{
    credentialDetails = @{
        credentialType = "OAuth2"
        credentials = "{`"credentialData`":[{`"name`":`"accessToken`", `"value`":`"$token`"}]}"
        encryptedConnection = "Encrypted"
        encryptionAlgorithm = "None"
        privacyLevel = "None"
    }
} | ConvertTo-Json

数据源设置为每 10 天刷新一次。我是否需要在每次过期时以编程方式更新凭据 - 凭据多久过期一次?

是否有更好的方法在 Power BI 中为数据源连接保留凭据,该连接可以在未来计划的刷新中存活而无需重新输入凭据?例如,可能使用基本用户名密码身份验证,而不是 OAuth?

【问题讨论】:

    标签: powerbi azure-powershell powerbi-datasource


    【解决方案1】:

    不是 powerbi 方面的专家,但对于服务主体,您可以使用 powershell New-AzureADApplicationPasswordCredential 创建一个秘密,即其生命周期尽可能长的凭证,请确保您已安装 AzureAD powershell 模块。 (在传送门里,最多可以设置3年)

    Connect-AzureAD
    New-AzureADApplicationPasswordCredential -ObjectId <app-registration-object-id> -EndDate ((Get-Date).AddYears(100))
    

    【讨论】:

      猜你喜欢
      • 2022-08-09
      • 2021-07-19
      • 2023-03-12
      • 2021-07-22
      • 1970-01-01
      • 2021-10-19
      • 1970-01-01
      • 2022-12-17
      • 1970-01-01
      相关资源
      最近更新 更多