{"id":1939,"library":"azure-mgmt-servicelinker","title":"Azure Service Linker Management Client Library for Python","description":"The `azure-mgmt-servicelinker` library is the Microsoft Azure Service Linker Management Client Library for Python. It provides the tools to manage Azure Service Linkers, which connect Azure compute services to other Azure data services. The current stable version is 1.1.0. Azure SDKs typically follow a frequent release cadence, with minor releases quarterly or less, and patch releases as bug fixes become available.","status":"active","version":"1.1.0","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python","tags":["azure","management","cloud","service linker"],"install":[{"cmd":"pip install azure-mgmt-servicelinker azure-identity","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Required for Azure Active Directory token authentication with `DefaultAzureCredential`.","package":"azure-identity","optional":false},{"reason":"Underlying core library for shared primitives and HTTP pipeline. Usually pulled in transitively.","package":"azure-core","optional":false}],"imports":[{"symbol":"ServiceLinkerManagementClient","correct":"from azure.mgmt.servicelinker import ServiceLinkerManagementClient"},{"symbol":"DefaultAzureCredential","correct":"from azure.identity import DefaultAzureCredential"}],"quickstart":{"code":"import os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.mgmt.servicelinker import ServiceLinkerManagementClient\n\n# Set environment variables for authentication (replace with your actual values or use Azure CLI/VS Code login)\n# AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_SUBSCRIPTION_ID\n# For local development, DefaultAzureCredential will try various methods, including environment variables,\n# managed identity, Azure CLI, or Visual Studio Code login.\n\nsubscription_id = os.environ.get(\"AZURE_SUBSCRIPTION_ID\", \"00000000-0000-0000-0000-000000000000\") # Replace with your subscription ID\nresource_uri = \"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Web/sites/test-app\" # Example URI, replace as needed\n\n# Authenticate using DefaultAzureCredential\ncredential = DefaultAzureCredential()\n\n# Create a ServiceLinkerManagementClient\nclient = ServiceLinkerManagementClient(credential=credential, subscription_id=subscription_id)\n\n# Example: List linkers for a given resource_uri\ntry:\n    print(f\"Listing linkers for resource: {resource_uri}\")\n    linkers = client.linkers.list(resource_uri=resource_uri)\n    for linker in linkers:\n        print(f\"  - Linker Name: {linker.name}, Target Service: {linker.target_service.id if linker.target_service else 'N/A'}\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Please ensure the resource_uri and subscription_id are correct and you have the necessary permissions.\")\n    print(\"Also, verify your authentication environment variables (AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET) or local Azure login.\")","lang":"python","description":"This quickstart demonstrates how to instantiate the `ServiceLinkerManagementClient` and list existing Service Linkers for a given resource. It uses `DefaultAzureCredential` for authentication, which attempts to authenticate through various methods suitable for both local development and deployment environments."},"warnings":[{"fix":"Review the official migration guide or API reference for version 1.0.0+ and update your code to use the new parameter names and structures, such as `target_service` instead of `target_id`.","message":"Version 1.0.0 introduced several breaking changes in model parameters. Specifically, `LinkerPatch` and `LinkerResource` no longer have the `target_id` parameter, `SecretAuthInfo` removed the `secret` parameter (replaced by `secret_info`), and `ValidateResult` saw changes in its `linker_status`, `name`, and `reason` parameters.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Upgrade your Python environment to Python 3.6 or newer (Python 3.8+ is recommended for newer Azure SDKs) to ensure compatibility and receive ongoing support and updates.","message":"Support for Python 2.7 in Azure SDK Python packages, including `azure-mgmt-servicelinker`, ended on January 1, 2022. Using Python 2.7 with this library is not supported and may lead to unpatched security vulnerabilities or unexpected behavior.","severity":"deprecated","affected_versions":"<=1.1.0 (all versions)"},{"fix":"Always install the specific service management package, e.g., `pip install azure-mgmt-servicelinker`, rather than the deprecated monolithic `azure-mgmt` package.","message":"The general `azure-mgmt` package is deprecated since version 5.0.0. Users should install service-specific packages like `azure-mgmt-servicelinker` for individual Azure management services. Installing the older `azure-mgmt` package will not provide the Service Linker client.","severity":"gotcha","affected_versions":"All versions of `azure-mgmt-servicelinker`"},{"fix":"Ensure these environment variables are correctly set in your execution environment. For local development, consider using `az login` (Azure CLI) or `azd auth login` (Azure Developer CLI) which `DefaultAzureCredential` can leverage automatically.","message":"For `DefaultAzureCredential` to work correctly in many scenarios (especially service principal authentication), critical environment variables like `AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`, and `AZURE_SUBSCRIPTION_ID` must be configured. Incorrect or missing configuration is a common source of authentication errors.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}