General
Deployment stack
Manages resources as a unit and controls what happens when they leave the deployment.
Naming rules
- Abbreviation
- Length
- 1–90
- Allowed characters
- Pattern: ^[-\w\._\(\)]+$
- Uniqueness scope
- See resource reference
Directory abbreviation
Code examples
These examples look up an existing resource by its full Azure resource ID. The documentation links include deployment syntax.
Terraform
Terraform documentationhcl
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
version = "~> 2.0"
}
}
}
variable "resource_id" {
description = "Full Azure resource ID of the existing Microsoft.Resources/deploymentStacks resource."
type = string
}
data "azapi_resource" "example" {
type = "Microsoft.Resources/deploymentStacks@2025-07-01"
resource_id = var.resource_id
}
output "resource_name" {
value = data.azapi_resource.example.name
}
Bicep
Bicep documentationbicep
@description('Full resource ID of the existing Microsoft.Resources/deploymentStacks resource.')
param resourceId string
output resourceName string = reference(resourceId, '2025-07-01', 'Full').name
ARM template
ARM template documentationjson
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"resourceId": {
"type": "string",
"metadata": {
"description": "Full resource ID of the existing Microsoft.Resources/deploymentStacks resource."
}
}
},
"resources": [],
"outputs": {
"resourceName": {
"type": "string",
"value": "[reference(parameters('resourceId'), '2025-07-01', 'Full').name]"
}
}
}