{"id":1384,"library":"azure-mgmt-signalr","title":"Azure SignalR Management Client Library for Python","description":"The `azure-mgmt-signalr` library is the Microsoft Azure SignalR Client Library for Python, enabling programmatic management of Azure SignalR Service resources. It supports operations like creating, updating, deleting, and listing SignalR instances. The current stable version is 1.2.0, released in March 2023. This library is part of the broader Azure SDK for Python, which generally follows a consistent release cadence with frequent updates across its various service-specific packages.","status":"active","version":"1.2.0","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/signalr/azure-mgmt-signalr","tags":["azure","signalr","cloud","management","sdk","microsoft"],"install":[{"cmd":"pip install azure-mgmt-signalr azure-identity","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Required for type hints and compatibility.","package":"typing-extensions","optional":false},{"reason":"Provides shared functionalities for Azure management libraries.","package":"azure-mgmt-core","optional":false},{"reason":"Shared utilities for Azure SDKs.","package":"azure-common","optional":false},{"reason":"Core REST client runtime for Azure services.","package":"msrest","optional":false},{"reason":"Required for Azure Active Directory token authentication.","package":"azure-identity","optional":false}],"imports":[{"note":"In newer versions (post 1.0.0b1), the main client class is `SignalRManagementClient` and is imported directly from `azure.mgmt.signalr`. The older `SignalRClient` and its specific sub-module import path are deprecated.","wrong":"from azure.mgmt.signalr.signalr_client import SignalRClient","symbol":"SignalRManagementClient","correct":"from azure.mgmt.signalr import SignalRManagementClient"},{"note":"Model classes should be imported from the `azure.mgmt.signalr.models` module directly, not from nested sub-modules.","wrong":"from azure.mgmt.signalr.models.my_model_class import MyModelClass","symbol":"models","correct":"from azure.mgmt.signalr import models"}],"quickstart":{"code":"import os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.mgmt.signalr import SignalRManagementClient\n\n# Set environment variables for authentication and subscription ID\n# AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET\n# AZURE_SUBSCRIPTION_ID\n\nsubscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', 'your_subscription_id')\n\nif subscription_id == 'your_subscription_id':\n    print(\"Please set the AZURE_SUBSCRIPTION_ID environment variable.\")\n    exit(1)\n\ntry:\n    # Authenticate using DefaultAzureCredential\n    # This credential will attempt to authenticate via environment variables, managed identity, or Azure CLI.\n    credential = DefaultAzureCredential()\n\n    # Create a SignalRManagementClient\n    signalr_client = SignalRManagementClient(credential, subscription_id)\n\n    print(f\"Listing SignalR resources in subscription: {subscription_id}\")\n\n    # List all SignalR services in the subscription\n    for resource in signalr_client.signal_r.list_by_subscription():\n        print(f\"  - SignalR Resource: {resource.name}, Location: {resource.location}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n","lang":"python","description":"This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and list all Azure SignalR Service resources within a specified subscription. Ensure you have the necessary environment variables (`AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_SUBSCRIPTION_ID`) set for `DefaultAzureCredential` to work."},"warnings":[{"fix":"Migrate to `azure-identity` classes (e.g., `DefaultAzureCredential`) for authentication. Update client instantiation to use the `credential` parameter.","message":"The credential system was completely revamped starting from version 1.0.0b1. Older `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported for authentication. The `credentials` parameter on client constructors was renamed to `credential`.","severity":"breaking","affected_versions":"1.0.0b1 and later"},{"fix":"Update import statements to `from azure.mgmt.signalr import SignalRManagementClient` and `from azure.mgmt.signalr import models`. Access model classes via `models.MyClass`.","message":"Between earlier preview versions and 1.2.0, a new code generator might have introduced breaking changes related to module visibility and import paths. Specifically, `SignalRClient` was renamed to `SignalRManagementClient` and its direct import from `azure.mgmt.signalr.signalr_client` is incorrect; it should now be imported from `azure.mgmt.signalr`. Similarly, direct imports of models from `azure.mgmt.signalr.models.my_class` are no longer supported; instead, import from the `azure.mgmt.signalr.models` module.","severity":"breaking","affected_versions":"Versions 1.0.0 (and possibly some 0.x.x versions) to 1.2.0"},{"fix":"Ensure your project runs on Python 3.7 or a newer supported version.","message":"This package, like other modern Azure SDK for Python libraries, officially supports Python 3.7 and later. Support for Python 2.7 ended on January 1, 2022. Using it with unsupported Python versions may lead to unexpected behavior or installation issues.","severity":"gotcha","affected_versions":"All versions post-Python 2.7 EOL"},{"fix":"Set the necessary Azure Active Directory environment variables for your chosen authentication method or provide explicit credentials to `DefaultAzureCredential` or another `azure-identity` credential type.","message":"Authentication using `DefaultAzureCredential` relies on specific environment variables for service principal or client secret authentication. Without these configured, the credential chain might fail. Required variables include `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`, and `AZURE_SUBSCRIPTION_ID`.","severity":"gotcha","affected_versions":"All versions using `azure-identity`"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}