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
matt_b
Frequent Visitor

Binding a dataset to a gateway datasource doesn't seem to do anything?

When I import a report into an empty workspace (a profile workspace, accessed with a Service Principal rather than my own workspace), I can access new report and dataset objects in the workspace.  If I get the details of the dataset's data source, using the Dataset - Get Datasources In Group Rest API, I can see that it somehow already has an Id for a data gateway:

 

 

 

{
  "@odata.context":"http://wabi-north-europe-i-primary-redirect.analysis.windows.net/v1.0/myorg/groups/0fabd266-e832-4adb-a77a-f4c98da8d611/$metadata#datasources","value":[
    {
      "datasourceType":"Sql","connectionDetails":{
        "server":"dev-mb-mssql-deployment,31433","database":"xxxx"
      },"datasourceId":"6917797a-1a2e-44db-bdc5-e87a1244af17","gatewayId":"36baeaf5-e58a-4d91-8ba1-6be83a5cb547"
    }
  ]
}

 

 

 

However, if I then use the Datasets - Bind To Gateway In Group Rest API to bind the dataset to my On-Premise data gateway, and then use the Dataset - Get Datasources In Group Rest API again - the gatewayID of the dataset's datasource doesn't change:

 

 

 

{
  "@odata.context":"http://wabi-north-europe-i-primary-redirect.analysis.windows.net/v1.0/myorg/groups/0fabd266-e832-4adb-a77a-f4c98da8d611/$metadata#datasources","value":[
    {
      "datasourceType":"Sql","connectionDetails":{
        "server":"dev-mb-mssql-deployment,31433","database":"xxxx"
      },"datasourceId":"6917797a-1a2e-44db-bdc5-e87a1244af17","gatewayId":"36baeaf5-e58a-4d91-8ba1-6be83a5cb547"
    }
  ]
}

 

 

 

Note that the gateway id is identical.

 

However - I can use the Datasets - Update Datasources In Group Rest API to change the dataset datasource's connection details to another database - and this changes the datasourceId, BUT it doesn't change the gatewayId:

 

 

 

{
  "@odata.context":"http://wabi-north-europe-i-primary-redirect.analysis.windows.net/v1.0/myorg/groups/0fabd266-e832-4adb-a77a-f4c98da8d611/$metadata#datasources","value":[
    {
      "datasourceType":"Sql","connectionDetails":{
        "server":"xxxx.database.windows.net,1433","database":"xxxx"
      },"datasourceId":"5e441ef8-6af9-4e57-8de1-41cabfe0a9a9","gatewayId":"36baeaf5-e58a-4d91-8ba1-6be83a5cb547"
    }
  ]
}

 

 

 

Even if I successfully call the Bind To Gateway In Group Rest API again, it doesn't change the datasource's gateway id.

 

Can anyone tell me why this might happen?  Has anyone experienced anything like this before?

1 REPLY 1
matt_b
Frequent Visitor

I should probably add that the Service Principal I am using to access the "Bind To Gateway In Group" API endpoint is already configured as a user of the gateway I am attempting to bind to.  This is the response from a call to the Gateways - Get Datasource Users endpoint:

 

{
  "@odata.context":"http://wabi-north-europe-i-primary-redirect.analysis.windows.net/v1.0/myorg/$metadata#users","value":[
    {
      "datasourceAccessRight":"Read","displayName":"Power BI Embedded MB2","identifier":"b913f6a1-4bb4-4860-aa50-b22f71bb12b3","principalType":"App"
    }
  ]
}

 

And the identifier there is the Object Id of my service principal:

matt_b_0-1674474440876.png

 

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.