Forum Discussion
Can't connect dataset/semanticModel to Gateway using API (Azure SqlServer datasource)
Please help! I'm trying to set up code to configure new tenants in our "app-owns-data" webapp. I'm able to use the api to create the service principal profile, the workspace, the dataset/semanticModel BUT due to network rules we have to use gateways to reach our Azure databases and I cannot connect my new semanticModel to the gateway.
I have one workspace that was configured by hand and it works great. I can create a semantic model and then go to the dataset settings and select the gateway. The query works and when I add rows to the sql table and refresh the report, it updates perfectly.
So then I go to my api-created workspace and I try
POST https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/Default.BindToGateway
using the same gateway id as above, which returns a 200, yet seem to do nothing! When I go back into my semantic model and view lineage there's no mention of the gateway like there is in the manual workspace.
On the Datasets - Bind to Gateway api page it says "Only supports the on-premises data gateway" - mine is Azure. Please tell me there is SOME way to do this? Also, possibly this has to do with my service principal I use with the api missing permissions?
Sigh...so close, but now I'm STUCK.
Answering my own question to help anyone else with this issue. Thanks to another post I found some steps listed to connect a dataset/model to a gateway and #4 was the key:
4. The user must be assigned as a user of the data source defined on the gateway (different from being a gateway admin)
The strange thing was that the api method returned 200 yet did not work - should have returned a 403 and I would have suspected permissions sooner.
2 Replies
- ddelapasseHelper I
Answering my own question to help anyone else with this issue. Thanks to another post I found some steps listed to connect a dataset/model to a gateway and #4 was the key:
4. The user must be assigned as a user of the data source defined on the gateway (different from being a gateway admin)
The strange thing was that the api method returned 200 yet did not work - should have returned a 403 and I would have suspected permissions sooner. - sblommendaalNew Member
ddelapasse running in to a similair problem, would like to change gateway via api. I'm using cloud connections, do you know how to retreive that gatewayid?