deployments
Creates, updates, deletes, gets or lists a deployments
resource.
Overview
Name | deployments |
Type | Resource |
Id | azure.resources.deployments |
Fields
The following fields are returned by SELECT
queries:
- get
- list_by_resource_group
OK - Returns information about the deployment, including provisioning status.
Name | Datatype | Description |
---|---|---|
id | string | The ID of the deployment. |
name | string | The name of the deployment. |
location | string | the location of the deployment. |
properties | object | Deployment properties. |
tags | object | Deployment tags |
type | string | The type of the deployment. |
OK - Returns an array of deployments.
Name | Datatype | Description |
---|---|---|
id | string | The ID of the deployment. |
name | string | The name of the deployment. |
location | string | the location of the deployment. |
properties | object | Deployment properties. |
tags | object | Deployment tags |
type | string | The type of the deployment. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | resourceGroupName , deploymentName , subscriptionId | Gets a deployment. | |
list_by_resource_group | select | resourceGroupName , subscriptionId | $filter , $top | Get all the deployments for a resource group. |
create_or_update | insert | resourceGroupName , deploymentName , subscriptionId , data__properties | You can provide the template and parameters directly in the request or link to JSON files. | |
delete | delete | resourceGroupName , deploymentName , subscriptionId | 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. | |
cancel_at_scope | exec | scope , deploymentName | 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_scope | exec | scope , deploymentName , properties | Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.. | |
export_template_at_scope | exec | scope , deploymentName | Exports the template used for specified deployment. | |
cancel_at_tenant_scope | exec | deploymentName | 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_scope | exec | deploymentName , location , properties | Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.. | |
what_if_at_tenant_scope | exec | deploymentName , location , properties | Returns changes that will be made by the deployment if executed at the scope of the tenant group. | |
export_template_at_tenant_scope | exec | deploymentName | Exports the template used for specified deployment. | |
cancel_at_management_group_scope | exec | groupId , deploymentName | 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_scope | exec | groupId , deploymentName , location , properties | Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.. | |
what_if_at_management_group_scope | exec | groupId , deploymentName , location , properties | Returns changes that will be made by the deployment if executed at the scope of the management group. | |
export_template_at_management_group_scope | exec | groupId , deploymentName | Exports the template used for specified deployment. | |
cancel_at_subscription_scope | exec | deploymentName , subscriptionId | 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_scope | exec | deploymentName , subscriptionId , properties | Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.. | |
what_if_at_subscription_scope | exec | deploymentName , subscriptionId , properties | Returns changes that will be made by the deployment if executed at the scope of the subscription. | |
export_template_at_subscription_scope | exec | deploymentName , subscriptionId | Exports the template used for specified deployment. | |
cancel | exec | resourceGroupName , deploymentName , subscriptionId | 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. | |
validate | exec | resourceGroupName , deploymentName , subscriptionId , properties | Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager.. | |
what_if | exec | resourceGroupName , deploymentName , subscriptionId , properties | Returns changes that will be made by the deployment if executed at the scope of the resource group. | |
export_template | exec | resourceGroupName , deploymentName , subscriptionId | Exports the template used for specified deployment. | |
calculate_template_hash | exec | Calculate 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.
Name | Datatype | Description |
---|---|---|
deploymentName | string | The name of the deployment. |
groupId | string | The management group ID. |
resourceGroupName | string | The name of the resource group. The name is case insensitive. |
scope | string | The scope at which the operation is performed. |
subscriptionId | string (uuid) | The ID of the target subscription. The value must be an UUID. |
$filter | string | The filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'. |
$top | integer (int32) | The number of results to get. If null is passed, returns all deployments. |
SELECT
examples
- get
- list_by_resource_group
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
;
Get all the deployments for a resource group.
SELECT
id,
name,
location,
properties,
tags,
type
FROM azure.resources.deployments
WHERE resourceGroupName = '{{ resourceGroupName }}' -- required
AND subscriptionId = '{{ subscriptionId }}' -- required
AND $filter = '{{ $filter }}'
AND $top = '{{ $top }}'
;
INSERT
examples
- create_or_update
- Manifest
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
;
# Description fields are for documentation purposes
- name: deployments
props:
- name: resourceGroupName
value: string
description: Required parameter for the deployments resource.
- name: deploymentName
value: string
description: Required parameter for the deployments resource.
- name: subscriptionId
value: string (uuid)
description: Required parameter for the deployments resource.
- name: location
value: string
description: |
The location to store the deployment data.
- name: properties
value: object
description: |
The deployment properties.
- name: tags
value: object
description: |
Deployment tags
DELETE
examples
- delete
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
- cancel_at_scope
- validate_at_scope
- export_template_at_scope
- cancel_at_tenant_scope
- validate_at_tenant_scope
- what_if_at_tenant_scope
- export_template_at_tenant_scope
- cancel_at_management_group_scope
- validate_at_management_group_scope
- what_if_at_management_group_scope
- export_template_at_management_group_scope
- cancel_at_subscription_scope
- validate_at_subscription_scope
- what_if_at_subscription_scope
- export_template_at_subscription_scope
- cancel
- validate
- what_if
- export_template
- calculate_template_hash
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
;
Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
EXEC azure.resources.deployments.validate_at_scope
@scope='{{ scope }}' --required,
@deploymentName='{{ deploymentName }}' --required
@@json=
'{
"location": "{{ location }}",
"properties": "{{ properties }}",
"tags": "{{ tags }}"
}'
;
Exports the template used for specified deployment.
EXEC azure.resources.deployments.export_template_at_scope
@scope='{{ scope }}' --required,
@deploymentName='{{ deploymentName }}' --required
;
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_tenant_scope
@deploymentName='{{ deploymentName }}' --required
;
Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
EXEC azure.resources.deployments.validate_at_tenant_scope
@deploymentName='{{ deploymentName }}' --required
@@json=
'{
"location": "{{ location }}",
"properties": "{{ properties }}",
"tags": "{{ tags }}"
}'
;
Returns changes that will be made by the deployment if executed at the scope of the tenant group.
EXEC azure.resources.deployments.what_if_at_tenant_scope
@deploymentName='{{ deploymentName }}' --required
@@json=
'{
"location": "{{ location }}",
"properties": "{{ properties }}"
}'
;
Exports the template used for specified deployment.
EXEC azure.resources.deployments.export_template_at_tenant_scope
@deploymentName='{{ deploymentName }}' --required
;
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_management_group_scope
@groupId='{{ groupId }}' --required,
@deploymentName='{{ deploymentName }}' --required
;
Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
EXEC azure.resources.deployments.validate_at_management_group_scope
@groupId='{{ groupId }}' --required,
@deploymentName='{{ deploymentName }}' --required
@@json=
'{
"location": "{{ location }}",
"properties": "{{ properties }}",
"tags": "{{ tags }}"
}'
;
Returns changes that will be made by the deployment if executed at the scope of the management group.
EXEC azure.resources.deployments.what_if_at_management_group_scope
@groupId='{{ groupId }}' --required,
@deploymentName='{{ deploymentName }}' --required
@@json=
'{
"location": "{{ location }}",
"properties": "{{ properties }}"
}'
;
Exports the template used for specified deployment.
EXEC azure.resources.deployments.export_template_at_management_group_scope
@groupId='{{ groupId }}' --required,
@deploymentName='{{ deploymentName }}' --required
;
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_subscription_scope
@deploymentName='{{ deploymentName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;
Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
EXEC azure.resources.deployments.validate_at_subscription_scope
@deploymentName='{{ deploymentName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"location": "{{ location }}",
"properties": "{{ properties }}",
"tags": "{{ tags }}"
}'
;
Returns changes that will be made by the deployment if executed at the scope of the subscription.
EXEC azure.resources.deployments.what_if_at_subscription_scope
@deploymentName='{{ deploymentName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"location": "{{ location }}",
"properties": "{{ properties }}"
}'
;
Exports the template used for specified deployment.
EXEC azure.resources.deployments.export_template_at_subscription_scope
@deploymentName='{{ deploymentName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;
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.
EXEC azure.resources.deployments.cancel
@resourceGroupName='{{ resourceGroupName }}' --required,
@deploymentName='{{ deploymentName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;
Validates whether the specified template is syntactically correct and will be accepted by Azure Resource Manager..
EXEC azure.resources.deployments.validate
@resourceGroupName='{{ resourceGroupName }}' --required,
@deploymentName='{{ deploymentName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"location": "{{ location }}",
"properties": "{{ properties }}",
"tags": "{{ tags }}"
}'
;
Returns changes that will be made by the deployment if executed at the scope of the resource group.
EXEC azure.resources.deployments.what_if
@resourceGroupName='{{ resourceGroupName }}' --required,
@deploymentName='{{ deploymentName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
@@json=
'{
"location": "{{ location }}",
"properties": "{{ properties }}"
}'
;
Exports the template used for specified deployment.
EXEC azure.resources.deployments.export_template
@resourceGroupName='{{ resourceGroupName }}' --required,
@deploymentName='{{ deploymentName }}' --required,
@subscriptionId='{{ subscriptionId }}' --required
;
Calculate the hash of the given template.
EXEC azure.resources.deployments.calculate_template_hash
;