Forum Discussion
BindToGateway Powershell REST API POST failing - Need Help
- 6 years ago
I have found the reasons why this wasnt working so thought I would list them here for future users. To get this to work there are a few things to be aware of:
1. If the datasource is not assigned to a gateway you need to not include the datasource ID values (you wont actually be able to get these ID values if it is unassigned). I assume the ability to specify the data source id values is only relevent when the dataset is already assigned to a gateway, but I dont know if you can use two separate gateways for one dataset with two datasources.
2. Service principals cant be set to administrators of gateways, so you cant use them
3. Users must be set as administrators of gateways
4. The user must be assigned as a user of the data source defined on the gateway (different from being a gateway admin)
With all this set up properly it works like a charm 🙂
I have found the reasons why this wasnt working so thought I would list them here for future users. To get this to work there are a few things to be aware of:
1. If the datasource is not assigned to a gateway you need to not include the datasource ID values (you wont actually be able to get these ID values if it is unassigned). I assume the ability to specify the data source id values is only relevent when the dataset is already assigned to a gateway, but I dont know if you can use two separate gateways for one dataset with two datasources.
2. Service principals cant be set to administrators of gateways, so you cant use them
3. Users must be set as administrators of gateways
4. The user must be assigned as a user of the data source defined on the gateway (different from being a gateway admin)
With all this set up properly it works like a charm 🙂
- Anonymous6 years agoNot applicable
Dom99... I am also facing with the same issue.
Are you saying that with a Service principal we cannot achive this?
if it can be achieved can you provide more details.
- ilav5 years agoFrequent Visitor
Is someone able to pick the DSN attached to the gateway via an API or Powershell?
- RakeshSinghr5 years agoResolver I
How did you manage to bind gateway with service principal?
- dom995 years agoAdvocate V
I didnt, it wasnt possible for reasons listed in the solution.
As far as I'm aware it is still not possible, if you want to do this you will need to bind it as a user with a pro license who is an administrator of the gateway, and point number 4 listed in the solution
- RakeshSinghr5 years agoResolver I
Its quite shocking to know such simple operation is not yet possible. Did you manage to raise a ticket with microsoft to be told this is not currently possible?
1) Have you been able to add App id to gateway datasource users - https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/adddatasourceuser - there's an example with app id. Perhaps once Added binding might work?
https://github.com/MicrosoftDocs/powerbi-docs/issues/1198
2) I guess its still not possible to add app id as an admin to gateway?
I'm able to Connect-DataGatewayServiceAccount -ApplicationId $ApplicationId -ClientSecret $securePassword -Tenant $Tenantid
but after this step non of the gateway commandlets return anything. Ex: Get-DataGatewayCluster
any success with that?
Using a user account with pro license for automated deployment is not ideal