Forum Discussion
Power BI REST API via Powershell: Create Datasource
{
"datasourceType": "WEB",
"connectionDetails": "{\"url\":\"http://app.powerbi.com\"}",
"datasourceName": "teststratumwebdatasource",
"credentialDetails": {
"credentialType": "Windows",
"credentials": "{\"credentialData\":[{\"name\":\"username\", \"value\":\"username\"},{\"name\":\"password\", \"value\":\"password\"}]}",
"encryptedConnection": "Encrypted",
"encryptionAlgorithm": "None",
"privacyLevel": "None"
}
I tried to create datasource for web thru rest api which failed. does anyone else has an working example in this group for creating datasource using powerbi rest api calls
BUMP
I've found that there are lack of specification of parameters in body in documentation
For examaple what should the body look like when we want setting new datasource of SQL in gateway?
Here are some threads without reply (last link is mine):
https://community.powerbi.com/t5/Developer/Problem-with-creating-datasource-under-gateway-through-API/td-p/414814
https://community.powerbi.com/t5/Developer/PowerBI-REST-API-error-Need-help/td-p/509452
https://community.powerbi.com/t5/Developer/Creating-new-SQL-Datasource-for-Gateway-with-Powershell/td-p/695814/jump-to/first-unread-message
If any of you know the answer please share correct examples.
MS please make up your documentation: https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/createdatasource.
Greetings