Install & Compatibility
Where this runs
tested against v2.0.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.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 24.8MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.6s · import 0.000s · 25MB
24MB installed
● package 24MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
RelayManagementClient
✓ from azure.mgmt.relay import RelayManagementClient
✗ from azure.mgmt.relay import RelayManagementClient
This quickstart demonstrates how to authenticate with Azure using `DefaultAzureCredential` and list all Azure Relay namespaces within a specified subscription. Ensure you have the `AZURE_SUBSCRIPTION_ID` environment variable set and appropriate permissions in Azure for `DefaultAzureCredential` to function.
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.relay import RelayManagementClient
# Retrieve subscription ID from environment variable
# Ensure AZURE_SUBSCRIPTION_ID is set in your environment
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "")
if not subscription_id:
raise ValueError("AZURE_SUBSCRIPTION_ID environment variable not set.")
# Authenticate using DefaultAzureCredential
# This credential will attempt to authenticate in various environments:
# environment variables, managed identity, VS Code, Azure CLI, etc.
credential = DefaultAzureCredential()
# Create a RelayManagementClient
client = RelayManagementClient(credential, subscription_id)
print("Listing all Relay namespaces in the subscription...")
try:
for namespace in client.namespaces.list():
print(f"- {namespace.name}")
print("\nSuccessfully listed Relay namespaces.")
except Exception as e:
print(f"An error occurred: {e}")
print("Please ensure your Azure credentials and subscription ID are correctly configured and you have the necessary permissions.")
Debug
Known issues
breakingThe credential system underwent a complete revamp in `azure-mgmt-relay` 1.0.0b1. Old `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported. The `credentials` parameter was also renamed to `credential`.fixMigrate your authentication code to use classes from the `azure-identity` library, such as `DefaultAzureCredential`, `ClientSecretCredential`, or `ManagedIdentityCredential`. Update parameter names accordingly.
affects: < 1.0.0b1 to 1.0.0b1+
breakingThe `config` attribute on client objects has been removed starting from `azure-mgmt-relay` 1.0.0b1. All configuration options should now be passed as keyword arguments during client instantiation.fixRemove any direct access to `client.config`. Pass configuration settings directly to the client constructor as keyword arguments (e.g., `RelayManagementClient(credential, subscription_id, enable_logging=True)`).
affects: < 1.0.0b1 to 1.0.0b1+
breakingFor long-running operations (LROs), methods that previously returned `msrest.polling.LROPoller` now return `azure.core.polling.LROPoller` and are prefixed with `begin_` (e.g., `create` became `begin_create`).fixAdjust your code to call the `begin_` prefixed methods for LROs and handle the `azure.core.polling.LROPoller` return type.
affects: < 1.0.0b1 to 1.0.0b1+
breakingModel signatures now exclusively use keyword-argument syntax. Any positional arguments previously used for model creation or method calls must be rewritten as keyword arguments.fixReview all calls to model constructors and methods. Convert any positional arguments to explicit keyword arguments.
affects: < 0.2.0 to 0.2.0+
gotchaA `ModuleNotFoundError: No module named 'azure.mgmt.relay'` can occur if the package is not correctly installed, if the Python environment is not activated, or if there are conflicts with other Azure CLI or SDK installations.fixEnsure `pip install azure-mgmt-relay` was successful. If using a virtual environment, activate it before running your script. Consider reinstalling in a clean virtual environment if issues persist. For Azure CLI users, ensure the correct CLI extension version is used if it bundles this SDK.
affects: All versions
Upgrade
Version history
2.0.0latest on PyPI · released Jul 29, 2026
Audit
Dependencies
azure-identityrequiredRecommended for modern Azure SDK authentication.
azure-corerequiredBase library providing shared primitives for Azure SDKs.