Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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.
Solved! Go to Solution.
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.
@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?
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.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
4 | |
4 | |
3 | |
3 | |
2 |