AZ-104 Question 120
Single answerYour company has an existing Azure Resource Manager (ARM) template that deploys a Standard_LRS Storage Account in the East US region. You want to add an Application Insights resource to the same Resource Group using the same template, while ensuring the existing storage account is not affected. Which modification is required to successfully deploy both resources in a single operation?
- A
Add a new resource block for Application Insights with a 'dependsOn' referencing the existing storage account resource.
- B
Expand the existing storage account resource block to define Application Insights as a sub-resource of the storage account.
- C
Add a new resource block for Application Insights and omit 'dependsOn', relying on parallel deployment capabilities.
- D
Modify the existing resource block to change its resource type to Application Insights, consolidating both into a single resource.
Show answer and explanation
Correct answer: A
Explanation
To deploy an additional resource without impacting the existing one, you must define a new resource block. The 'dependsOn' property ensures that the Application Insights resource will be deployed correctly in relation to the existing storage account, preserving the current resource and adding the new one in a single deployment.
- A. Correct.
Defining a separate resource block with 'dependsOn' ensures Application Insights is deployed after the storage account and keeps the existing resource unaffected.
- B. Incorrect.
Application Insights cannot be defined as a sub-resource of a storage account; they have different resource types and require separate definitions.
- C. Incorrect.
While omitting 'dependsOn' is possible when resources truly have no dependency, Application Insights often needs references or order of operations, so including 'dependsOn' is best practice to avoid potential deployment conflicts.
- D. Incorrect.
Replacing the storage account resource type with Application Insights would remove or overwrite the existing resource, which does not achieve the goal of preserving the storage account.