sempy_labs.connection package

Module contents

sempy_labs.connection.create_cloud_connection(name: str, server_name: str, database_name: str, user_name: str, password: str, privacy_level: str, connection_encryption: Literal['Encrypted', 'Any', 'NotEncrypted'] = 'NotEncrypted', skip_test_connection: bool = False)

Creates a shared cloud connection.

This is a wrapper function for the following API: Connections - Create Connection.

Service Principal Authentication is supported (see here for examples).

Parameters:
  • name (str) – The name of the connection.

  • server_name (str) – The name of the server.

  • database_name (str) – The name of the database.

  • user_name (str) – The username.

  • password (str) – The password.

  • privacy_level (str) – The privacy level of the connection.

  • connection_encryption (Literal["Encrypted", "Any", "NotEncrypted"], default="NotEncrypted") – The connection encryption type.

  • skip_test_connection (bool, default=False) – If True, skips the test connection.

sempy_labs.connection.create_on_prem_connection(name: str, gateway: str | UUID, server_name: str, database_name: str, credentials: str, privacy_level: str, connection_encryption: Literal['Encrypted', 'Any', 'NotEncrypted'] = 'NotEncrypted', skip_test_connection: bool = False)

Creates an on-premises connection.

This is a wrapper function for the following API: Connections - Create Connection.

Service Principal Authentication is supported (see here for examples).

Parameters:
  • name (str) – The name of the connection.

  • gateway (str | uuid.UUID) – The name or Id of the gateway.

  • server_name (str) – The name of the server.

  • database_name (str) – The name of the database.

  • credentials (str) – The encrypted credentials obtained from the gateway.

  • privacy_level (str) –

    The privacy level of the connection.

  • connection_encryption (Literal["Encrypted", "Any", "NotEncrypted"], default="NotEncrypted") – The connection encryption type.

  • skip_test_connection (bool, default=False) – If True, skips the test connection.

sempy_labs.connection.create_vnet_connection(name: str, gateway: str | UUID, server_name: str, database_name: str, user_name: str, password: str, privacy_level: str, connection_encryption: Literal['Encrypted', 'Any', 'NotEncrypted'] = 'NotEncrypted', skip_test_connection: bool = False)

Creates a virtual network gateway connection.

This is a wrapper function for the following API: Connections - Create Connection.

Service Principal Authentication is supported (see here for examples).

Parameters:
  • name (str) – The name of the connection.

  • gateway (str | uuid.UUID) – The name or Id of the gateway.

  • server_name (str) – The name of the server.

  • database_name (str) – The name of the database.

  • user_name (str) – The username.

  • password (str) – The password.

  • privacy_level (str) –

    The privacy level of the connection.

  • connection_encryption (Literal["Encrypted", "Any", "NotEncrypted"], default="NotEncrypted") – The connection encryption type.

  • skip_test_connection (bool, default=False) – If True, skips the test connection.

sempy_labs.connection.delete_connection(connection: str | UUID)

Delete a connection.

This is a wrapper function for the following API: Connections - Delete Connection.

Service Principal Authentication is supported (see here for examples).

Parameters:

connection (str | uuid.UUID) – The connection name or ID.

sempy_labs.connection.delete_connection_role_assignment(connection: str | UUID, role_assignment_id: UUID)

Delete the specified role assignment for the connection.

This is a wrapper function for the following API: Connections - Delete Connection Role Assignment.

Service Principal Authentication is supported (see here for examples).

Parameters:
  • connection (str | uuid.UUID) – The connection name or ID.

  • role_assignment_id (uuid.UUID) – The role assignment ID.

sempy_labs.connection.list_connection_role_assignments(connection: str | UUID) DataFrame

Returns a list of connection role assignments.

This is a wrapper function for the following API: Connections - List Connection Role Assignments.

Service Principal Authentication is supported (see here for examples).

Parameters:

connection (str | uuid.UUID) – The connection name or ID.

Returns:

A pandas dataframe showing a list of connection role assignments.

Return type:

pandas.DataFrame

sempy_labs.connection.list_connections() DataFrame

Lists all available connections.

Service Principal Authentication is supported (see here for examples).

Returns:

A pandas dataframe showing all available connections.

Return type:

pandas.DataFrame

sempy_labs.connection.list_item_connections(item: str | UUID | None = None, type: str | None = None, workspace: str | UUID | None = None, **kwargs) DataFrame

Shows the list of connections that the specified item is connected to.

This is a wrapper function for the following API: Items - List Item Connections.

Service Principal Authentication is supported (see here for examples).

Parameters:
  • item (str | uuid.UUID) – The item name or ID.

  • type (str) – The item type.

  • workspace (str | uuid.UUID, default=None) – The Fabric workspace name or ID. Defaults to None which resolves to the workspace of the attached lakehouse or if no lakehouse attached, resolves to the workspace of the notebook.

Returns:

A pandas dataframe showing the list of connections that the specified item is connected to.

Return type:

pandas.DataFrame