PowerBI REST API - Failed to create a new datasource on the specified gateway

Viewed 51

I'm following this page in order to create a new PowerBI datasource. And used this kind of body for the POST request:

{
  "connectionDetails": "{\"server\":\"aaa\",\"database\":\"bbb\"}",
  "credentialDetails": {
    "credentialType": "Basic",
    "credentials": "{\"credentialData\":[{\"name\":\"username\", \"value\":\"ccc\"},{\"name\":\"password\", \"value\":\"XoZT6aM1r0puO\"}]}",
    "encryptedConnection": "Encrypted",
    "encryptionAlgorithm": "RSA-OAEP",
    "privacyLevel": "None",
    "useEndUserOAuth2Credentials": "False"
  },
  "datasourceName": "ddd",
  "dataSourceType": "Sql"
}

But getting the below error for the POST request:

{
  "error": {
    "code": "DM_GWPipeline_UnknownError",
    "pbi.error": {
      "code": "DM_GWPipeline_UnknownError",
      "parameters": {},
      "details": [
        {
          "code": "DM_ErrorDetailNameCode_UnderlyingErrorMessage",
          "detail": {
            "type": 1,
            "value": "The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. "
          }
        },
        {
          "code": "DM_ErrorDetailNameCode_UnderlyingHResult",
          "detail": {
            "type": 1,
            "value": "-2146233033"
          }
        }
      ]
    }
  }
}

Any advice would be appreciated! Thanks in advance.

BTW, as an alternative I would be happy to know if there is a powershell code that was found as working.

0 Answers
Related