Forum Discussion

CoulterJames2's avatar
CoulterJames2
Advocate II
10 days ago
Solved

Programmatically Create Fabric Data Pipeline Cloud Connection

Is it possible to create a Fabric Data Pipelines cloud connection via the Create Connection API or is this connection type not supported for creation? I can retrieve the details of such connections, but not create them. In the response details for an existing connection, I see the type and path parameters as follows:

 

Connection '{
'allowConnectionUsageInGateway': False, 
'allowUsageInUserControlledCode': False, 
'id': 'a1b2c3d4-aaaa-bcbc-dddd-a1b2c3d4e5f6', 
'displayName': 'Fabric Data Pipeline demo', 
'connectivityType': 'ShareableCloud', 
'connectionDetails': {'path': 'FabricDataPipelines', 'type': 'FabricDataPipelines'}, 'privacyLevel': 'Organizational', 
'credentialDetails': {'credentialType': 'OAuth2', 'singleSignOnType': 'None', 'connectionEncryption': 'NotEncrypted', 'skipTestConnection': False}}'

But when I try to pass these same values to the Create Connection API, I get an error telling me that the creationMethod parameter is missing. What is the creationMethod for this type of connection? The only info I can find on this relates to SQL connections.

 

https://learn.microsoft.com/en-us/rest/api/fabric/core/connections/create-connection

  • 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

     

4 Replies

  • 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

     

    • CoulterJames2's avatar
      CoulterJames2
      Advocate II

      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?

  • Hi CoulterJames2

     

    For cloud connections, only the owner can see them. So whatever crednetials you used to send the POST request is the account that can manage them, even as a fabric admin you cannot see someone's cloud connections. 
    I recommend using the REST API to also share the connection with yourself so you can see them, but editing them will need to be done only through the API using the credentials that created the connection. 
     

    • CoulterJames2's avatar
      CoulterJames2
      Advocate II

      Hi tayloramy yes, I realised this was the reason and then had to add a role assignment using my own credentials. Thanks for the help.