{"id":1391,"library":"azure-synapse-artifacts","title":"Azure Synapse Artifacts Client Library","description":"The Microsoft Azure Synapse Artifacts Client Library for Python allows interaction with Azure Synapse Analytics workspaces to manage data factory artifacts like pipelines, datasets, linked services, and data flows. As of its current version 0.22.0, it provides a programmatic interface for creating, reading, updating, and deleting these resources. The library follows the Azure SDK guidelines for Python, utilizing `azure-core` and `azure-identity` for consistent interaction and authentication. New versions are released as part of the broader Azure SDK for Python release train, typically on a monthly or bi-monthly cadence, with `0.x.x` versions indicating a preview status.","status":"active","version":"0.22.0","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/synapse/azure-synapse-artifacts","tags":["azure","synapse","data_factory","analytics","cloud","etl"],"install":[{"cmd":"pip install azure-synapse-artifacts","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Required for authentication using Azure Active Directory, typically via DefaultAzureCredential.","package":"azure-identity","optional":false}],"imports":[{"note":"The client for artifacts is directly under `azure.synapse.artifacts`, not an older 'data_factory' submodule or a top-level 'synapse' module.","wrong":"from azure.synapse.data_factory import SynapseArtifactsClient","symbol":"SynapseArtifactsClient","correct":"from azure.synapse.artifacts import SynapseArtifactsClient"},{"symbol":"DefaultAzureCredential","correct":"from azure.identity import DefaultAzureCredential"}],"quickstart":{"code":"import os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.synapse.artifacts import SynapseArtifactsClient\n\n# Set your Synapse workspace endpoint. It should look like: https://{workspace_name}.dev.azuresynapse.net\nsynapse_workspace_url = os.environ.get('AZURE_SYNAPSE_WORKSPACE_URL', 'https://your-synapse-workspace.dev.azuresynapse.net')\n\nif not synapse_workspace_url:\n    raise ValueError(\"Please set the 'AZURE_SYNAPSE_WORKSPACE_URL' environment variable.\")\n\ntry:\n    # Authenticate with DefaultAzureCredential\n    credential = DefaultAzureCredential()\n\n    # Create a SynapseArtifactsClient\n    client = SynapseArtifactsClient(endpoint=synapse_workspace_url, credential=credential)\n\n    print(f\"Connected to Synapse workspace: {synapse_workspace_url}\")\n\n    # List pipelines in the workspace\n    print(\"Listing pipelines:\")\n    pipelines = client.pipeline.get_pipelines_by_workspace()\n    for pipeline in pipelines:\n        print(f\"  - {pipeline.name}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Please ensure 'AZURE_SYNAPSE_WORKSPACE_URL' is set and your Azure credentials are configured.\")\n    print(\"For DefaultAzureCredential, ensure AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET (or other auth methods) are set.\")","lang":"python","description":"This quickstart demonstrates how to initialize the `SynapseArtifactsClient` using `DefaultAzureCredential` and list the pipelines within your Azure Synapse Analytics workspace. Ensure your `AZURE_SYNAPSE_WORKSPACE_URL` environment variable is set to your workspace's development endpoint (e.g., `https://{workspace_name}.dev.azuresynapse.net`) and your Azure credentials are configured for `DefaultAzureCredential` to function, typically via environment variables like `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET` for service principals."},"warnings":[{"fix":"Be prepared for potential API changes when upgrading. Monitor release notes closely for updates and consider pinning to specific preview versions in production environments until 1.0.0 is released.","message":"The library is currently in a preview (0.x.x) version. APIs are subject to change without notice before a 1.0.0 stable release, which may introduce breaking changes in future minor versions.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Always verify the endpoint format from your Synapse workspace overview in the Azure portal or by inspecting the workspace properties. Set the `endpoint` parameter of `SynapseArtifactsClient` accordingly.","message":"The Synapse workspace endpoint URL must be in the correct format, typically `https://{workspace_name}.dev.azuresynapse.net`. Incorrect URLs (e.g., missing `.dev` or `.net`) will lead to connection errors.","severity":"gotcha","affected_versions":"*"},{"fix":"Refer to the `azure-identity` documentation for setting up `DefaultAzureCredential`. Ensure the identity used has sufficient permissions (e.g., 'Synapse Contributor' or 'Synapse Artifact User') on the Synapse workspace.","message":"Using `DefaultAzureCredential` for authentication requires proper configuration of Azure environment variables (e.g., `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET` for a service principal, or local login via `az login`).","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}