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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
udione
Helper I
Helper I

Create Cloud Connection via Rest Api

I'd like to create Cloud Connection to my lakehouse via REST api. The feature I'm referring to is described here https://learn.microsoft.com/en-us/power-bi/connect-data/service-create-share-cloud-data-sources#crea... 

I want to use this in automated multiple workspace createon as when recreating Semantic model from deployment pipeline, default connection is linked which does not have service principal details and semantic model cannot refresh itself. 

I've checked number of methods on the api that create datasources but they all require passing gatewayId, which I don't have as this is not a gateway connection. (I've tried to use guid from sniffed gatewayCluster that is used by web ui - but no luck).

Is my scenario supported by rest api or this has to be done manually?

4 REPLIES 4
sdemei
Frequent Visitor

I am having the same issue, did someone manage to get a solution for this? 

Post json in this format:

 

{
"connectionDetails": {
"type": "SQL",
"creationMethod": "SQL",
"parameters": [
{
"dataType": "Text",
"name": "server",
"value": "Lakehouse CONNECTIONSTRING"
},
{
"dataType": "Text",
"name": "database",
"value": "LAKEHOUSENAME"
}
]
},
"connectivityType": "ShareableCloud",
"credentialDetails": {
"singleSignOnType": "None",
"connectionEncryption": "NotEncrypted",
"skipTestConnection": false,
"credentials": {
"credentialType": "ServicePrincipal",
"servicePrincipalClientId": "CLIENTID",
"tenantId": "TENANTID",
"servicePrincipalSecret": "SECRET"
}
},
"displayName": "CONNECTIONNAME",
"privacyLevel": "Organizational"
}

 

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

lbendlin
Super User
Super User

Why do you need to "create"  that cloud connection?  It is automatically "created"  in the service, if you want it or not.

The connection that is created, does not have credentials in it so Semantic Model cannot refresh itself. This is the message you get on the Semantic Model. 

udione_0-1728935872820.png

You need to create anoother connection manually and set for example service principal credentials to make the Semantic Model refresh data automatically. 

Connection I'm using here is to of type Lakehouse Sql Endpoint.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.