Registry / azure / azure-mgmt-relay

azure-mgmt-relay

JSON →
library2.0.0pypypi✓ verified 22d ago

The `azure-mgmt-relay` library is the Microsoft Azure Relay Client Library for Python. It enables programmatic management of Azure Relay resources, such as namespaces, hybrid connections, and WCF relays, through Azure Resource Manager (ARM). The library is currently at stable version 1.1.0, released in September 2021. A 2.0.0b1 beta version was released in November 2022, but no stable release has followed since 1.1.0.

pip install azure-mgmt-relay
INSTALL
IMPORT
SIG · AZURE-MGMT-RELAY
A
azure-mgmt-relay
azurepythonv2.0.0
Install
2.6s avg
Import
Disk
24MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 24.8MB
glibc
py 3.103.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`.
fix
Migrate 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.
fix
Remove 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`).
fix
Adjust 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.
fix
Review 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.
fix
Ensure `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.
Agent activity
39 hits · last 30 days
node
34
Resources
azure-mgmt-relay — pip install azure-mgmt-relay · libregistry