fabric-cli

connection examples

Type: .Connection

Supported commands: fab desc .Connection

Permissions:

Navigate to a connection using cd command. Connections are included in .connections. You can use relative and absolute paths based on current context.

# use absolute path
fab:/ws1.Workspace$ cd /.connections
* Switched to '.connections'

# use relative path
fab:/ws1.Workspace$ cd ../.connections/conn1.Connection
* Switched to 'conn1.Connection'

Checking if a connection exists

Verify if a connection exists. Using exists on .connections has no effect.

fab:/$ exists .connections/conn1.Connection
* true

fab:/$ exists .connections/conn1_.Connection
* false

Getting and querying connection details

Retrieve and query connection details with -q (JMESPath query).

# get JSON properties
fab:/$ get .connections/conn1.Connection

# query using JMESPath
fab:/$ get .connections/conn1.Connection -q . -o /tmp

Listing connections

List existing connections and their details using -l.

fab:/$ ls .connections
fab:/$ ls .connections -l

Creating a connection

Create a connection synchronously. Use optional parameters with -P as needed; defaults apply if unspecified — see config set. Access to the source (e.g., firewall whitelist) is required to create one.

# use only required params
fab:/$ create .connections/conn2.Connection -P connectionDetails.type=SQL,connectionDetails.parameters.server=contoso.database.windows.net,connectionDetails.parameters.database=sales,credentialDetails.type=Basic,credentialDetails.username=<username>,credentialDetails.password=<password>

# specify gateway
fab:/$ create .connections/conn3.Connection -P gateway=MyVnetGateway.Gateway,connectionDetails.type=SQL,connectionDetails.parameters.server=contoso.database.windows.net,connectionDetails.parameters.database=sales,credentialDetails.type=Basic,credentialDetails.username=<username>,credentialDetails.password=<password>

# inline params
fab:/$ create .connections/conn4.Connection -P privacyLevel=Private,connectionDetails.creationMethod=SQL,gatewayId=852aee7c-d056-48dc-891f-9d7110a01b88,connectionDetails.type=SQL,connectionDetails.parameters.server=contoso.database.windows.net,connectionDetails.parameters.database=sales,credentialDetails.type=Basic,credentialDetails.username=<username>,credentialDetails.password=<password>,credentialDetails.connectionEncryption=NotEncrypted,credentialDetails.skipTestConnection=False

Note: If connectionDetails.creationMethod is not specified, the CLI will use the first matching creation method based on connectionDetails.parameters.*. If the Connection support multiple creation methods with the same parameters, we encourage you to specify its value to avoid unwanted behavior.

Note: credentialDetails.connectionEncryption default value (Any) will first try setting up the connection as Encrypted and fallback to NotEncrypted.

Removing a connection

Remove a connection synchronously. Use -f to force.

fab:/$ rm .connections/conn2.Connection
fab:/$ rm .connections/conn3.Connection -f

Setting and updating connection properties

Modify the connection properties. Use -f to force. Properties are case sensitive.

# change privacy level
fab:/$ set .connections/conn.Connection -q privacyLevel -i Organizational

# change password
fab:/$ set .connections/conn.Connection -q credentialDetails.password -i <password>

# change gateway
fab:/$ set .connections/conn.Connection -q gatewayId -i "852aee7c-d056-48dc-891f-9d7110a01b88"

Getting and querying connection permissions

Retrieve and query connection permissions with -q (JMESPath query). Output the result to a local path or Lakehouse/Files with -o.

# get JSON properties
fab:/$ acl get .connections/conn.Connection

# query using JMESPath
fab:/$ acl get .connections/conn.Connection -q [*].principal

# export JMESPath query result
fab:/$ acl get .connections/conn.Connection -q [*].principal -o /tmp 

# export to lakehouse using absolute path
fab:/$ cd .connections/conn.Connection
* Switched to 'conn.Connection'
fab:/.connections/conn.Connection$ acl get . -q [*].principal -o /ws1.Workspace/lh1.Lakehouse/Files

Listing connection permissions

List connection permissions and their details using -l.

fab:/$ acl ls .connections/conn.Connection
fab:/$ acl ls .connections/conn.Connection -l

See all examples