Forum Discussion

dom99's avatar
dom99
Advocate V
6 years ago
Solved

BindToGateway Powershell REST API POST failing - Need Help

Hi, I am struggling to get the BindToGateway REST API call to work in powershell https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/bindtogatewayingroup   Below is my code for doing the...
  • dom99's avatar
    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 🙂