Registry / azure / azure-mgmt-resource-deployments

azure-mgmt-resource-deployments

JSON →
library1.0.0pypypi✓ verified 24d ago

The Microsoft Azure Resource Deployments Management Client Library for Python (`azure-mgmt-resource-deployments`) provides functionality to manage Azure Resource Manager deployments. This library is currently in a beta release (1.0.0b1) and is part of the broader Azure SDK for Python, which typically follows a rapid release cadence for individual service libraries.

pip install azure-mgmt-resource-deployments azure-identity
INSTALL
IMPORT
SIG · AZURE-MGMT-RESOURC
A
azure-mgmt-resource-deployments
azurepythonv1.0.0
Install
3.7s avg
Import
Disk
44MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 44.6MB
glibc
py 3.103.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.
fix
Use 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.
fix
Always 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.
fix
Decide 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.
fix
Ensure `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).
Agent activity
38 hits · last 30 days
node
32
Amazon
1
OpenAI (training)
1
Resources
azure-mgmt-resource-deployments — pip install azure-mgmt-resource-deployments · libregistry