impossible to connect Semantic Model to Cloud Data Source via API
I have a semantic model that is connect to 2 datasoruces:
- on prem datasource that takes data from an oracle server
- 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 : [31;1mOne or more errors occurred. ({[0m
[31;1m[31;1m "code": "DMTS_CanNotFindMatchingDatasourceInGatewayError",[0m
[31;1m[31;1m "pbi.error": {[0m
[31;1m[31;1m "code": "DMTS_CanNotFindMatchingDatasourceInGatewayError",[0m
[31;1m[31;1m "parameters": {},[0m
[31;1m[31;1m "details": [],[0m
[31;1m[31;1m "exceptionCulprit": 1[0m
[31;1m[31;1m }[0m
[31;1m[31;1m})[0m
[31;1m[31;1m+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[0m
[31;1m[31;1m+ CategoryInfo : WriteError: (Microsoft.PowerBI.C…kePowerBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMethod], AggregateException[0m
[31;1m[31;1m+ FullyQualifiedErrorId : One or more errors occurred. ({[0m
[31;1m[31;1m "code": "DMTS_CanNotFindMatchingDatasourceInGatewayError",[0m
[31;1m[31;1m "pbi.error": {[0m
[31;1m[31;1m "code": "DMTS_CanNotFindMatchingDatasourceInGatewayError",[0m
[31;1m[31;1m "parameters": {},[0m
[31;1m[31;1m "details": [],[0m
[31;1m[31;1m "exceptionCulprit": 1[0m
[31;1m[31;1m }[0m
[31;1m[31;1m}),Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod[0m
2 Comments
- AnonymousNot applicable
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 - AnonymousNot applicable
Hi Anonymous
According to the Fabric PS sample here https://github.com/microsoft/Analysis-Services/tree/master/pbidevmode/fabricps-pbip#sample---deploy-semantic-model-and-bind-to-shared-cloud-connection-scc 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