Forum Discussion

Charline_74's avatar
Charline_74
Icon for Resolver I rankResolver I
27 days ago
Solved

FABRIC REST API Connections - Create Connection

Does anyone know how to run this API via a PowerShell script to create a SQL Server cloud connection for a semantic model using Service Principal authentication? Here's what I have so far: Invoke-P...
  • Charline_74's avatar
    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