Forum Discussion
Programmatically Create Fabric Data Pipeline Cloud Connection
- 10 days ago
Hi CoulterJames2,
It is possible. The creationMethod is the type of connection to create. If you look at the examples in the documentation,
POST https://api.fabric.microsoft.com/v1/connections { "connectivityType": "ShareableCloud", "displayName": "ContosoCloudConnection", "connectionDetails": { "type": "SQL", "creationMethod": "SQL", "parameters": [ { "dataType": "Text", "name": "server", "value": "contoso.database.windows.net" }, { "dataType": "Text", "name": "database", "value": "sales" } ] }, "privacyLevel": "Organizational", "credentialDetails": { "singleSignOnType": "None", "connectionEncryption": "NotEncrypted", "skipTestConnection": false, "credentials": { "credentialType": "Basic", "username": "admin", "passwordReference": { "connectionId": "4399ab2c-7551-4c0e-8aa7-18fc2f217626", "secretName": "some-secret" } } }, "allowUsageInUserControlledCode": true }You can see that for this example, this is a SQL Server connection, and the CreationMethod is SQL.
Here is another API to list all the supported CreationMethods:
https://learn.microsoft.com/en-us/rest/api/fabric/core/connections/list-supported-connection-types?tabs=HTTP
Hi CoulterJames2,
It is possible. The creationMethod is the type of connection to create. If you look at the examples in the documentation,
POST https://api.fabric.microsoft.com/v1/connections
{
"connectivityType": "ShareableCloud",
"displayName": "ContosoCloudConnection",
"connectionDetails": {
"type": "SQL",
"creationMethod": "SQL",
"parameters": [
{
"dataType": "Text",
"name": "server",
"value": "contoso.database.windows.net"
},
{
"dataType": "Text",
"name": "database",
"value": "sales"
}
]
},
"privacyLevel": "Organizational",
"credentialDetails": {
"singleSignOnType": "None",
"connectionEncryption": "NotEncrypted",
"skipTestConnection": false,
"credentials": {
"credentialType": "Basic",
"username": "admin",
"passwordReference": {
"connectionId": "4399ab2c-7551-4c0e-8aa7-18fc2f217626",
"secretName": "some-secret"
}
}
},
"allowUsageInUserControlledCode": true
}
You can see that for this example, this is a SQL Server connection, and the CreationMethod is SQL.
Here is another API to list all the supported CreationMethods:
https://learn.microsoft.com/en-us/rest/api/fabric/core/connections/list-supported-connection-types?tabs=HTTP
tayloramy thanks for the tip - I called the API to view all connection types and found that the creationMethod for a Fabric Data Pipeline is FabricDataPipeline.Actions. I have a follow-up question though - having created the connection, it is not visible in the 'Manage connection and gateways page'. Is there a delay until it is visible?