使用Runbook对云中的Azure Blob存储帐户进行身份验证

时间:2019-08-08 07:56:55

标签: azure-powershell azure-analysis-services xmla

安全分析服务表格模型中(兼容级别1400),我导入了一个Blob存储帐户作为数据源。这是身份验证类型,是密钥身份验证类型。该密钥是静态密钥。

但是在使用自动化帐户(Cloud PowerShell)中的Runbook刷新表格时,是否可以通过密钥/凭证进行身份验证?

否则,PowerShell将失败,并显示以下消息

The given credential is missing a required property. Data source kind: AzureBlobs. Authentication kind: Key. Property name: Key. The exception was raised by the IDbConnection interface.

这是从Model.bim文件复制的源定义:

 {
  "createOrReplace": {
    "object": {
      "database": "azureanalysisservicesdatabase",
      "dataSource": "OMSLogs"
    },
    "dataSource": {
      "type": "structured",
      "name": "OMSLogs",
      "connectionDetails": {
        "protocol": "azure-blobs",
        "address": {
          "account": "storage",
          "domain": "blob.core.windows.net"
        },
        "authentication": null,
        "query": null
      },
      "credential": {
        "AuthenticationKind": "Key",
        "kind": "AzureBlobs",
        "path": "https://storage.blob.core.windows.net/",
        "PrivacySetting": "Organizational"
      }
    }
  }
}

这是我在PowerShell中运行以处理数据库的代码:

Invoke-ProcessASDatabase -databasename $DatabaseName -server $AnalysisServerName -RefreshType "Full" -Credential $SPCredential

1 个答案:

答案 0 :(得分:0)

好的,我也遇到了类似的问题,并找到了解决方案,将“ Key”添加到“ credential”对象中:

"credential": {
    "AuthenticationKind": "Key",
    "kind": "AzureBlobs",
    "path": "https://storage.blob.core.windows.net/",
    "PrivacySetting": "Organizational",
    "Key": "<StorageAccountKey>"
  }

Microsoft对此文件没有很好的记录,但这对我有用