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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

BadRequest error when using Create Datasource method.

Hi,

 

When trying to invoke a method followin instructions from documentation (https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/create-datasource), I encountered the errors I am not able to find anywhere on the Internet:

 

{
    "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, 54"
                    }
                },
                {
                    "code": "DM_ErrorDetailNameCode_UnderlyingHResult",
                    "detail": {
                        "type": 1,
                        "value": "-2146233296"
                    }
                }
            ],
            "exceptionCulprit": 1
        }
    }
}

 

Have you seen similar problem? My request:Postman_request.png

 

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

First, please make sure the gateway didn't install in Virtual network. Not sure if the credentails part cause this error... Please refer the following links to configure credentails, later check if it can work well...

By C#:

Configure credentials programmatically for Power BI

// Basic credentials
var credentials = new BasicCredentials(username: "john", password: "*****");

var credentialsEncryptor = new AsymmetricKeyEncryptor(publicKey);
var credentialDetails = new CredentialDetails(credentials, PrivacyLevel.Private, EncryptedConnection.Encrypted, credentialsEncryptor);

By Powershell:

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

yingyinr_0-1659948627993.png

Best Regards

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.