Install & Compatibility
Where this runs
tested against v1.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.612s · 46.6MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.2s · import 0.562s · 47MB
46MB installed
● package 46MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
SignalRManagementClient
✓ from azure.mgmt.signalr import SignalRManagementClient
✗ from azure.mgmt.signalr.signalr_client import SignalRClient
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.
models
✓ from azure.mgmt.signalr import models
✗ from azure.mgmt.signalr.models.my_model_class import MyModelClass
Model classes should be imported from the `azure.mgmt.signalr.models` module directly, not from nested sub-modules.
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.
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.signalr import SignalRManagementClient
# Set environment variables for authentication and subscription ID
# AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET
# AZURE_SUBSCRIPTION_ID
subscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', 'your_subscription_id')
if subscription_id == 'your_subscription_id':
print("Please set the AZURE_SUBSCRIPTION_ID environment variable.")
exit(1)
try:
# Authenticate using DefaultAzureCredential
# This credential will attempt to authenticate via environment variables, managed identity, or Azure CLI.
credential = DefaultAzureCredential()
# Create a SignalRManagementClient
signalr_client = SignalRManagementClient(credential, subscription_id)
print(f"Listing SignalR resources in subscription: {subscription_id}")
# List all SignalR services in the subscription
for resource in signalr_client.signal_r.list_by_subscription():
print(f" - SignalR Resource: {resource.name}, Location: {resource.location}")
except Exception as e:
print(f"An error occurred: {e}")
Debug
Known issues
breakingThe 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`.fixMigrate to `azure-identity` classes (e.g., `DefaultAzureCredential`) for authentication. Update client instantiation to use the `credential` parameter.
affects: 1.0.0b1 and later
breakingBetween 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.fixUpdate import statements to `from azure.mgmt.signalr import SignalRManagementClient` and `from azure.mgmt.signalr import models`. Access model classes via `models.MyClass`.
affects: Versions 1.0.0 (and possibly some 0.x.x versions) to 1.2.0
gotchaThis 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.fixEnsure your project runs on Python 3.7 or a newer supported version.
affects: All versions post-Python 2.7 EOL
gotchaAuthentication 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`.fixSet the necessary Azure Active Directory environment variables for your chosen authentication method or provide explicit credentials to `DefaultAzureCredential` or another `azure-identity` credential type.
affects: All versions using `azure-identity`
Upgrade
Version history
1.2.0latest on PyPI · released Mar 20, 2023
Audit
Dependencies
typing-extensionsrequiredRequired for type hints and compatibility.
azure-mgmt-corerequiredProvides shared functionalities for Azure management libraries.
azure-commonrequiredShared utilities for Azure SDKs.
msrestrequiredCore REST client runtime for Azure services.
azure-identityrequiredRequired for Azure Active Directory token authentication.