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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.