Deployment Stacks - Validate Stack At Subscription
Runs preflight validation on the Deployment stack template at the specified scope to verify its acceptance to Azure Resource Manager.
POST https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deploymentStacks/{deploymentStackName}/validate?api-version=2025-07-01
URI Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
|
deployment
|
path | True |
string minLength: 1maxLength: 90 pattern: ^[-\w\._\(\)]+$ |
Name of the deployment stack. |
|
subscription
|
path | True |
string (uuid) |
The ID of the target subscription. The value must be an UUID. |
|
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
| Name | Required | Type | Description |
|---|---|---|---|
| properties.actionOnUnmanage | True |
Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. |
|
| properties.denySettings | True |
Defines how resources deployed by the stack are locked. |
|
| location |
string |
The geo-location where the resource lives. Required for subscription and management group scoped stacks. The location is inherited from the resource group for resource group scoped stacks. |
|
| properties.bypassStackOutOfSyncError |
boolean |
Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. |
|
| properties.debugSetting |
The debug setting of the deployment. |
||
| properties.deploymentScope |
string |
The scope at which the initial deployment should be created. If a scope is not specified, it will default to the scope of the deployment stack. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). |
|
| properties.description |
string maxLength: 4096 |
Deployment stack description. Max length of 4096 characters. |
|
| properties.extensionConfigs |
object |
The deployment extension configs. Keys of this object are extension aliases as defined in the deployment template. |
|
| properties.externalInputDefinitions |
<string,
Deployment |
External input definitions, used by external tooling to define expected external input values. |
|
| properties.externalInputs |
<string,
Deployment |
External input values, used by external tooling for parameter evaluation. |
|
| properties.parameters |
<string,
Deployment |
Name and value pairs that define the deployment parameters for the template. Use this element when providing the parameter values directly in the request, rather than linking to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. |
|
| properties.parametersLink |
The URI of parameters file. Use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. |
||
| properties.template |
management.azure.com.resources.deploymentstacks.validatestackatsubscription |
The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. |
|
| properties.templateLink |
The URI of the template. Use either the templateLink property or the template property, but not both. |
||
| properties.validationLevel |
The validation level of the deployment stack |
||
| tags |
object |
Resource tags. |
Responses
| Name | Type | Description |
|---|---|---|
| 200 OK |
Azure operation completed successfully. |
|
| 202 Accepted |
Resource operation accepted. Headers
|
|
| 400 Bad Request |
Resource validation failed. |
|
| Other Status Codes |
An unexpected error response. |
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
| Name | Description |
|---|---|
| user_impersonation | impersonate your user account |
Examples
Validate a subscription Deployment stack
Sample request
POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deploymentStacks/simpleDeploymentStack/validate?api-version=2025-07-01
{
"location": "eastus",
"tags": {
"tagkey": "tagVal"
},
"properties": {
"actionOnUnmanage": {
"resources": "delete",
"resourceGroups": "delete",
"managementGroups": "delete"
},
"denySettings": {
"mode": "denyDelete",
"excludedPrincipals": [
"principal"
],
"excludedActions": [
"action"
],
"applyToChildScopes": false
},
"templateLink": {
"uri": "https://example.com/exampleTemplate.json"
},
"parameters": {
"parameter1": {
"value": "a string"
}
}
}
}
Sample response
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Resources/deploymentStacks/simpleDeploymentStack",
"name": "simpleDeploymentStack",
"type": "Microsoft.Resources/deploymentStacks",
"properties": {
"correlationId": "00000000-0000-0000-0000-000000000000",
"denySettings": {
"mode": "denyDelete",
"excludedPrincipals": [
"principal"
],
"excludedActions": [
"action"
],
"applyToChildScopes": false
},
"deploymentScope": "/subscriptions/00000000-0000-0000-0000-000000000000",
"description": "A validation description.",
"parameters": {
"parameter1": {
"type": "string",
"value": "a string"
}
},
"validatedResources": [
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Authorization/roleAssignment/roleassignment1"
}
]
}
}
Location: https://example.com
Retry-After: 15
{
"error": {
"code": "ErrorCode",
"message": "Deployment validation failed"
}
}
Definitions
| Name | Description |
|---|---|
|
Action |
Defines the behavior of resources that are no longer managed after the stack is updated or deleted. |
|
created |
The type of identity that created the resource. |
|
Deny |
Defines how resources deployed by the Deployment stack are locked. |
|
Deny |
denySettings Mode that defines denied actions. |
|
Deny |
denyAssignment settings applied to the resource. |
|
Deployment |
Details about the usage of a deployment extension. |
|
Deployment |
The value or how to get a value for an extension config property. |
|
Deployment |
Deployment external input for parameterization. |
|
Deployment |
Deployment external input definition for parameterization. |
|
Deployment |
Deployment parameter for the template. |
|
Deployment |
Deployment stack object. |
|
Deployment |
State of the deployment stack. |
|
Deployment |
The debug setting. |
|
Deployment |
Entity representing the reference to the deployment parameters. |
|
Deployment |
Entity representing the reference to the template. |
|
Deployment |
The Deployment stack validation result details. |
|
Deployment |
The Deployment stack validation result. |
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
|
Key |
Azure Key Vault parameter reference. |
|
Key |
Azure Key Vault reference. |
|
Managed |
The managed resource model. |
|
Resource |
The resourceId model. |
|
Resource |
The resourceId extended model. This is used to document failed resources with a resourceId and a corresponding error. |
|
Resource |
Current management state of the resource in the deployment stack. |
|
Resources |
Specifies an action for resources that do not support deletion. |
|
system |
Metadata pertaining to creation and last modification of the resource. |
|
Unmanage |
Specifies an action for a newly unmanaged resource. |
|
Unmanage |
Specifies an action for a newly unmanaged resource group. |
|
Unmanage |
Specifies an action for a newly unmanaged resource. |
|
Validation |
The level of validation performed on the deployment. |
ActionOnUnmanage
Defines the behavior of resources that are no longer managed after the stack is updated or deleted.
| Name | Type | Description |
|---|---|---|
| managementGroups |
Specifies an action for a newly unmanaged resource management group. |
|
| resourceGroups |
Specifies an action for a newly unmanaged resource group. |
|
| resources |
Specifies an action for a newly unmanaged resource. |
|
| resourcesWithoutDeleteSupport |
Some resources do not support deletion. This flag will denote how the stack should handle those resources. |
createdByType
The type of identity that created the resource.
| Value | Description |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
DenySettings
Defines how resources deployed by the Deployment stack are locked.
| Name | Type | Description |
|---|---|---|
| applyToChildScopes |
boolean |
DenySettings will be applied to child resource scopes of every managed resource with a deny assignment. |
| excludedActions |
string[] |
List of role-based management operations that are excluded from the denySettings. Up to 200 actions are permitted. If the denySetting mode is set to 'denyWriteAndDelete', then the following actions are automatically appended to 'excludedActions': '*/read' and 'Microsoft.Authorization/locks/delete'. If the denySetting mode is set to 'denyDelete', then the following actions are automatically appended to 'excludedActions': 'Microsoft.Authorization/locks/delete'. Duplicate actions will be removed. |
| excludedPrincipals |
string[] |
List of AAD principal IDs excluded from the lock. Up to 5 principals are permitted. |
| mode |
denySettings Mode that defines denied actions. |
DenySettingsMode
denySettings Mode that defines denied actions.
| Value | Description |
|---|---|
| denyDelete |
Authorized users are able to read and modify the resources, but cannot delete. |
| denyWriteAndDelete |
Authorized users can read from a resource, but cannot modify or delete it. |
| none |
No denyAssignments have been applied. |
DenyStatusMode
denyAssignment settings applied to the resource.
| Value | Description |
|---|---|
| denyDelete |
Authorized users are able to read and modify the resources, but cannot delete. |
| notSupported |
Resource type does not support denyAssignments. |
| inapplicable |
denyAssignments are not supported on resources outside the scope of the deployment stack. |
| denyWriteAndDelete |
Authorized users can only read from a resource, but cannot modify or delete it. |
| removedBySystem |
Deny assignment has been removed by Azure due to a resource management change (management group move, etc.) |
| none |
No denyAssignments have been applied. |
| unknown |
The denyAssignment status is unknown. |
DeploymentExtension
Details about the usage of a deployment extension.
| Name | Type | Description |
|---|---|---|
| config |
<string,
Deployment |
The configuration used for deployment. The keys of this object should align with the extension config schema. |
| configId |
string |
The configuration ID of the extension usage. It uniquely identifies a target the extension deploys to. |
| name |
string |
The extension name. |
| version |
string |
The extension version. |
DeploymentExtensionConfigItem
The value or how to get a value for an extension config property.
| Name | Type | Description |
|---|---|---|
| keyVaultReference |
The key vault reference of the config item. |
|
| type |
string |
The type of the value. |
| value |
management.azure.com.resources.deploymentstacks.validatestackatsubscription |
The value of the config item. The type is determined by the extension config schema. |
DeploymentExternalInput
Deployment external input for parameterization.
| Name | Type | Description |
|---|---|---|
| value |
management.azure.com.resources.deploymentstacks.validatestackatsubscription |
External input value. |
DeploymentExternalInputDefinition
Deployment external input definition for parameterization.
| Name | Type | Description |
|---|---|---|
| config |
management.azure.com.resources.deploymentstacks.validatestackatsubscription |
Configuration for the external input. |
| kind |
string |
The kind of external input. |
DeploymentParameter
Deployment parameter for the template.
| Name | Type | Description |
|---|---|---|
| expression |
string |
Input expression to the parameter. |
| reference |
Azure Key Vault parameter reference. |
|
| type |
string |
Type of the value. |
| value |
management.azure.com.resources.deploymentstacks.validatestackatsubscription |
Input value to the parameter. |
DeploymentStack
Deployment stack object.
| Name | Type | Description |
|---|---|---|
| id |
string (arm-id) |
Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" |
| location |
string |
The geo-location where the resource lives. Required for subscription and management group scoped stacks. The location is inherited from the resource group for resource group scoped stacks. |
| name |
string |
The name of the resource |
| properties.actionOnUnmanage |
Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. |
|
| properties.bypassStackOutOfSyncError |
boolean |
Flag to bypass service errors that indicate the stack resource list is not correctly synchronized. |
| properties.correlationId |
string |
The correlation id of the last Deployment stack upsert or delete operation. It is in GUID format and is used for tracing. |
| properties.debugSetting |
The debug setting of the deployment. |
|
| properties.deletedResources |
An array of resources that were deleted during the most recent Deployment stack update. Deleted means that the resource was removed from the template and relevant deletion operations were specified. |
|
| properties.denySettings |
Defines how resources deployed by the stack are locked. |
|
| properties.deploymentExtensions |
The extensions used during deployment. Contains extension data for all extensible resources managed by the stack. |
|
| properties.deploymentId |
string |
The resourceId of the deployment resource created by the deployment stack. |
| properties.deploymentScope |
string |
The scope at which the initial deployment should be created. If a scope is not specified, it will default to the scope of the deployment stack. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroupId}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'). |
| properties.description |
string maxLength: 4096 |
Deployment stack description. Max length of 4096 characters. |
| properties.detachedResources |
An array of resources that were detached during the most recent Deployment stack update. Detached means that the resource was removed from the template, but no relevant deletion operations were specified. So, the resource still exists while no longer being associated with the stack. |
|
| properties.duration |
string |
The duration of the last successful Deployment stack update. |
| properties.error |
The error detail. |
|
| properties.extensionConfigs |
object |
The deployment extension configs. Keys of this object are extension aliases as defined in the deployment template. |
| properties.externalInputDefinitions |
<string,
Deployment |
External input definitions, used by external tooling to define expected external input values. |
| properties.externalInputs |
<string,
Deployment |
External input values, used by external tooling for parameter evaluation. |
| properties.failedResources |
An array of resources that failed to reach goal state during the most recent update. Each resourceId is accompanied by an error message. |
|
| properties.outputs |
management.azure.com.resources.deploymentstacks.validatestackatsubscription |
The outputs of the deployment resource created by the deployment stack. |
| properties.parameters |
<string,
Deployment |
Name and value pairs that define the deployment parameters for the template. Use this element when providing the parameter values directly in the request, rather than linking to an existing parameter file. Use either the parametersLink property or the parameters property, but not both. |
| properties.parametersLink |
The URI of parameters file. Use this element to link to an existing parameters file. Use either the parametersLink property or the parameters property, but not both. |
|
| properties.provisioningState |
State of the deployment stack. |
|
| properties.resources |
An array of resources currently managed by the deployment stack. |
|
| properties.template |
management.azure.com.resources.deploymentstacks.validatestackatsubscription |
The template content. You use this element when you want to pass the template syntax directly in the request rather than link to an existing template. It can be a JObject or well-formed JSON string. Use either the templateLink property or the template property, but not both. |
| properties.templateLink |
The URI of the template. Use either the templateLink property or the template property, but not both. |
|
| properties.validationLevel |
The validation level of the deployment stack |
|
| systemData |
Azure Resource Manager metadata containing createdBy and modifiedBy information. |
|
| tags |
object |
Resource tags. |
| type |
string |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
DeploymentStackProvisioningState
State of the deployment stack.
| Value | Description |
|---|---|
| creating |
The deployment stack is currently being created |
| validating |
The deployment stack is currently being validated |
| waiting |
The deployment stack is currently waiting |
| deploying |
The deployment stack is currently deploying |
| canceling |
The deployment stack is being cancelled |
| updatingDenyAssignments |
The deployment stack is updating deny assignments |
| deletingResources |
The deployment stack is deleting resources |
| succeeded |
The deployment stack completed successfully |
| failed |
The deployment stack has failed |
| canceled |
The deployment stack has been cancelled |
| deleting |
The deployment stack is being deleted |
| initializing |
The deployment stack is currently being initialized |
| running |
The deployment stack is currently performing an operation |
DeploymentStacksDebugSetting
The debug setting.
| Name | Type | Description |
|---|---|---|
| detailLevel |
string |
Specifies the type of information to log for debugging. The permitted values are none, requestContent, responseContent, or both requestContent and responseContent separated by a comma. The default is none. When setting this value, carefully consider the type of information that is being passed in during deployment. By logging information about the request or response, sensitive data that is retrieved through the deployment operations could potentially be exposed. |
DeploymentStacksParametersLink
Entity representing the reference to the deployment parameters.
| Name | Type | Description |
|---|---|---|
| contentVersion |
string |
If included, must match the ContentVersion in the template. |
| uri |
string |
The URI of the parameters file. |
DeploymentStacksTemplateLink
Entity representing the reference to the template.
| Name | Type | Description |
|---|---|---|
| contentVersion |
string |
If included, must match the ContentVersion in the template. |
| id |
string |
The resourceId of a Template Spec. Use either the id or uri property, but not both. |
| queryString |
string |
The query string (for example, a SAS token) to be used with the templateLink URI. |
| relativePath |
string |
The relativePath property can be used to deploy a linked template at a location relative to the parent. If the parent template was linked with a TemplateSpec, this will reference an artifact in the TemplateSpec. If the parent was linked with a URI, the child deployment will be a combination of the parent and relativePath URIs. |
| uri |
string |
The URI of the template to deploy. Use either the uri or id property, but not both. |
DeploymentStackValidateProperties
The Deployment stack validation result details.
| Name | Type | Description |
|---|---|---|
| actionOnUnmanage |
Defines the behavior of resources that are no longer managed after the Deployment stack is updated or deleted. |
|
| correlationId |
string |
The correlation id of the Deployment stack validate operation. It is in GUID format and is used for tracing. |
| denySettings |
The Deployment stack deny settings. |
|
| deploymentExtensions |
The deployment extensions. |
|
| deploymentScope |
string |
The Deployment stack deployment scope. |
| description |
string |
The Deployment stack validation description. |
| parameters |
<string,
Deployment |
Deployment parameters. |
| templateLink |
The URI of the template. |
|
| validatedResources |
The array of resources that were validated. |
|
| validationLevel |
The validation level of the deployment stack |
DeploymentStackValidateResult
The Deployment stack validation result.
| Name | Type | Description |
|---|---|---|
| error |
The error detail. |
|
| id |
string |
String Id used to locate any resource on Azure. |
| name |
string |
Name of this resource. |
| properties |
The validation result details. |
|
| systemData |
Azure Resource Manager metadata containing createdBy and modifiedBy information. |
|
| type |
string |
Type of this resource. |
ErrorAdditionalInfo
The resource management error additional info.
| Name | Type | Description |
|---|---|---|
| info |
object |
The additional info. |
| type |
string |
The additional info type. |
ErrorDetail
The error detail.
| Name | Type | Description |
|---|---|---|
| additionalInfo |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Error response
| Name | Type | Description |
|---|---|---|
| error |
The error object. |
KeyVaultParameterReference
Azure Key Vault parameter reference.
| Name | Type | Description |
|---|---|---|
| keyVault |
Azure Key Vault reference. |
|
| secretName |
string |
Azure Key Vault secret name. |
| secretVersion |
string |
Azure Key Vault secret version. |
KeyVaultReference
Azure Key Vault reference.
| Name | Type | Description |
|---|---|---|
| id |
string |
Azure Key Vault resourceId. |
ManagedResourceReference
The managed resource model.
| Name | Type | Default value | Description |
|---|---|---|---|
| apiVersion |
string |
The API version the resource was deployed with |
|
| denyStatus | none |
denyAssignment settings applied to the resource. |
|
| extension |
The extension the resource was deployed with. |
||
| id |
string |
The ARM Resource ID of a resource managed by the deployment stack. |
|
| identifiers |
management.azure.com.resources.deploymentstacks.validatestackatsubscription |
The extensible resource identifiers. |
|
| status |
Current management state of the resource in the deployment stack. |
||
| type |
string |
The resource type. |
ResourceReference
The resourceId model.
| Name | Type | Description |
|---|---|---|
| apiVersion |
string |
The API version the resource was deployed with |
| extension |
The extension the resource was deployed with. |
|
| id |
string |
The ARM Resource ID of a resource managed by the deployment stack. |
| identifiers |
management.azure.com.resources.deploymentstacks.validatestackatsubscription |
The extensible resource identifiers. |
| type |
string |
The resource type. |
ResourceReferenceExtended
The resourceId extended model. This is used to document failed resources with a resourceId and a corresponding error.
| Name | Type | Description |
|---|---|---|
| apiVersion |
string |
The API version the resource was deployed with |
| error |
The error detail. |
|
| extension |
The extension the resource was deployed with. |
|
| id |
string |
The ARM Resource ID of a resource managed by the deployment stack. |
| identifiers |
management.azure.com.resources.deploymentstacks.validatestackatsubscription |
The extensible resource identifiers. |
| type |
string |
The resource type. |
ResourceStatusMode
Current management state of the resource in the deployment stack.
| Value | Description |
|---|---|
| managed |
This resource is managed by the deployment stack. |
| removeDenyFailed |
Unable to remove the deny assignment on resource. |
| deleteFailed |
Unable to delete the resource from Azure. The delete will be retried on the next stack deployment, or can be deleted manually. |
ResourcesWithoutDeleteSupportAction
Specifies an action for resources that do not support deletion.
| Value | Description |
|---|---|
| detach |
Detach the specified resources from the deployment stack and continue. |
| fail |
Fail the deployment stack if resources cannot be deleted. |
systemData
Metadata pertaining to creation and last modification of the resource.
| Name | Type | Description |
|---|---|---|
| createdAt |
string (date-time) |
The timestamp of resource creation (UTC). |
| createdBy |
string |
The identity that created the resource. |
| createdByType |
The type of identity that created the resource. |
|
| lastModifiedAt |
string (date-time) |
The timestamp of resource last modification (UTC) |
| lastModifiedBy |
string |
The identity that last modified the resource. |
| lastModifiedByType |
The type of identity that last modified the resource. |
UnmanageActionManagementGroupMode
Specifies an action for a newly unmanaged resource.
| Value | Description |
|---|---|
| delete |
Delete the management groups from Azure. |
| detach |
Keep the management groups in Azure. |
UnmanageActionResourceGroupMode
Specifies an action for a newly unmanaged resource group.
| Value | Description |
|---|---|
| delete |
Delete the resource groups from Azure. |
| detach |
Keep the resource groups in Azure. |
UnmanageActionResourceMode
Specifies an action for a newly unmanaged resource.
| Value | Description |
|---|---|
| delete |
Delete the resources from Azure |
| detach |
Keep the resources in Azure |
ValidationLevel
The level of validation performed on the deployment.
| Value | Description |
|---|---|
| Template |
Static analysis of the template is performed. |
| Provider |
Static analysis of the template is performed and resource declarations are sent to resource providers for semantic validation. Validates that the caller has RBAC write permissions on each resource. |
| ProviderNoRbac |
Static analysis of the template is performed and resource declarations are sent to resource providers for semantic validation. Skips validating that the caller has RBAC write permissions on each resource. |