Forum Discussion
BindToGateway API fails with error DMTS_CanNotFindMatchingDatasourceInGatewayError
- 1 year ago
rajub2023, Thanks for quick response.
If your not able resolve your issue with above mentioned troubleshootings I suggest you, please raise a support ticket here: How to create a Fabric and Power BI Support ticket - Power BI | Microsoft Learn
Thanks,
Prashanth Are
MS Fabric Community Support
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query.
This BindToGateway API error with SQL Server usually comes down to the dataset’s data source settings not matching exactly with what’s configured in your gateway. Here’s a step-by-step checklist that’s worked for me and others:
-
Check every detail: Double-check the server name, database name, and credentials in both the dataset and the gateway data source. For SQL Server, even small differences (like a missing space or different case) will cause the bind to fail.
-
Confirm IDs: Use this endpoint to get the actual gateway and data source IDs:
GET https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources -
Binding payload: Make sure your payload looks like this:{
"gatewayObjectId": "your-gateway-id",
"datasourceObjectIds": ["your-datasource-id"]} -
Credential type: Make sure the credential type set on the gateway matches what your dataset expects (Windows, Basic, etc.).
-
Recreate if needed: If you’re still hitting the DMTS error, try deleting and recreating the gateway data source copy-paste everything straight from your dataset’s settings.
-
Gateway status: Make sure the gateway is online and you have admin rights for both the dataset and gateway.
-
Final test: Once the binding is successful, do a dataset refresh from Power BI Service to be sure everything connects.
This error is notorious with SQL Server because it’s super strict about those details. If these steps don’t fix it, let me know what you’re seeing and I’m happy to help troubleshoot further.
Hi rohit1991 , please find my answers inline
1)Verify Dataset Data Source: Ensure the dataset's data source settings (server, database, credentials) exactly match the gateway's data source configuration
Raju)This can't be verified as the BindGateway Api fails , this is the main problem.
2)Check Gateway Data Source: Use GET https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources to confirm the correct dataSourceId and gatewayId.
Raju)Yes able to get correct details about gatewayId and dataSourceId
3)Bind with Correct Details: Use the correct IDs in the BindToGateway payload:
Match Names Exactly: Ensure server and database names are identical, including case sensitivity and spaces.
Raju) I'm sending the payload in below manner which is different from yours , can you please share your documentation for the same
{ "gatewayObjectId": "1f69e798-5852-4fdd-ab01-33bb14b6e934", "datasourceObjectIds": [ "dc2f2dac-e5e2-4c37-af76-2a0bc10f16cb", "3bfe5d33-ab7d-4d24-b0b5-e2bb8eb01cf5" ] }
https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/bind-to-gateway-in-group
4)Refresh Dataset: After binding, refresh the dataset in Power BI Service.
Raju)Since BindToGateway Api is failing not able to perform Refresh.
Regards
Raju