【问题标题】:Unable to create Power Bi Datasource using API无法使用 API 创建 Power Bi 数据源
【发布时间】:2019-10-01 13:04:40
【问题描述】:

我正在尝试按照 Microsoft 提供的 documentation 创建 Power Bi 数据源。但是得到Bad RequestDMTS_InvalidConnectionDetailsError 错误。这是我的帖子数据示例。

{
  "dataSourceType": "SQL",
  "connectionDetails": "{\"Server\":\"MySqlServer\",\"Database\":\"MySqlDatabase\"}",
  "datasourceName": "New Datasource",
  "credentialDetails": {
    "credentialType": "Basic",
    "credentials": "{\"credentialData\":[{\"name\":\"username\", \"value\":\"MyUsername\"},{\"name\":\"password\", \"value\":\"MyPassword\"}]}",
    "encryptedConnection": "Encrypted",
    "encryptionAlgorithm": "RSA-OAEP",
    "privacyLevel": "None"
  }
}

这是响应 json。

{
  "error": 
  {
    "code": "DMTS_InvalidConnectionDetailsError",
    "pbi.error": {
      "code": "DMTS_InvalidConnectionDetailsError",
      "parameters": {},
      "details": [],
      "exceptionCulprit": 1
    }
  }
}

有人可以帮忙吗?

【问题讨论】:

    标签: azure-active-directory powerbi


    【解决方案1】:

    凭据详细信息中的凭据需要使用 RSA 算法进行加密,然后才能将其传递给 API。您可以使用来自https://docs.microsoft.com/en-us/power-bi/developer/encrypt-credentials 的算法。此外,服务器的名称需要有双倍数量的“\”字符(如果有的话)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-07
      • 2016-06-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多