Last week you deployed an ARM template to the resource group RG-Logs. The template created a storage account named contosologs01 with the SKU Standard_LRS. The account must now use Standard_GRS. You change the SKU value in the template. You then run az deployment group create again against RG-Logs, using the same template and the same storageName value.
What is the result of the second deployment?
ARM templates are declarative and idempotent. Each deployment brings the declared resources to the state the template describes. When the storage account name matches a resource that already exists, Resource Manager updates that account instead of creating a new one. You therefore apply configuration changes by editing the template and redeploying it.
- Not correct: Resource Manager creates a second storage account and adds a suffix to its name. Resource Manager does not rename resources or create duplicates. The declared name identifies the existing resource.
- Not correct: The deployment fails because a storage account named
contosologs01already exists. The name already belongs to this resource, so Resource Manager treats the account as the target to update. The name does not cause a conflict. - Not correct: The SKU change is ignored because templates are used to create new resources and do not modify existing ones. Templates can deploy or update resources. Redeploying a changed template changes existing resources to match it.
- Correct: Resource Manager updates the existing
contosologs01storage account to match the template. ARM templates are idempotent. When you redeploy a template with the same resource name, Resource Manager updates the existing resource to match the template.