{"id":5581,"library":"azure-mgmt-resource-deploymentscripts","title":"Microsoft Azure Resource Deploymentscripts Management Client Library for Python","description":"This is the Microsoft Azure Resource Deploymentscripts Management Client Library for Python. It provides capabilities to manage deployment scripts within Azure Resource Manager (ARM) templates, allowing for custom steps like adding users, performing data plane operations, or creating self-signed certificates during deployments. The current version is 1.0.0b1, indicating a beta release. Azure SDK for Python packages, including beta releases, are published to PyPI regularly, reflecting active development.","status":"active","version":"1.0.0b1","language":"python","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python","tags":["azure","management","resource","deploymentscripts","sdk","arm"],"install":[{"cmd":"pip install azure-mgmt-resource-deploymentscripts","lang":"bash","label":"Install core package"},{"cmd":"pip install azure-identity","lang":"bash","label":"Install Azure Identity for authentication"}],"dependencies":[{"reason":"Required for Azure Active Directory token authentication.","package":"azure-identity","optional":false},{"reason":"Requires Python 3.9 or later.","package":"python","optional":false}],"imports":[{"symbol":"DeploymentScriptsClient","correct":"from azure.mgmt.resource.deploymentscripts import DeploymentScriptsClient"},{"symbol":"DefaultAzureCredential","correct":"from azure.identity import DefaultAzureCredential"}],"quickstart":{"code":"import os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.mgmt.resource.deploymentscripts import DeploymentScriptsClient\n\n# Set environment variables for authentication and subscription ID:\n# AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET\n# AZURE_SUBSCRIPTION_ID\n# For local development, `DefaultAzureCredential` can often pick up credentials from `az login`.\n\nsubscription_id = os.environ.get(\"AZURE_SUBSCRIPTION_ID\", \"YOUR_SUBSCRIPTION_ID\")\n\nif subscription_id == \"YOUR_SUBSCRIPTION_ID\":\n    print(\"WARNING: Please set the AZURE_SUBSCRIPTION_ID environment variable for a functional example.\")\n\ntry:\n    credential = DefaultAzureCredential()\n    client = DeploymentScriptsClient(credential=credential, subscription_id=subscription_id)\n\n    print(f\"DeploymentScriptsClient initialized successfully for subscription: {subscription_id}\")\n\n    # Example: List deployment scripts (uncomment to run)\n    # print(\"Listing deployment scripts...\")\n    # for script in client.deployment_scripts.list_by_subscription():\n    #     print(f\"- Script Name: {script.name}, Resource Group: {script.id.split('/')[4]}\")\n\n    # To create, update, or delete deployment scripts, refer to the official Azure SDK samples\n    # for detailed usage of `client.deployment_scripts.begin_create_or_update` or other operations.\n\nexcept Exception as e:\n    print(f\"An error occurred during client initialization or operation: {e}\")\n    print(\"Please ensure you are authenticated to Azure (e.g., `az login`) and AZURE_SUBSCRIPTION_ID is set.\")","lang":"python","description":"This quickstart demonstrates how to initialize the `DeploymentScriptsClient` using `DefaultAzureCredential` for authentication. It requires the `AZURE_SUBSCRIPTION_ID` environment variable to be set, along with other Azure Active Directory environment variables for `DefaultAzureCredential` to function correctly (e.g., `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`). For local development, `az login` can often provide the necessary credentials. The example includes a placeholder for listing deployment scripts."},"warnings":[{"fix":"Review release notes for each new beta version and anticipate potential API changes. Pin the package version to avoid unexpected updates.","message":"This package is currently in a beta state (version 1.0.0b1). This means the API surface might change in future releases, potentially introducing breaking changes before a stable 1.0.0 release.","severity":"gotcha","affected_versions":"1.0.0b1 and earlier beta versions"},{"fix":"Monitor resource groups where deployment scripts run. Manually verify and clean up any lingering 'azscripts' prefixed storage accounts or container instances if automatic cleanup fails.","message":"Deployment scripts create supporting resources (a storage account and a container instance) for execution and troubleshooting. While these are usually cleaned up automatically, charges may be incurred if they are not removed successfully after the script finishes.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure that the deployment script resource in your ARM template specifies an appropriate user-assigned managed identity, especially if the script needs to interact with Azure resources. Verify the API version being used in the template (`apiVersion`).","message":"For Azure Resource Manager (ARM) template deployment scripts, an identity is crucial. For API version 2019-10-01-preview, a managed identity is *required*. For API version 2020-10-01 or later, it is optional unless the script performs Azure-specific actions requiring authentication. Currently, only user-assigned managed identities are supported.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Chain PowerShell or CLI commands into a single line using semicolons (` ; `), `\\r\\n`, or `\\n`. Alternatively, store the script in an external file (e.g., on GitHub or in a storage account) and reference it using the `primaryScriptUri` property in your ARM template.","message":"When embedding multi-line scripts directly into an ARM template using the `scriptContent` property, the Azure portal and Azure DevOps pipelines may fail to parse them.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If your application relies on a specific, non-latest API-Version, it is recommended to pin the package version. Always review release notes for stable (`1.0.0` and above) versions for API-Version targeting changes.","message":"Other `azure-mgmt-resource-*` packages have moved to only target the latest API-Version available, removing older API versions. While not explicitly stated for `azure-mgmt-resource-deploymentscripts`, this is a common breaking change pattern across the Azure SDK for Python management libraries that could affect this package in the future.","severity":"breaking","affected_versions":"Potentially future stable versions (e.g., 1.0.0)"}],"env_vars":null,"search_vec":"'1.0.0':58 'activ':78 'ad':40 'allow':35 'arm':33,85 'azur':2,14,30,64,80 'b1':59 'beta':62,70 'capabl':24 'certif':51 'client':6,18 'creat':47 'current':55 'custom':37 'data':43 'deploy':27,53 'deploymentscript':4,16,83 'develop':79 'includ':69 'indic':60 'librari':7,19 'like':39 'manag':5,17,26,32,81 'microsoft':1,13 'oper':45 'packag':68 'perform':42 'plane':44 'provid':23 'publish':73 'pypi':75 'python':9,21,67 'reflect':77 'regular':76 'releas':63,71 'resourc':3,15,31,82 'script':28 'sdk':65,84 'self':49 'self-sign':48 'sign':50 'step':38 'templat':34 'user':41 'version':56 'within':29","created_at":"2026-04-14T03:34:51.752306+00:00","updated_at":"2026-04-15T23:07:55.815528+00:00","problems":[{"fix":"Ensure the package is correctly installed using pip: `pip install azure-mgmt-resource-deploymentscripts==1.0.0b1` or `pip install azure-mgmt-resource-deploymentscripts` for the latest beta.","cause":"The `azure-mgmt-resource-deploymentscripts` package or one of its dependencies is not installed, or there's an issue with the Python environment's path.","error":"ModuleNotFoundError: No module named 'azure.mgmt.resource.deploymentscripts'"},{"fix":"Verify that the Azure service principal or managed identity used for authentication has appropriate roles (e.g., Contributor or a custom role with specific permissions for deployment scripts, storage accounts, and container instances) in the relevant subscription and resource group. Check tenant ID and ensure the account belongs to the correct tenant.","cause":"The credentials provided to authenticate with Azure lack the necessary permissions to perform the requested deployment script operations, or there's an issue with the authentication token.","error":"AuthenticationFailed"},{"fix":"Manually delete the orphaned storage account and its associated resources, or modify the deployment script (e.g., by changing the resource ID or adding a `forceUpdateTag` property in ARM templates) to force the creation of a new, uniquely named storage account.","cause":"An Azure Deployment Script automatically creates a storage account and a container instance to execute the script. This error occurs when a previously created storage account with the same generated name was not cleaned up successfully, and a new deployment attempt tries to reuse the taken name.","error":"The storage account named <storage-account-name> is already taken."},{"fix":"Review the official `azure-mgmt-resource-deploymentscripts` documentation or SDK examples for version `1.0.0b1` to find the correct import path and class name for the client (e.g., `from azure.mgmt.resource.deploymentscripts import DeploymentScriptsClient` or checking for a client within a `_client` submodule).","cause":"The main client class or an expected attribute/method is either misspelled, located in a different submodule, or its name has changed, which is common in beta releases of libraries.","error":"AttributeError: module 'azure.mgmt.resource.deploymentscripts' has no attribute 'DeploymentScriptsClient'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.0.0b1","cli_name":"","cli_version":null,"type":"library","homepage":"https://azure.microsoft.com","github":"https://github.com/Azure/azure-sdk-for-python","docs":null,"changelog":null,"pypi":"https://pypi.org/project/azure-mgmt-resource-deploymentscripts/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["azure"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-30","next_check":"2026-07-28","install_tag":null}}