Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
clehnert
Regular Visitor

REST API BindToGateway returning 200OK but not using passed data source?

Hi all,

 

For a couple of years now I've been working on a Power BI Embedded solution to give customers access to a handful of premade dashboards and give them the ability to make new reports based off of datasets that we manage. We have one data source per customer (kind of, I'll elaborate on that in a bit) and use an on-premises gateway. Each dataset has parameters for the database server and database name it should be using, and all customer datasets are bound to the same data source for that customer. The reports use DirectQuery.

 

We recently started moving our customer's databases to SQL MI, so we created a function to create a new data source for our existing tenants, then iterate over each dataset in their workspace to update the dataset parameters and finally bind it to the new data source. As recently as Feb 4 2026, we had no issues with this. However, in our latest batch of migrations, we found that customers that were migrated weren't able to load their reports properly. During investigation of this issue, we were able to trace this issue back to the fact that the dataset is not getting properly bound to the gateway data source, and is instead trying to use a cloud connection. We added logging to our function to see if we were getting non-success status codes back from the BindToGateway endpoint, but unfortunately that is not the case. If anything, the additional logging has just confused things further.

 

We confirmed that we are passing the correct datasourceId and datasourceId in the body BindToGateway request, and it comes back with a 200 response. However, when we check it in the Power BI Service, we see that it's still configured to use a cloud connection rather than properly binding to the gateway. So, we added an extra check as well to https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/get-datasources-in-group after we get the BindToGateway response back so that we can see if it bound properly.

 

Here's what the request looks like, note the datasource id that starts with eebbeed1:

clehnert_2-1771874754502.png

That call completes with a 200OK response:

clehnert_3-1771874861086.png

However, when we check the datasource through the endpoint I linked above, it still shows the old datasource being bound:

clehnert_1-1771874582942.png

 

What could be causing it to come back with a 200 response but not actually rebind the dataset? The Fabric admins have been able to check the data source connection from the Power BI Service and the check succeeded, so the credentials in the data source are valid; I don't think that's what's causing this weird behavior. Also worth noting that I don't have this issue with every workspace; I was able to replicate the issue in one of my internal workspaces, but not the other. Did something change between Feb 4 2026 and Feb 16 2026? Any help with this would be much appreciated.

 

Thanks!

 

2 REPLIES 2
v-saisrao-msft
Community Support
Community Support

Hi @clehnert,

The BindToGateway API returning a 200 OK status means the request was accepted. However, successful binding requires that the dataset’s server and database names match those in the gateway data source definition. If the server naming formats differ, the gateway association may fail. Make sure the service principal is included as a data source user, and if you’re using a gateway cluster, provide the primary gateway ID. To check the binding status, use the Get Datasources In Group API.

Datasets - Bind To Gateway In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn

Add or remove a gateway data source - Power BI | Microsoft Learn

 

Thank you.

 

We are doing all of the above, with the exception of the fact that on some of the datasources, the casing of the database name in the parameters is different from the casing of the database name in the connection details. On one of my test workspaces I've been able to reliably rebind the datasets regardless of the casing of the database name in the dataset parameters vs the datasource connection details, but in the other test database with the same scenario I'm reliably unable to properly rebind.

 

If this is a case of gateway association potentially failing if the cases don't match, then is there a way to update the connection details of a datasource after it has been created? The only endpoint I can find that looks like it can modify an existing datasource is Gateways - Update Datasource, and that looks like it's specifically for updating the credential details, not connection details.

 

Please let me know your thoughts on this, thank you!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.