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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

impossible to connect Semantic Model to Cloud Data Source via API

I have a semantic model that is connect to 2 datasoruces:

  1. on prem datasource that takes data from an oracle server
  2. cloud datasource that takes data from an excel stored in sharepoint

 

Our purpose is to automate the assignment of a connection to all datasources for each semantic model every time the semantic model is uploaded/modified.

For on prem datasources, we're using a Gateway and we're using the "BindToGateway" API (Datasets - Bind To Gateway - REST API (Power BI Power BI REST APIs) | Microsoft Learn) by passing the gateway object id (private/custom on prem gateway) and the datasourceobjectid (the credentials connection).

We're trying to use the same API for cloud Gateway, but it does not work (below some powershell logs of the error). How do we use this API in order to make it work also for cloud gateways? There is another API that we can use for this purpose?

 

 

 

HTTP POST groups/xxxx/datasets/yyy/Default.BindToGateway with json
{
  "datasourceObjectIds": [
    "zzzz"
  ],
  "gatewayObjectId": "kkkk"
}
[31;1mInvoke-PowerBIRestMethod : One or more errors occurred. ({
[31;1m  "code": "DMTS_CanNotFindMatchingDatasourceInGatewayError",
[31;1m  "pbi.error": {
[31;1m    "code": "DMTS_CanNotFindMatchingDatasourceInGatewayError",
[31;1m    "parameters": {},
[31;1m    "details": [],
[31;1m    "exceptionCulprit": 1
[31;1m  }
[31;1m})
[31;1m+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[31;1m+ CategoryInfo          : WriteError: (Microsoft.PowerBI.C…kePowerBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMethod], AggregateException
[31;1m+ FullyQualifiedErrorId : One or more errors occurred. ({
[31;1m  "code": "DMTS_CanNotFindMatchingDatasourceInGatewayError",
[31;1m  "pbi.error": {
[31;1m    "code": "DMTS_CanNotFindMatchingDatasourceInGatewayError",
[31;1m    "parameters": {},
[31;1m    "details": [],
[31;1m    "exceptionCulprit": 1
[31;1m  }
[31;1m}),Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod

 

 

 

 

Status: Investigating

Hi @jacopoberta ,

 

The BindToGateway API is specifically designed for on-premises data gateways and does not support cloud data sources directly1. This is likely why you’re encountering issues when trying to use it for your cloud data sources.

For cloud data sources, you typically don’t need to bind them to a gateway because they are already accessible via the cloud. However, if you need to manage connections or credentials for cloud data sources, you might need to use different APIs or methods. The Datasources API allows you to get and set credentials for data sources.

 

Best regards.
Community Support Team_Caitlyn

 

 

Comments
v-xiaoyan-msft
Community Support
Status changed to: Investigating

Hi @jacopoberta ,

 

The BindToGateway API is specifically designed for on-premises data gateways and does not support cloud data sources directly1. This is likely why you’re encountering issues when trying to use it for your cloud data sources.

For cloud data sources, you typically don’t need to bind them to a gateway because they are already accessible via the cloud. However, if you need to manage connections or credentials for cloud data sources, you might need to use different APIs or methods. The Datasources API allows you to get and set credentials for data sources.

 

Best regards.
Community Support Team_Caitlyn

 

 

rasmusstubbe
New Member

Hi @v-xiaoyan-msft 

 

According to the Fabric PS sample here https://github.com/microsoft/Analysis-Services/tree/master/pbidevmode/fabricps-pbip#sample---deploy-... it should be possible to rebind SCC. Unfortunately that does not work.

 

Can you include a link to the Datasouces API?

 

Best Regards

Rasmus Stubbe