{"id":3415,"library":"azure-mgmt-notificationhubs","title":"Azure Notification Hubs Management","description":"Microsoft Azure Notification Hubs Management Client Library for Python, currently at version 8.0.0. This package provides programmatic access to manage Azure Notification Hubs resources, enabling operations like creating and configuring namespaces and notification hubs. It is part of the Azure SDK for Python, which typically follows a monthly or bi-monthly release cadence for updates and bug fixes, with major versions introducing breaking changes.","status":"active","version":"8.0.0","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python","tags":["azure","cloud","management","notification-hubs","sdk"],"install":[{"cmd":"pip install azure-mgmt-notificationhubs azure-identity","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Required for Azure Active Directory authentication with management clients.","package":"azure-identity","optional":false},{"reason":"Provides shared core functionality for Azure SDK libraries (e.g., HTTP pipeline, logging, retries).","package":"azure-core","optional":false}],"imports":[{"symbol":"NotificationHubsManagementClient","correct":"from azure.mgmt.notificationhubs import NotificationHubsManagementClient"},{"note":"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.","wrong":"from azure.common.credentials import ServicePrincipalCredentials","symbol":"DefaultAzureCredential","correct":"from azure.identity import DefaultAzureCredential"}],"quickstart":{"code":"import os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.mgmt.notificationhubs import NotificationHubsManagementClient\n\n# Set environment variables for authentication and subscription ID\n# AZURE_SUBSCRIPTION_ID\n# AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID (for Service Principal)\n\nsubscription_id = os.environ.get(\"AZURE_SUBSCRIPTION_ID\", \"<your-subscription-id>\")\ncredential = DefaultAzureCredential()\n\nclient = NotificationHubsManagementClient(credential, subscription_id)\n\nprint(\"Listing Notification Hub namespaces...\")\nfor namespace in client.namespaces.list_all():\n    print(f\"- Namespace: {namespace.name} (Location: {namespace.location})\")\n\nprint(\"Quickstart complete.\")","lang":"python","description":"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."},"warnings":[{"fix":"Migrate authentication to `azure-identity` classes (e.g., `DefaultAzureCredential`). Update client instantiation to pass `credential` and other configurations as kwargs.","message":"Major 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.","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Update code that processes the return value of `list_keys` to expect `ResourceListKeys` type.","message":"The return type of `list_keys` in `NamespacesOperations` changed from `SharedAccessAuthorizationRuleListResult` to `ResourceListKeys` in version 8.0.0.","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Ensure your project uses Python 3.7 or newer.","message":"Support for Python 2.7 for Azure SDK Python packages ended on January 1, 2022.","severity":"deprecated","affected_versions":"<8.0.0 (Python 2.7 support), All versions (Python 3.x required)"},{"fix":"Always pass a `TokenCredential` instance from `azure.identity` to the client constructor. Avoid hardcoding credentials; use environment variables or Managed Identities.","message":"All 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.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}