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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
evgenyg
Helper I
Helper I

Create connection to semantic model using fabric resp api

Hi, colleagues! I'm trying to create a connection that can be used in a data pipeline to refresh a semantic model. I need to do this programmatically via the API. I'm trying to make a POST request to https://api.fabric.microsoft.com/v1/connections as shown below, but I get the error "No function found matching 'PowerBIDatasets' for Kind: 'PowerBIDatasets'". What request body should I use to create the connection?

 

def create_connection(credential: ClientSecretCredential, connection_name: str😞
scope = "https://api.fabric.microsoft.com/.default"
headers = {
'Authorization': f'Bearer ' + credential.get_token(scope).token,
"Content-Type": "application/json"
}

request_body = {
"connectivityType": "ShareableCloud",
"displayName": connection_name,
"connectionDetails": {
"CreationMethod": "PowerBIDatasets",
'type': 'PowerBIDatasets'
},
"privacyLevel": "Organizational",
"credentialDetails": {
"singleSignOnType": "None",
"connectionEncryption": "NotEncrypted",
"skipTestConnection": False,
"credentials": {
"credentialType": "Basic",
"username": "myuser.onmicrosoft.com",
"password": mypwd
}
}
}

response = requests.post(
f'https://api.fabric.microsoft.com/v1/connections',
headers=headers,
data=json.dumps(request_body)
)

if response.status_code == 200:
print(response.json()['value'])
else:
print(f"Error making GET request: {response.status_code} - {response.text}")
1 ACCEPTED SOLUTION

Perfect, this clarification makes a world of difference, let's go one point at a time:

 

#1. Start with "Is Power BI Semantic Model connection type via the API" and the answer is NO, I got the JSON list from https://api.fabric.microsoft.com/v1/connections/supportedConnectionTypes there are 246 supported types, but not Power BI Semantic Model 

svenchio_0-1761822944749.png

#2. Then how is this created?  When you configure a semantic model refresh in the Fabric portal, it creates a connection object internally that appears as "Power BI Semantic Model" — but this is not a standalone connection type you can create via the /connections endpoint, you can however, create this types of conections manually via the portal 

svenchio_1-1761823236103.png

 or via the data pipeline as you shown before 

svenchio_2-1761823250821.png

And then bind this connection via fabric-rest-api-for-connection-binding-of-semantic-models 

 

#3. So what's possible?  Unfortunately, this seems to be one case where seems like a fully automation is not yet possible the exact way you wanted, until this connection can be created by API, therefore, the closes strategy is manually create the "Power BI Semantic Model" connection up-ahead in the portal and then use the Bind Semantic Model Connection API to associate it with other semantic models programmatically.

 

I know is not the answer you wanted to hear , but it's the answer to your question (don't kill the messanger hehehe)... wish in the near future all connections will be possible via the API. 

 

Hopefully you accept this as valild once confirmed the information provided, if you deemed appropiate, accept this as a solution and kudos for the information provided. All the best mate. 

 

 

View solution in original post

8 REPLIES 8
svenchio
Solution Sage
Solution Sage

Hi @evgenyg  just to clarofy that this API interface 

https://api.fabric.microsoft.com/v1/connections

Creates this type of Connections 

svenchio_0-1761814916269.png

But the Sematic Models DO NOT USE this type of connections, at least when it comes to fetch data from OneLake Catalog items (e.g. Lakehouses, Warehouses, Eventhouse), check how Semantic Model definition specifies the source on the expressions.tmdl file 

svenchio_1-1761815125164.png

Going more specific into your case, I'm not sure what is to you a "Power BI Dataset"? But my gutt feeling tells me is somehing you need to fetch from within Fabric  OneLake Catalog, therefore, this is not the connection you need. 

 

Perhaps if you can explain a bit more in details what exactly you want this Semantic Model to connect to, we could give additional ideas or alternatives. But i hope this clarification helps! If so, kudos to this post and looking forward to hear from you. 

 

 

Sorry, I didn't describe the problem clearly. 

 

I have the pipeline that will refresh my semantic model. It uses connection called Fabric Connector as shown below. 

evgenyg_0-1761821468709.png

 

I created this connection mannualy. 

evgenyg_1-1761820893806.png

 

But now I need to publish this pipeline to another tenant that doesn't have this connection yet. Trying to publish without creating a connection throws an error. So I need to create this connection before publishing. The problem is that I can't build the correct JSON body to create the connection. I'm using 

https://api.fabric.microsoft.com/v1/connections

 

 

Perfect, this clarification makes a world of difference, let's go one point at a time:

 

#1. Start with "Is Power BI Semantic Model connection type via the API" and the answer is NO, I got the JSON list from https://api.fabric.microsoft.com/v1/connections/supportedConnectionTypes there are 246 supported types, but not Power BI Semantic Model 

svenchio_0-1761822944749.png

#2. Then how is this created?  When you configure a semantic model refresh in the Fabric portal, it creates a connection object internally that appears as "Power BI Semantic Model" — but this is not a standalone connection type you can create via the /connections endpoint, you can however, create this types of conections manually via the portal 

svenchio_1-1761823236103.png

 or via the data pipeline as you shown before 

svenchio_2-1761823250821.png

And then bind this connection via fabric-rest-api-for-connection-binding-of-semantic-models 

 

#3. So what's possible?  Unfortunately, this seems to be one case where seems like a fully automation is not yet possible the exact way you wanted, until this connection can be created by API, therefore, the closes strategy is manually create the "Power BI Semantic Model" connection up-ahead in the portal and then use the Bind Semantic Model Connection API to associate it with other semantic models programmatically.

 

I know is not the answer you wanted to hear , but it's the answer to your question (don't kill the messanger hehehe)... wish in the near future all connections will be possible via the API. 

 

Hopefully you accept this as valild once confirmed the information provided, if you deemed appropiate, accept this as a solution and kudos for the information provided. All the best mate. 

 

 

Thank you!

tayloramy
Community Champion
Community Champion

Hi @evgenyg

 

You can use this endpoint to see what the supported connection types are: 
https://learn.microsoft.com/en-us/rest/api/fabric/core/connections/list-supported-connection-types

 

 

If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.

 

If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.

Thank you! I don't see the PowerBIDataset connection type. It's not supported.

lbendlin
Super User
Super User

Thank you! The artical is about rebind connection. But first, I need to create a new connection. Because without existing semantic model connection I can't publish pipeline via the API.

 

Helpful resources

Announcements
December Fabric Update Carousel

Fabric Monthly Update - December 2025

Check out the December 2025 Fabric Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.