Skip to main content

deployments

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

Overview

Namedeployments
TypeResource
Idazure.resource.deployments

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
correlationIdstringThe correlation ID of the deployment.
debugSettingobjectThe debug setting of the deployment.
dependenciesarrayThe list of deployment dependencies.
diagnosticsarrayContains diagnostic information collected during validation process.
durationstringThe duration of the template deployment.
errorobjectThe deployment error.
extensionsarrayThe extensions used in this deployment.
locationstringthe location of the deployment.
modestringThe deployment mode. Possible values are Incremental and Complete. Known values are: "Incremental" and "Complete". (Incremental, Complete)
onErrorDeploymentobjectThe deployment on error behavior.
outputResourcesarrayArray of provisioned resources.
outputsobjectKey/value pairs that represent deployment output.
parametersobjectDeployment parameters.
parametersLinkobjectThe URI referencing the parameters.
providersarrayThe list of resource providers needed for the deployment.
provisioningStatestringDenotes the state of provisioning. Known values are: "NotSpecified", "Accepted", "Running", "Ready", "Creating", "Created", "Deleting", "Deleted", "Canceled", "Failed", "Succeeded", and "Updating". (NotSpecified, Accepted, Running, Ready, Creating, Created, Deleting, Deleted, Canceled, Failed, Succeeded, Updating)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tagsobjectDeployment tags.
templateHashstringThe hash produced for the template.
templateLinkobjectThe URI referencing the template.
timestampstring (date-time)The timestamp of the template deployment.
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".
validatedResourcesarrayArray of validated resources.
validationLevelstringThe validation level of the deployment. Known values are: "Template", "Provider", and "ProviderNoRbac". (Template, Provider, ProviderNoRbac)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectresource_group_name, deployment_name, subscription_idGets a deployment.
list_by_resource_groupselectresource_group_name, subscription_id$filter, $topGet all the deployments for a resource group.
get_at_scopeselectscope, deployment_nameGets a deployment.
get_at_management_group_scopeselectgroup_id, deployment_nameGets a deployment.
get_at_subscription_scopeselectdeployment_name, subscription_idGets a deployment.
list_at_scopeselectscope$filter, $topGet all the deployments at the given scope.
list_at_management_group_scopeselectgroup_id$filter, $topGet all the deployments for a management group.
list_at_subscription_scopeselectsubscription_id$filter, $topGet all the deployments for a subscription.
get_at_tenant_scopeselectdeployment_nameGets a deployment.
list_at_tenant_scopeselect$filter, $topGet all the deployments at the tenant scope.
create_or_updateinsertresource_group_name, deployment_name, subscription_id, propertiesDeploys resources to a resource group. You can provide the template and parameters directly in the request or link to JSON files.
create_or_update_at_management_group_scopeinsertgroup_id, deployment_name, location, propertiesDeploys resources at management group scope. You can provide the template and parameters directly in the request or link to JSON files.
create_or_update_at_scopeinsertscope, deployment_name, propertiesDeploys resources at a given scope. You can provide the template and parameters directly in the request or link to JSON files.
create_or_update_at_tenant_scopeinsertdeployment_name, location, propertiesDeploys resources at tenant scope. You can provide the template and parameters directly in the request or link to JSON files.
create_or_update_at_subscription_scopeinsertdeployment_name, subscription_id, propertiesDeploys resources at subscription scope. You can provide the template and parameters directly in the request or link to JSON files.
create_or_updatereplaceresource_group_name, deployment_name, subscription_id, propertiesDeploys resources to a resource group. You can provide the template and parameters directly in the request or link to JSON files.
create_or_update_at_management_group_scopereplacegroup_id, deployment_name, location, propertiesDeploys resources at management group scope. You can provide the template and parameters directly in the request or link to JSON files.
create_or_update_at_scopereplacescope, deployment_name, propertiesDeploys resources at a given scope. You can provide the template and parameters directly in the request or link to JSON files.
create_or_update_at_tenant_scopereplacedeployment_name, location, propertiesDeploys resources at tenant scope. You can provide the template and parameters directly in the request or link to JSON files.
create_or_update_at_subscription_scopereplacedeployment_name, subscription_id, propertiesDeploys resources at subscription scope. You can provide the template and parameters directly in the request or link to JSON files.
deletedeleteresource_group_name, deployment_name, subscription_idDeletes 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.
delete_at_scopedeletescope, deployment_nameDeletes 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. 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_at_management_group_scopedeletegroup_id, deployment_nameDeletes 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. 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_at_subscription_scopedeletedeployment_name, subscription_idDeletes 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. 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_at_tenant_scopedeletedeployment_nameDeletes 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. 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.
check_existenceexecresource_group_name, deployment_name, subscription_idChecks whether the deployment exists.
check_existence_at_scopeexecscope, deployment_nameChecks whether the deployment exists.
check_existence_at_tenant_scopeexecdeployment_nameChecks whether the deployment exists.
check_existence_at_management_group_scopeexecgroup_id, deployment_nameChecks whether the deployment exists.
check_existence_at_subscription_scopeexecdeployment_name, subscription_idChecks whether the deployment exists.
cancel_at_scopeexecscope, deployment_nameCancels 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 resources partially deployed.
validate_at_scopeexecscope, deployment_name, propertiesValidates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
export_template_at_scopeexecscope, deployment_nameExports the template used for specified deployment.
cancel_at_tenant_scopeexecdeployment_nameCancels 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 resources partially deployed.
validate_at_tenant_scopeexecdeployment_name, location, propertiesValidates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
what_if_at_tenant_scopeexecdeployment_name, location, propertiesReturns changes that will be made by the deployment if executed at the scope of the tenant group.
export_template_at_tenant_scopeexecdeployment_nameExports the template used for specified deployment.
cancel_at_management_group_scopeexecgroup_id, deployment_nameCancels 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 resources partially deployed.
validate_at_management_group_scopeexecgroup_id, deployment_name, location, propertiesValidates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
what_if_at_management_group_scopeexecgroup_id, deployment_name, location, propertiesReturns changes that will be made by the deployment if executed at the scope of the management group.
export_template_at_management_group_scopeexecgroup_id, deployment_nameExports the template used for specified deployment.
cancel_at_subscription_scopeexecdeployment_name, subscription_idCancels 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 resources partially deployed.
validate_at_subscription_scopeexecdeployment_name, subscription_id, propertiesValidates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
what_if_at_subscription_scopeexecdeployment_name, subscription_id, propertiesReturns changes that will be made by the deployment if executed at the scope of the subscription.
export_template_at_subscription_scopeexecdeployment_name, subscription_idExports the template used for specified deployment.
cancelexecresource_group_name, deployment_name, subscription_idCancels 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.
validateexecresource_group_name, deployment_name, subscription_id, propertiesValidates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
what_ifexecresource_group_name, deployment_name, subscription_id, propertiesReturns changes that will be made by the deployment if executed at the scope of the resource group.
export_templateexecresource_group_name, deployment_name, subscription_idExports 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
deployment_namestringThe name of the deployment. Required.
group_idstringThe management group ID. Required.
resource_group_namestringThe name of the resource group. Required.
scopestringThe fully qualified Azure Resource manager identifier of the resource. Required.
subscription_idstring
$filterstringThe filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. Default value is None.
$topintegerThe number of results to get. If null is passed, returns all deployments. Default value is None.

