Skip to main content

deployments

Creates, updates, deletes, gets or lists a deployments resource.

Overview

Namedeployments
TypeResource
Idazure.resources.deployments

Fields

The following fields are returned by SELECT queries:

OK - Returns information about the deployment, including provisioning status.

NameDatatypeDescription
idstringThe ID of the deployment.
namestringThe name of the deployment.
locationstringthe location of the deployment.
propertiesobjectDeployment properties.
tagsobjectDeployment tags
typestringThe type of the deployment.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresourceGroupName, deploymentName, subscriptionIdGets a deployment.
list_by_resource_groupselectresourceGroupName, subscriptionId$filter, $topGet all the deployments for a resource group.
create_or_updateinsertresourceGroupName, deploymentName, subscriptionId, data__propertiesYou can provide the template and parameters directly in the request or link to JSON files.
deletedeleteresourceGroupName, deploymentName, subscriptionIdA 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.
cancel_at_scopeexecscope, deploymentNameYou 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 resources partially deployed.
validate_at_scopeexecscope, deploymentName, propertiesValidates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
export_template_at_scopeexecscope, deploymentNameExports the template used for specified deployment.
cancel_at_tenant_scopeexecdeploymentNameYou 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 resources partially deployed.
validate_at_tenant_scopeexecdeploymentName, location, propertiesValidates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
what_if_at_tenant_scopeexecdeploymentName, location, propertiesReturns changes that will be made by the deployment if executed at the scope of the tenant group.
export_template_at_tenant_scopeexecdeploymentNameExports the template used for specified deployment.
cancel_at_management_group_scopeexecgroupId, deploymentNameYou 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 resources partially deployed.
validate_at_management_group_scopeexecgroupId, deploymentName, location, propertiesValidates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
what_if_at_management_group_scopeexecgroupId, deploymentName, location, propertiesReturns changes that will be made by the deployment if executed at the scope of the management group.
export_template_at_management_group_scopeexecgroupId, deploymentNameExports the template used for specified deployment.
cancel_at_subscription_scopeexecdeploymentName, subscriptionIdYou 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 resources partially deployed.
validate_at_subscription_scopeexecdeploymentName, subscriptionId, propertiesValidates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
what_if_at_subscription_scopeexecdeploymentName, subscriptionId, propertiesReturns changes that will be made by the deployment if executed at the scope of the subscription.
export_template_at_subscription_scopeexecdeploymentName, subscriptionIdExports the template used for specified deployment.
cancelexecresourceGroupName, deploymentName, subscriptionIdYou 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.
validateexecresourceGroupName, deploymentName, subscriptionId, propertiesValidates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
what_ifexecresourceGroupName, deploymentName, subscriptionId, propertiesReturns changes that will be made by the deployment if executed at the scope of the resource group.
export_templateexecresourceGroupName, deploymentName, subscriptionIdExports the template used for specified deployment.
calculate_template_hashexecCalculate the hash of the given template.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
deploymentNamestringThe name of the deployment.
groupIdstringThe management group ID.
resourceGroupNamestringThe name of the resource group. The name is case insensitive.
scopestringThe scope at which the operation is performed.
subscriptionIdstring (uuid)The ID of the target subscription. The value must be an UUID.
$filterstringThe filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'.
$topinteger (int32)The number of results to get. If null is passed, returns all deployments.

SELECT examples

Gets a deployment.

SELECT
id,
name,
location,
properties,
tags,
type
FROM azure.resources.deployments
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND deploymentName = '{{ deploymentName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
;

INSERT examples

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

INSERT INTO azure.resources.deployments (
data__location,
data__properties,
data__tags,
resourceGroupName,
deploymentName,
subscriptionId
)
SELECT
'{{ location }}',
'{{ properties }}' /* required */,
'{{ tags }}',
'{{ resourceGroupName }}',
'{{ deploymentName }}',
'{{ subscriptionId }}'
RETURNING
id,
name,
location,
properties,
tags,
type
;

DELETE examples

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.

DELETE FROM azure.resources.deployments
WHERE resourceGroupName = '{{ resourceGroupName }}' --required
AND deploymentName = '{{ deploymentName }}' --required
AND subscriptionId = '{{ subscriptionId }}' --required
;

Lifecycle Methods

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 resources partially deployed.

EXEC azure.resources.deployments.cancel_at_scope 
@scope='{{ scope }}' --required,
@deploymentName='{{ deploymentName }}' --required
;