{"id":1942,"library":"azure-synapse-accesscontrol","title":"Azure Synapse Access Control Client Library for Python","description":"The Azure Synapse Access Control Client Library for Python enables programmatic management of role assignments within Azure Synapse Analytics workspaces. Azure Synapse is an integrated analytics service that unifies big data and data warehousing capabilities. This package is part of the broader Azure SDK for Python, with its latest public release `0.7.0` from August 2021, indicating a slower release cadence for this specific client compared to other Azure SDK components, and it is a pre-1.0.0 beta version.","status":"active","version":"0.7.0","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python","tags":["azure","synapse","access control","rbac","sdk","microsoft"],"install":[{"cmd":"pip install azure-synapse-accesscontrol azure-identity","lang":"bash","label":"Install with authentication library"}],"dependencies":[{"reason":"Core utilities and HTTP pipeline for Azure SDK clients.","package":"azure-core","optional":false},{"reason":"Provides Azure Active Directory authentication support for Azure SDK clients.","package":"azure-identity","optional":false}],"imports":[{"symbol":"AccessControlClient","correct":"from azure.synapse.accesscontrol import AccessControlClient"},{"symbol":"DefaultAzureCredential","correct":"from azure.identity import DefaultAzureCredential"}],"quickstart":{"code":"import os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.synapse.accesscontrol import AccessControlClient\n\n# Set your Synapse Workspace endpoint as an environment variable or replace directly\n# Example: 'https://<your-workspace-name>.dev.azuresynapse.net'\nsynapse_workspace_endpoint = os.environ.get('SYNAPSE_WORKSPACE_ENDPOINT', 'https://your-synapse-workspace.dev.azuresynapse.net')\n\n# Authenticate using DefaultAzureCredential. This will try various methods\n# like environment variables, managed identity, and interactive browser login.\ncredential = DefaultAzureCredential()\n\n# Create an AccessControlClient\nclient = AccessControlClient(endpoint=synapse_workspace_endpoint, credential=credential)\n\ntry:\n    print(\"Listing role definitions...\")\n    role_definitions = client.list_role_definitions()\n    for role in role_definitions:\n        print(f\"- {role.name} (ID: {role.id})\")\n\n    # Example: List role assignments (requires appropriate permissions)\n    print(\"\\nListing role assignments...\")\n    role_assignments = client.list_role_assignments()\n    for assignment in role_assignments:\n        print(f\"- Role Assignment ID: {assignment.id}, Role ID: {assignment.role_definition_id}, Principal ID: {assignment.principal_id}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Ensure you have the correct permissions (e.g., Synapse Administrator) and the SYNAPSE_WORKSPACE_ENDPOINT is correctly set.\")","lang":"python","description":"This quickstart demonstrates how to authenticate with `DefaultAzureCredential` and use the `AccessControlClient` to list role definitions and assignments in an Azure Synapse Analytics workspace. Ensure your `SYNAPSE_WORKSPACE_ENDPOINT` environment variable is set to your Synapse workspace's development endpoint (e.g., `https://<your-workspace-name>.dev.azuresynapse.net`) and that the authenticated principal has sufficient permissions, such as 'Synapse Administrator' or specific RBAC roles, to perform these operations."},"warnings":[{"fix":"Consult the official change log for `azure-synapse-accesscontrol` before upgrading. Pin exact package versions in your `requirements.txt` to prevent automatic breaking updates.","message":"As a pre-1.0.0 beta package, `azure-synapse-accesscontrol` (version 0.7.0) may introduce breaking changes in minor versions. Developers should pin to specific minor versions and carefully review release notes when upgrading to avoid unexpected API changes.","severity":"breaking","affected_versions":"0.x.x"},{"fix":"Thoroughly review the Azure Synapse Analytics access control documentation. Ensure the identity used by `DefaultAzureCredential` has the necessary Synapse RBAC roles (e.g., Synapse Administrator, Synapse Contributor) assigned at the workspace or specific scope level, in addition to any required Azure RBAC roles for linked resources.","message":"Azure Synapse Analytics utilizes a multi-layered access control system (Azure roles, Synapse roles, SQL permissions). Correctly configuring permissions for access control operations can be complex and often requires a 'Synapse Administrator' role or a combination of specific Synapse RBAC roles and Azure RBAC roles on the underlying storage.","severity":"gotcha","affected_versions":"All"},{"fix":"Ensure you are installing `azure-synapse-accesscontrol` directly using `pip install azure-synapse-accesscontrol` and not depending on the `azure-synapse` umbrella package.","message":"The `azure-synapse` meta-package is deprecated. Users should install specific client libraries like `azure-synapse-accesscontrol` directly, rather than relying on the deprecated bundle.","severity":"deprecated","affected_versions":"All"},{"fix":"If encountering issues with Python 3.10 or newer, consider deploying in a Python 3.9 environment. Check the broader Azure SDK for Python documentation for updated compatibility policies for newer client library versions if they become available.","message":"The `0.7.0` release of `azure-synapse-accesscontrol` officially supported Python versions 2.7, 3.6, 3.7, 3.8, and 3.9 (with Python 3.5 support dropped in `0.6.0`). While it may function with newer Python versions (3.10+), official compatibility is not guaranteed for this specific version, and unexpected issues may arise.","severity":"gotcha","affected_versions":"0.7.0 and earlier"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}