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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
hugh-mandg
New Member

Gateways: Power BI REST API - Unable To Create Folder Data Source Type

We have written a VSTS extension that will create, update or delete data source in our on premise gateway where we have been successful for data source types SQL, URL (basic), Oracle, however I am struggling with creating a folder data source. 

I am getting error - "{"code":"DMTS_UnsupportedConnectionStringError","pbi.error":{"code":"DMTS_UnsupportedConnectionStringError","parameters":{},"details":[],"exceptionCulprit":1}}}.Exception.Message" when calling https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources

 

The request body consists of 

 

$Credential = Encode-Credential -Username $winUserName -Password $winPassword -GatewayPublicKeyExponent $gatewayObj.publicKey.exponent -GatewayPublicKeyModulus $gatewayObj.publicKey.modulus

$bodyHash=New-Object -TypeName Hashtable
$bodyHash.Add("dataSourceType","$dataSourceType")
$bodyHash.Add("connectionDetails","{""Full path"":""$($folderPathName)""}")
$bodyHash.Add("datasourceName",$datasourceName)

$credentialDetails = @{
credentialType = "Windows"
credentials = $Credential
encryptedConnection = "Encrypted"
privacyLevel = "Private"
encryptionAlgorithm = "RSA-OAEP"
}
$bodyHash.Add("credentialDetails",$credentialDetails)
$reqBody = $bodyHash | ConvertTo-Json

 

Has anybody got this to work, or is it not possible for folder data source type? Here is a working example I manually created 

PWBI Gateway DS.png

 

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @hugh-mandg ,

Has your problem been solved, if so, please consider Accept a correct reply as the solution to help others find it.

 

Best Regards
Lucien

v-luwang-msft
Community Support
Community Support

Hi @hugh-mandg ,

Is your "Edit parameter" disabled in Power BI Service, if so, see a similar thread here.

 

Please check if your report can refresh successfully without managing the parameter.

If there is error when refreshing, please refer to the following guide:

https://community.powerbi.com/t5/Community-Blog/Custom-Data-Connector-How-to-Deploy-and-Test/ba-p/86...

Unable to update parameters in published dataset (custom data connector)

 

Best Regards

Lucien

 

Helpful resources

Announcements
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.

Top Solution Authors