Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Deploy resources by using an Azure Resource Manager template or a Bicep file

A worked example

Single answer

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?

Choose one answer
Why

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 contosologs01 already 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 contosologs01 storage 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.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free