{"id":831,"library":"azure-mgmt-core","title":"Azure Management Core Library for Python","description":"The `azure-mgmt-core` library provides extensions to Azure Core that are specific to Azure Resource Management (ARM), primarily used by Azure SDK management client libraries (e.g., `azure-mgmt-resource`). As a foundational component, it handles common ARM-specific patterns such as long-running operations and authentication challenges. The current stable version is 1.6.0, and it follows the release cadence of the broader Azure SDK for Python.","status":"active","version":"1.6.0","language":"python","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/core/azure-mgmt-core","tags":["Azure","Management","SDK","Core","ARM","Microsoft"],"install":[{"cmd":"pip install azure-mgmt-core","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Provides core HTTP pipeline, serialization, and other primitives. `azure-mgmt-core` extends it for ARM-specific functionality.","package":"azure-core","optional":false},{"reason":"Required for modern token-based authentication with Azure management clients, which implicitly use `azure-mgmt-core` for handling credentials.","package":"azure-identity","optional":false}],"imports":[{"note":"A pipeline client designed for ARM explicitly, part of the core functionality.","symbol":"ARMPipelineClient","correct":"from azure.mgmt.core.pipeline_client import ARMPipelineClient"},{"note":"Policy for handling Continuous Access Evaluation (CAE) challenges in ARM requests.","symbol":"ARMChallengeAuthenticationPolicy","correct":"from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy"},{"note":"Helper function to retrieve ARM endpoint and credential scopes from cloud settings.","symbol":"get_arm_endpoints","correct":"from azure.mgmt.core.tools import get_arm_endpoints"}],"quickstart":{"code":"import os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.mgmt.resource import ResourceManagementClient\n\n# NOTE: azure-mgmt-core is an internal dependency for Azure management SDKs.\n# This quickstart demonstrates how a typical Azure management client is used,\n# which indirectly relies on azure-mgmt-core.\n\n# Your Azure subscription ID\n# It's recommended to set this as an environment variable (AZURE_SUBSCRIPTION_ID)\n# or retrieve it from your Azure context.\nsubscription_id = os.environ.get(\"AZURE_SUBSCRIPTION_ID\", \"your-subscription-id\")\n\nif subscription_id == \"your-subscription-id\":\n    print(\"Please set the AZURE_SUBSCRIPTION_ID environment variable or replace 'your-subscription-id'.\")\n    exit()\n\n# Authenticate with Azure using DefaultAzureCredential.\n# This attempts to authenticate via various methods like environment variables, Azure CLI, managed identity, etc.\ncredential = DefaultAzureCredential()\n\n# Create a ResourceManagementClient (which uses azure-mgmt-core internally)\nresource_client = ResourceManagementClient(credential, subscription_id)\n\n# Example: List all resource groups in the subscription\nprint(f\"Listing resource groups in subscription: {subscription_id}\")\nfor rg in resource_client.resource_groups.list():\n    print(f\"- {rg.name} (Location: {rg.location})\")\n\nprint(\"\\nQuickstart finished. This demonstrates how an Azure management client (which relies on azure-mgmt-core) is typically used.\")","lang":"python","description":"This library is primarily an internal dependency for Azure management SDKs. As such, direct 'quickstarts' for `azure-mgmt-core` are uncommon. Instead, its functionality is consumed by service-specific management clients (e.g., `ResourceManagementClient`). This example demonstrates how to initialize and use a typical Azure management client, which implicitly leverages `azure-mgmt-core` for its core ARM functionalities like authentication and request handling. Ensure `AZURE_SUBSCRIPTION_ID` is set as an environment variable or replaced."},"warnings":[{"fix":"Install the specific `azure-mgmt-<service>` package you need; `azure-mgmt-core` will be installed as a dependency.","message":"Direct installation of `azure-mgmt-core` is generally not needed for end-users. It is an internal dependency automatically installed when you install other service-specific Azure management SDKs (e.g., `azure-mgmt-compute`, `azure-mgmt-resource`).","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade your Python environment to version 3.9 or later. The `requires_python` metadata is `^=3.9`.","message":"Python 3.8 is no longer supported starting with `azure-mgmt-core` version 1.6.0. Earlier versions of the Azure SDK for Python might have supported it, but the current generation of management libraries requires Python 3.9 or later.","severity":"breaking","affected_versions":">=1.6.0"},{"fix":"Install the `azure-identity` package (`pip install azure-identity`) and then migrate your authentication code to use classes from it, such as `DefaultAzureCredential`. The `credential` parameter has also been renamed from `credentials` in many client constructors.","message":"The credential system for Azure SDKs has been completely revamped. Older management libraries used `azure.common.credentials` or `msrestazure.azure_active_directory`. All modern Azure management libraries, which `azure-mgmt-core` underpins, now use classes from the `azure-identity` package.","severity":"breaking","affected_versions":"Migrations from SDKs released before ~2020"},{"fix":"When performing long-running operations, call the `begin_` prefixed method and then await or poll the returned `LROPoller` object for the final result.","message":"Asynchronous long-running operations in the newer Azure SDKs, which are handled through `azure-mgmt-core`, now typically use methods prefixed with `begin_` (e.g., `begin_create`, `begin_delete`). These methods return an `azure.core.polling.LROPoller` object.","severity":"gotcha","affected_versions":"SDKs adopting the new guidelines (generally 2020 onwards)"}],"env_vars":null,"last_verified":"2026-05-12T20:13:42.288Z","next_check":"2026-06-27T00:00:00.000Z","problems":[{"fix":"Ensure `azure-mgmt-core` is installed in your environment, especially if you are using higher-level Azure management SDKs or Azure CLI extensions:\n`pip install azure-mgmt-core`","cause":"This error occurs when the `azure-mgmt-core` package, or a module within it like `azure.mgmt.core.tools`, is not installed in the Python environment or is not accessible to the running script, often seen in misconfigured Azure CLI extensions or automation environments.","error":"ModuleNotFoundError: No module named 'azure.mgmt.core'"},{"fix":"Upgrade your `azure-mgmt-core` package to a version that includes the `get_arm_endpoints` function:\n`pip install --upgrade azure-mgmt-core`","cause":"This `ImportError` typically happens when an older version of `azure-mgmt-core` is installed, and a dependent library (such as an Azure CLI extension or another `azure-mgmt-*` package) attempts to import `get_arm_endpoints`, a function that was added in `azure-mgmt-core` version 1.5.0 or later.","error":"ImportError: cannot import name 'get_arm_endpoints' from 'azure.mgmt.core.tools'"},{"fix":"Ensure `azure-core` and `azure-mgmt-core` are compatible and updated. Upgrading both usually resolves the issue:\n`pip install --upgrade azure-core azure-mgmt-core`","cause":"This error indicates a version incompatibility between `azure-core` and `azure-mgmt-core`, where `azure-mgmt-core` (or another dependent library) expects the `AzureClouds` object to be available in `azure.core`, but it's either missing or moved in the installed `azure-core` version.","error":"ImportError: cannot import name 'AzureClouds' from 'azure.core'"},{"fix":"Install the `azure-common` package, which provides the `azure.profiles` module:\n`pip install azure-common`\nIt's also advisable to ensure all related Azure SDK packages are up to date:\n`pip install --upgrade azure-core azure-identity azure-mgmt-compute azure-mgmt-core`","cause":"This error commonly occurs when a management client library, such as `azure-mgmt-compute`, which relies on `azure-mgmt-core` and implicitly `azure.profiles`, cannot find the `azure.profiles` module. This module is often provided by the `azure-common` package, which might be a missing transitive dependency.","error":"ModuleNotFoundError: No module named 'azure.profiles'"}],"ecosystem":"pypi","meta_description":null,"install_score":0,"install_tag":"stale","quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.6.0","cli_name":null,"install_checks":{"last_tested":"2026-05-12","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"23.3M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":2.3,"import_time_s":null,"mem_mb":null,"disk_size":"24M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"25.6M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":2.3,"import_time_s":null,"mem_mb":null,"disk_size":"26M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"17.3M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":2.1,"import_time_s":null,"mem_mb":null,"disk_size":"18M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"17.1M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":2.2,"import_time_s":null,"mem_mb":null,"disk_size":"18M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":"22.5M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":2.6,"import_time_s":null,"mem_mb":null,"disk_size":"23M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":1,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null}]},"quickstart_checks":{"last_tested":"2026-04-24","tag":null,"tag_description":null,"results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}