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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
rajub2023
Regular Visitor

BindToGateway API fails with error DMTS_CanNotFindMatchingDatasourceInGatewayError

Calling below Api with Service principal gives below error with status as 400 (Bad Request).

POST https://api.powerbi.com/v1.0/myorg/groups/{groupId}/datasets/{datasetId}/Default.BindToGateway

 

error : 

{
    "error": {
        "code": "DMTS_CanNotFindMatchingDatasourceInGatewayError",
        "pbi.error": {
            "code": "DMTS_CanNotFindMatchingDatasourceInGatewayError",
            "parameters": {},
            "details": [],
            "exceptionCulprit": 1
        }
    }
}


When I call getGateways Api , able to retrieve the onprem gateway , its ID and after that using below datasources api where I'm able to retrieve the datasources mapped to onpremise gateway.
1 ACCEPTED SOLUTION

@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.

View solution in original post

6 REPLIES 6
v-prasare
Community Support
Community Support

We are following up once again regarding your query. Could you please confirm if the issue has been resolved through the support ticket with Microsoft?

If the issue has been resolved, we kindly request you to share the resolution or key insights here to help others in the community. If we don’t hear back, we’ll go ahead and close this thread.

Should you need further assistance in the future, we encourage you to reach out via the Microsoft Fabric Community Forum and create a new thread. We’ll be happy to help.

 

Thank you for your understanding and participation.

v-prasare
Community Support
Community Support

@rajub2023, Thanks for reaching MS fabric community support.

 

Please refer to below similar issue posted by user in forum: Solved: Re: BindToGateway Powershell REST API POST failing... - Microsoft Fabric Community

 

let me know if this helps resolve your issue?

 

 

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.

 

 

Hi @v-prasare , 

 

Solution suggested in that link is already in place , still I'm facing the issue the issue .
Please note the isssue happens only for MSSQL server database  ,it works for MYSQL database

@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.

rohit1991
Super User
Super User

@rajub2023  here are a few steps to resolve:

  1. Verify Dataset Data Source: Ensure the dataset's data source settings (server, database, credentials) exactly match the gateway's data source configuration.

  2. Check Gateway Data Source: Use GET https://api.powerbi.com/v1.0/myorg/gateways/{gatewayId}/datasources to confirm the correct dataSourceId and gatewayId.

  3. Bind with Correct Details: Use the correct IDs in the BindToGateway payload:

    {"gatewayObjectId": "your-gateway-id","dataSourceBindings": [{"dataSourceId": "your-datasource-id"}]}
  4. Match Names Exactly: Ensure server and database names are identical, including case sensitivity and spaces.
  5. Refresh Dataset: After binding, refresh the dataset in Power BI Service.
 
 

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:

{"gatewayObjectId": "your-gateway-id","dataSourceBindings": [{"dataSourceId": "your-datasource-id"}]}

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

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.