🧪 Lab — Tag it — ARM
Tool 1 of 4 — ARM. Add a top-level "tags" property to this resource, with an "environment" key set to "production".
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2023-01-01",
"name": "[parameters('storageAccountName')]",
"location": "[parameters('location')]",
"sku": { "name": "Standard_LRS" },
"kind": "StorageV2",
"tags": {
"environment": "production"
}
}🧪 Lab — Tag it — Bicep
Tool 2 of 4 — Bicep. Add a tags property with environment: 'production'.
resource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01' = {
name: storageAccountName
location: location
sku: { name: 'Standard_LRS' }
kind: 'StorageV2'
tags: {
environment: 'production'
}
}🧪 Lab — Tag it — Terraform azurerm
Tool 3 of 4 — Terraform (azurerm). Add a tags argument with environment = "production".
resource "azurerm_storage_account" "main" {
name = var.storage_account_name
resource_group_name = var.resource_group_name
location = var.location
account_tier = "Standard"
account_replication_type = "LRS"
tags = {
environment = "production"
}
}🧪 Lab — Tag it — Terraform azapi
Tool 4 of 4 — Terraform (azapi). In azapi, tags is a resource-level argument (a sibling of type/name/body), not something inside body. Add it.
resource "azapi_resource" "storage" {
type = "Microsoft.Storage/storageAccounts@2023-01-01"
name = var.storage_account_name
location = var.location
parent_id = var.resource_group_id
tags = {
environment = "production"
}
body = {
sku = { name = "Standard_LRS" }
kind = "StorageV2"
}
}Final Quiz
📝 Quiz — Everything, mixed
You’ve Finished the Workshop
Nice work — you’ve now seen the same Azure resource declared four ways, previewed with both what-if and terraform plan, and practiced the syntax quirks that trip people up when switching between tools. Head back to the workshop overview to revisit any module, or jump straight back to a specific tool whenever you need a refresher.