DeploymentsOperations Class

Warning

DO NOT instantiate this class directly.

Instead, you should access the following operations through

ResourceManagementClient's

<xref:deployments> attribute.

Inheritance
builtins.object
DeploymentsOperations

Constructor

DeploymentsOperations(*args, **kwargs)

Methods

begin_create_or_update

Deploys resources to a resource group.

You can provide the template and parameters directly in the request or link to JSON files.

begin_delete

Deletes a deployment from the deployment history.

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the associated deployment operations. Deleting a template deployment does not affect the state of the resource group. This is an asynchronous operation that returns a status of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used to obtain the status of the process. While the process is running, a call to the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, the URI in the Location header returns an error-level status code.

calculate_template_hash

Calculate the hash of the given template.

cancel

Cancels a currently running template deployment.

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running template deployment and leaves the resource group partially deployed.

check_existence

Checks whether the deployment exists.

export_template

Exports the template used for specified deployment.

get

Gets a deployment.

list_by_resource_group

Get all the deployments for a resource group.

validate

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

begin_create_or_update

Deploys resources to a resource group.

You can provide the template and parameters directly in the request or link to JSON files.

async begin_create_or_update(resource_group_name: str, deployment_name: str, parameters: _models.Deployment, *, content_type: str = 'application/json', **kwargs: Any) -> AsyncLROPoller[_models.DeploymentExtended]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group to deploy the resources to. The name is case insensitive. The resource group must already exist. Required.

deployment_name
Required
str

The name of the deployment. Required.

parameters
Required

Additional parameters supplied to the operation. Is either a Deployment type or a IO[bytes] type. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either DeploymentExtended or the result of cls(response)

Exceptions

Type Description

begin_delete

Deletes a deployment from the deployment history.

A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the associated deployment operations. Deleting a template deployment does not affect the state of the resource group. This is an asynchronous operation that returns a status of 202 until the template deployment is successfully deleted. The Location response header contains the URI that is used to obtain the status of the process. While the process is running, a call to the URI in the Location header returns a status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If the asynchronous request failed, the URI in the Location header returns an error-level status code.

async begin_delete(resource_group_name: str, deployment_name: str, **kwargs: Any) -> AsyncLROPoller[None]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group with the deployment to delete. The name is case insensitive. Required.

deployment_name
Required
str

The name of the deployment to delete. Required.

Returns

Type Description

An instance of AsyncLROPoller that returns either None or the result of cls(response)

Exceptions

Type Description

calculate_template_hash

Calculate the hash of the given template.

async calculate_template_hash(template: MutableMapping[str, Any], **kwargs: Any) -> TemplateHashResult

Parameters

Name Description
template
Required
<xref:JSON>

The template provided to calculate hash. Required.

Returns

Type Description

TemplateHashResult or the result of cls(response)

Exceptions

Type Description

cancel

Cancels a currently running template deployment.

You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running template deployment and leaves the resource group partially deployed.

async cancel(resource_group_name: str, deployment_name: str, **kwargs: Any) -> None

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

deployment_name
Required
str

The name of the deployment to cancel. Required.

Returns

Type Description

None or the result of cls(response)

Exceptions

Type Description

check_existence

Checks whether the deployment exists.

async check_existence(resource_group_name: str, deployment_name: str, **kwargs: Any) -> bool

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group with the deployment to check. The name is case insensitive. Required.

deployment_name
Required
str

The name of the deployment to check. Required.

Returns

Type Description

bool or the result of cls(response)

Exceptions

Type Description

export_template

Exports the template used for specified deployment.

async export_template(resource_group_name: str, deployment_name: str, **kwargs: Any) -> DeploymentExportResult

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

deployment_name
Required
str

The name of the deployment from which to get the template. Required.

Returns

Type Description

DeploymentExportResult or the result of cls(response)

Exceptions

Type Description

get

Gets a deployment.

async get(resource_group_name: str, deployment_name: str, **kwargs: Any) -> DeploymentExtended

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group. The name is case insensitive. Required.

deployment_name
Required
str

The name of the deployment to get. Required.

Returns

Type Description

DeploymentExtended or the result of cls(response)

Exceptions

Type Description

list_by_resource_group

Get all the deployments for a resource group.

list_by_resource_group(resource_group_name: str, filter: str | None = None, top: int | None = None, **kwargs: Any) -> AsyncIterable[DeploymentExtended]

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group with the deployments to get. The name is case insensitive. Required.

filter
Required
str

The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. Default value is None.

top
Required
int

The number of results to get. If null is passed, returns all deployments. Default value is None.

Returns

Type Description

An iterator like instance of either DeploymentExtended or the result of cls(response)

Exceptions

Type Description

validate

Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..

async validate(resource_group_name: str, deployment_name: str, parameters: _models.Deployment, *, content_type: str = 'application/json', **kwargs: Any) -> _models.DeploymentValidateResult

Parameters

Name Description
resource_group_name
Required
str

The name of the resource group the template will be deployed to. The name is case insensitive. Required.

deployment_name
Required
str

The name of the deployment. Required.

parameters
Required

Parameters to validate. Is either a Deployment type or a IO[bytes] type. Required.

Returns

Type Description

DeploymentValidateResult or the result of cls(response)

Exceptions

Type Description

Attributes

models

models = <module 'azure.mgmt.resource.resources.v2018_02_01.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.11.9\\x64\\Lib\\site-packages\\azure\\mgmt\\resource\\resources\\v2018_02_01\\models\\__init__.py'>