Azure Synapse Managed Private Endpoints

0.4.0 · active · verified Thu Apr 09

This is the Microsoft Azure Synapse Managed Private Endpoints Client Library for Python, currently at version 0.4.0. It allows programmatic management of managed private endpoints within an Azure Synapse Analytics workspace, which are essential for securing data access over private links. The package is part of the broader Azure SDK for Python, which generally follows an active release cadence, though this specific client library version has remained stable since August 2021.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and then initialize the `VnetClient` for Azure Synapse Managed Private Endpoints to list existing private endpoints in your workspace. Ensure `SYNAPSE_WORKSPACE_ENDPOINT` is set to your Synapse workspace's development endpoint.

import os
from azure.identity import DefaultAzureCredential
from azure.synapse.managedprivateendpoints import VnetClient

# Your Azure Synapse workspace development endpoint, e.g., "https://<your-workspace-name>.dev.azuresynapse.net"
SYNAPSE_WORKSPACE_ENDPOINT = os.environ.get("SYNAPSE_WORKSPACE_ENDPOINT", "https://your_synapse_workspace.dev.azuresynapse.net")

# Create a credential using DefaultAzureCredential.
# DefaultAzureCredential will attempt to authenticate through multiple mechanisms,
# including environment variables, managed identity, and development tools.
credential = DefaultAzureCredential()

# Create a VnetClient
# The default API version is '2020-12-01'.
vnet_client = VnetClient(credential, SYNAPSE_WORKSPACE_ENDPOINT)

print("Listing managed private endpoints...")
# The .list() method is paginated, so iterate through the results.
managed_private_endpoints = vnet_client.managed_private_endpoints.list()
for mpe in managed_private_endpoints:
    print(f"  - Name: {mpe.name}, Status: {mpe.properties.provisioning_state}, Approval: {mpe.properties.private_link_connection_state.status}")

view raw JSON →