Forum Discussion
FABRIC REST API Connections - Create Connection
- 19 days ago
Hi
$body = @{
connectivityType = "ShareableCloud"
displayName = "SQL Server Connection"
connectionDetails = @{
type = "SQL"
creationMethod = "SQL"
parameters = @(
@{ dataType = "Text"; name = "server"; value = "XXX" },
@{ dataType = "Text"; name = "database"; value = "XXX" }
)
}
privacyLevel = "Organizational"
credentialDetails = @{
singleSignOnType = "None"
connectionEncryption = "Encrypted"
skipTestConnection = $false
credentials = @{
credentialType = "ServicePrincipal"
tenantId = "XXX"
servicePrincipalClientId = "XXX"
servicePrincipalSecret = "XXX"
}
}
} | ConvertTo-Json -Depth 10
I think there are two separate calls here. POST /v1/connections creates the SQL cloud connection; binding it to the semantic model uses bindConnection. For SP auth, put credentialType, tenantId, servicePrincipalClientId, and servicePrincipalSecret under credentialDetails.credentials. One catch: the bindConnection caller needs to own the semantic model.