Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Shape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.

Reply
Angel
Resolver III
Resolver III

PBI Rest API - Create datasource in gateway error

Hi, everyone

 

I hope someone can help me. I'm trying to create a datasource in a gateway using PBI Rest API and it shows an error. The body I'm using is the one that is in documentation.

 

Body

{
  "dataSourceType": "SQL",
  "connectionDetails": "{\"server\":\"MyServer\",\"database\":\"MyDatabase\"}",
  "datasourceName": "Sample Datasource",
  "credentialDetails": {
    "credentialType": "Windows",
    "credentials": "AB....EF==",
    "encryptedConnection": "Encrypted",
    "encryptionAlgorithm": "RSA-OAEP",
    "privacyLevel": "None"
  }
}

Response

{
  "error": {
    "code": "DM_GWPipeline_UnknownError",
    "pbi.error": {
      "code": "DM_GWPipeline_UnknownError",
      "parameters": {},
      "details": [
        {
          "code": "DM_ErrorDetailNameCode_UnderlyingErrorMessage",
          "detail": {
            "type": 1,
            "value": "Invalid Ciphertext size. Expecting cipher text of atleast length, 344. Provided cipherText length, 10"
          }
        },
        {
          "code": "DM_ErrorDetailNameCode_UnderlyingHResult",
          "detail": {
            "type": 1,
            "value": "-2146233296"
          }
        }
      ],
      "exceptionCulprit": 1
    }
  }
}

 

Any tip?... 

 

Thanks in advance,

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Doesn't look like your credentials are OAEP padded.

View solution in original post

5 REPLIES 5
ed-freeman
Advocate II
Advocate II

Hi all. Here's how to update on-prem datasource credentials using PowerShell:

How to update credentials for an on-prem Power BI data source using PowerShell 

Hope this helps,

Ed

Anonymous
Not applicable

Any update here? 

How to do encryption in Power Shell or how to skip credential details and just add the datasource?

i have the same problem. Anyone?

lbendlin
Super User
Super User

Doesn't look like your credentials are OAEP padded.

Hi @lbendlin 

 

I think you are right. I have found documentation that explains how to encrypt credentials in C#.

 

Do you know if there is a cmdlet in Powershell to do that?.

 

Thanks,

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.