Forum Discussion
jaapinho
5 years agoRegular Visitor
Rest API / Powershell : Unable to create Datasource in Gateway (OnPremises)
Hello, I'm using this code : $url = "gateways/MYGateway/datasources" $body = @{ datasourceName = "MYDatasource" datasourceType = "SQL" connectionDetails = '{"server":"MY...
- 5 years ago
Hi, MYgateway represents my gateway ID (Which i couldnt put here). But problem is solved. creds hash was miscalculated.
Thank you
Ybam
5 years agoHelper I
Hi jaapinho ,
I want to create a datasource in my on-prem gateway but I always had a 400 error.
My code is similar to yours and I have 2 questions:
- What's your "MYInstance" ?
- How your credentials are crypted, I use for mine this script(https://endjin.com/blog/2020/12/how-to-update-credentials-for-an-on-prem-power-bi-data-source-using-powershell.html#script)
Thank you