{"id":1375,"library":"azure-mgmt-nspkg","title":"Azure Management Namespace Package","description":"The `azure-mgmt-nspkg` library is a Microsoft Azure Resource Management Namespace Package. It is an internal package whose primary function is to establish and manage the `azure.mgmt` namespace for older versions of Azure management client libraries. As a namespace package, it does not contain any functional code, classes, or methods itself. Its current version is 3.0.2, and it follows the release cadence of the broader Azure SDK for Python, though this specific package is now largely static.","status":"maintenance","version":"3.0.2","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python","tags":["azure","microsoft","cloud","management","namespace","sdk"],"install":[{"cmd":"pip install azure-mgmt-nspkg","lang":"bash","label":"Install `azure-mgmt-nspkg`"}],"dependencies":[],"imports":[{"note":"Users should install specific `azure-mgmt-*` client libraries (e.g., `azure-mgmt-resource`) to access management functionality. This package itself provides no callable code.","symbol":"Namespace Placeholder","correct":"This package does not export any direct symbols. Its purpose is to define the 'azure.mgmt' namespace, allowing imports from specific management clients like `from azure.mgmt.compute import ComputeManagementClient` once `azure-mgmt-compute` is installed."}],"quickstart":{"code":"# The azure-mgmt-nspkg package does not offer direct runnable code.\n# It's a namespace provider. To interact with Azure resources,\n# you need to install and import a specific management client.\n# Example for Azure Resource Management:\n\n# pip install azure-mgmt-resource\n\nfrom azure.identity import DefaultAzureCredential\nfrom azure.mgmt.resource import ResourceManagementClient\nimport os\n\n# Ensure AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID, AZURE_SUBSCRIPTION_ID are set\n# or use other credential types from azure.identity\nsubscription_id = os.environ.get('AZURE_SUBSCRIPTION_ID', 'YOUR_SUBSCRIPTION_ID')\n\nif subscription_id == 'YOUR_SUBSCRIPTION_ID':\n    print(\"Warning: AZURE_SUBSCRIPTION_ID environment variable not set. Please set it for a real quickstart.\")\nelse:\n    try:\n        credential = DefaultAzureCredential()\n        resource_client = ResourceManagementClient(credential, subscription_id)\n\n        # Example: List resource groups\n        print(f\"Listing resource groups in subscription {subscription_id}:\")\n        for group in resource_client.resource_groups.list():\n            print(f\"- {group.name} in {group.location}\")\n    except Exception as e:\n        print(f\"An error occurred: {e}\")\n        print(\"Please ensure your Azure credentials and subscription ID are correctly configured.\")","lang":"python","description":"The `azure-mgmt-nspkg` package itself does not provide any direct functionality or classes to instantiate. This quickstart demonstrates how to use a typical Azure management client (e.g., `ResourceManagementClient` from `azure-mgmt-resource`), which relies on the `azure.mgmt` namespace. Ensure you have `azure-identity` and the specific `azure-mgmt-*` package installed, and your Azure credentials configured."},"warnings":[{"fix":"Install the specific `azure-mgmt-SERVICE` package for the Azure service you wish to manage (e.g., `pip install azure-mgmt-storage`).","message":"This package is a namespace package only. It does not contain any functional code, classes, or methods. Installing `azure-mgmt-nspkg` alone will not provide any Azure management capabilities; you must install specific client libraries like `azure-mgmt-compute`, `azure-mgmt-resource`, etc.","severity":"gotcha","affected_versions":"All versions (1.0.0+)"},{"fix":"Identify the specific Azure service you need to interact with and install its corresponding client library (e.g., `pip install azure-mgmt-web`).","message":"Installing `azure-mgmt-nspkg` does NOT automatically install all Azure management client libraries. It serves only to consolidate the `azure.mgmt` namespace for packages that rely on it.","severity":"gotcha","affected_versions":"All versions (1.0.0+)"},{"fix":"For new projects or modern Python environments, simply install the specific `azure-mgmt-SERVICE` packages you need. If you encounter `ModuleNotFoundError` for `azure.mgmt` with specific management clients, then installing `azure-mgmt-nspkg` might resolve it, though it's less common now.","message":"For modern Python environments (Python 3.3+) and recent Azure SDKs, explicit installation of `azure-mgmt-nspkg` is often no longer strictly necessary due to PEP 420 (Implicit Namespace Packages). The individual `azure-mgmt-SERVICE` packages typically contribute to the `azure.mgmt` namespace automatically.","severity":"deprecated","affected_versions":"Mainly relevant for older Python 2.x projects or specific legacy setups that predate widespread PEP 420 adoption in the Azure SDK. Less critical for new projects."}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}