Registry /
azure / azure-mgmt-resource-deployments
Install & Compatibility
Where this runs
tested against v1.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 · 44.6MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.7s · import 0.000s · 45MB
44MB installed
● package 44MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
ResourceManagementClient
✓ from azure.mgmt.resource import ResourceManagementClient
✗ from azure.mgmt.resource_deployments import ResourceManagementClient
The `azure-mgmt-resource-deployments` package is a meta-package. The core client for managing deployments, `ResourceManagementClient`, is found in the `azure-mgmt-resource` package, which is a dependency.
DefaultAzureCredential
✓ from azure.identity import DefaultAzureCredential
This quickstart demonstrates how to create an Azure Resource Group and then deploy a simple ARM template (creating a Storage Account) using `azure-mgmt-resource-deployments`. It requires `azure-identity` for authentication and relies on `AZURE_SUBSCRIPTION_ID`, `AZURE_RESOURCE_GROUP_NAME`, and `AZURE_LOCATION` environment variables or a prior `az login`.
import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.resource import ResourceManagementClient
# --- Setup for Quickstart ---
# Ensure these environment variables are set for authentication and resource creation:
# AZURE_SUBSCRIPTION_ID: Your Azure subscription ID
# AZURE_TENANT_ID: Your Azure Active Directory tenant ID
# AZURE_CLIENT_ID: Your Azure AD application client ID
# AZURE_CLIENT_SECRET: Your Azure AD application client secret
# Or log in via Azure CLI: `az login`
subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "YOUR_SUBSCRIPTION_ID")
resource_group_name = os.environ.get("AZURE_RESOURCE_GROUP_NAME", "my-deployment-test-rg")
deployment_name = "mySimpleStorageDeployment"
location = os.environ.get("AZURE_LOCATION", "eastus")
# Acquire a credential object
try:
credential = DefaultAzureCredential()
except Exception as e:
print(f"Failed to acquire Azure credentials. Please ensure you are logged in (e.g., `az login`) or environment variables are set. Error: {e}")
exit(1)
# Obtain the management object (from azure.mgmt.resource, a dependency)
resource_client = ResourceManagementClient(credential, subscription_id)
# Define a simple ARM template to deploy a storage account
template_content = {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2021-09-01",
"name": f"storagename{subscription_id[:8].replace('-','').lower()}", # Unique name
"location": location,
"sku": {"name": "Standard_LRS"},
"kind": "StorageV2",
"properties": {"supportsHttpsTrafficOnly": True}
}
]
}
parameters_content = {}
deployment_properties = {
"mode": "Incremental",
"template": template_content,
"parameters": parameters_content
}
print(f"Creating/Updating resource group '{resource_group_name}' if it doesn't exist...")
resource_client.resource_groups.create_or_update(
resource_group_name,
{"location": location}
)
print(f"Resource group '{resource_group_name}' ready.")
print(f"Initiating deployment '{deployment_name}' in resource group '{resource_group_name}'...")
try:
poller = resource_client.deployments.begin_create_or_update(
resource_group_name,
deployment_name,
{"properties": deployment_properties}
)
deployment_result = poller.result()
print(f"Deployment '{deployment_name}' status: {deployment_result.properties.provisioning_state}")
if deployment_result.properties.provisioning_state == "Succeeded":
print(f"Deployment successful. Resources created:")
for resource in deployment_result.properties.output_resources:
print(f"- {resource.id}")
else:
print("Deployment failed or is in a non-succeeded state.")
if deployment_result.properties.error:
print(f"Error details: {deployment_result.properties.error.code} - {deployment_result.properties.error.message}")
except Exception as e:
print(f"An error occurred during deployment: {e}")
Debug
Known issues
breakingThis library is currently in beta (1.0.0b1). API signatures, types, and behaviors are subject to change without notice in future releases, potentially leading to breaking changes.fixUse with caution in production environments. Pin to specific beta versions and test thoroughly before upgrading. Monitor release notes for breaking changes.
affects: All beta versions (1.x.x.bX)
gotchaThe primary client for managing resource deployments, `ResourceManagementClient`, is imported from `azure.mgmt.resource`, not directly from `azure-mgmt-resource-deployments`. This package acts as a meta-package providing specific deployment operations within the broader resource management client.fixAlways import `ResourceManagementClient` as `from azure.mgmt.resource import ResourceManagementClient`.
affects: All versions
gotchaAzure SDKs often provide both synchronous and asynchronous clients. The `ResourceManagementClient` (default) is synchronous. For asynchronous operations, you would typically need to import `ResourceManagementClient` from `azure.mgmt.resource.aio` and use an `async` context.fixDecide whether to use synchronous or asynchronous programming. For async, use `from azure.mgmt.resource.aio import ResourceManagementClient` and handle `await` calls correctly.
affects: All versions
gotchaAuthentication with Azure services requires setting up credentials correctly. Common issues include missing environment variables (`AZURE_SUBSCRIPTION_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, `AZURE_CLIENT_SECRET`) or not being logged in via `az login` for `DefaultAzureCredential` to work.fixEnsure `azure-identity` is installed and environment variables required by `DefaultAzureCredential` are set, or ensure `az login` has been executed for CLI-based authentication.
affects: All versions
Upgrade
Version history
1.0.0latest on PyPI · released Jul 20, 2026
Audit
Dependencies
azure-mgmt-resourcerequiredThis library is a meta-package that depends on `azure-mgmt-resource`, which provides the core `ResourceManagementClient` for deployment operations.
azure-identityrequiredRequired for authentication with Azure services (e.g., DefaultAzureCredential).