SELECT examples

Gets a deployment.

SELECT
id,
name,
correlationId,
debugSetting,
dependencies,
diagnostics,
duration,
error,
extensions,
location,
mode,
onErrorDeployment,
outputResources,
outputs,
parameters,
parametersLink,
providers,
provisioningState,
systemData,
tags,
templateHash,
templateLink,
timestamp,
type,
validatedResources,
validationLevel
FROM azure.resource.deployments
WHERE resource_group_name = '{{ resource_group_name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND subscription_id = '{{ subscription_id }}' -- required
;

INSERT examples

Deploys resources to a resource group. You can provide the template and parameters directly in the request or link to JSON files.

INSERT INTO azure.resource.deployments (
location,
properties,
tags,
identity,
resource_group_name,
deployment_name,
subscription_id
)
SELECT
'{{ location }}',
'{{ properties }}' /* required */,
'{{ tags }}',
'{{ identity }}',
'{{ resource_group_name }}',
'{{ deployment_name }}',
'{{ subscription_id }}'
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type
;

REPLACE examples

Deploys resources to a resource group. You can provide the template and parameters directly in the request or link to JSON files.

REPLACE azure.resource.deployments
SET
location = '{{ location }}',
properties = '{{ properties }}',
tags = '{{ tags }}',
identity = '{{ identity }}'
WHERE
resource_group_name = '{{ resource_group_name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
AND properties = '{{ properties }}' --required
RETURNING
id,
name,
location,
properties,
systemData,
tags,
type;

DELETE examples

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.

DELETE FROM azure.resource.deployments
WHERE resource_group_name = '{{ resource_group_name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND subscription_id = '{{ subscription_id }}' --required
;

Lifecycle Methods

Checks whether the deployment exists.

EXEC azure.resource.deployments.check_existence 
@resource_group_name='{{ resource_group_name }}' --required,
@deployment_name='{{ deployment_name }}' --required,
@subscription_id='{{ subscription_id }}' --required
;