Registry /
azure / azure-mgmt-notificationhubs
Install & Compatibility
Where this runs
tested against v8.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.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 46MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.1s · import 0.000s · 46MB
45MB installed
● package 45MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
NotificationHubsManagementClient
✓ from azure.mgmt.notificationhubs import NotificationHubsManagementClient
DefaultAzureCredential
✓ from azure.identity import DefaultAzureCredential
✗ from azure.common.credentials import ServicePrincipalCredentials
Old credential classes like `azure.common.credentials` or `msrestazure.azure_active_directory` are deprecated and will not work with recent versions of Azure SDK management clients. Use classes from `azure-identity` instead.
This quickstart demonstrates how to instantiate the `NotificationHubsManagementClient` using `DefaultAzureCredential` and list all Notification Hub namespaces within a subscription. Ensure `AZURE_SUBSCRIPTION_ID` and appropriate Azure AD credentials (e.g., `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`, `AZURE_TENANT_ID` for a service principal) are set as environment variables.
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.notificationhubs import NotificationHubsManagementClient
# Set environment variables for authentication and subscription ID
# AZURE_SUBSCRIPTION_ID
# AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID (for Service Principal)
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "<your-subscription-id>")
credential = DefaultAzureCredential()
client = NotificationHubsManagementClient(credential, subscription_id)
print("Listing Notification Hub namespaces...")
for namespace in client.namespaces.list_all():
print(f"- Namespace: {namespace.name} (Location: {namespace.location})")
print("Quickstart complete.")
Debug
Known issues
breakingMajor breaking changes occurred in version 8.0.0, primarily affecting client instantiation and authentication. Old credential systems (`azure.common.credentials`, `msrestazure.azure_active_directory`) are no longer supported. The `credentials` parameter was renamed to `credential`, and client configuration is now passed as keyword arguments instead of through a `config` attribute.fixMigrate authentication to `azure-identity` classes (e.g., `DefaultAzureCredential`). Update client instantiation to pass `credential` and other configurations as kwargs.
affects: >=8.0.0
breakingThe return type of `list_keys` in `NamespacesOperations` changed from `SharedAccessAuthorizationRuleListResult` to `ResourceListKeys` in version 8.0.0.fixUpdate code that processes the return value of `list_keys` to expect `ResourceListKeys` type.
affects: >=8.0.0
deprecatedSupport for Python 2.7 for Azure SDK Python packages ended on January 1, 2022.fixEnsure your project uses Python 3.7 or newer.
affects: <8.0.0 (Python 2.7 support), All versions (Python 3.x required)
gotchaAll Azure management clients, including `NotificationHubsManagementClient`, require an authenticated credential. The recommended approach is to use `azure-identity` to obtain credentials, such as `DefaultAzureCredential`, which simplifies authentication across various Azure environments.fixAlways pass a `TokenCredential` instance from `azure.identity` to the client constructor. Avoid hardcoding credentials; use environment variables or Managed Identities.
affects: All
Upgrade
Version history
8.0.0latest on PyPI · released Jan 6, 2022
Audit
Dependencies
azure-identityrequiredRequired for Azure Active Directory authentication with management clients.
azure-corerequiredProvides shared core functionality for Azure SDK libraries (e.g., HTTP pipeline, logging, retries).