This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
You need to write a template that includes an Azure Policy assignment. This should only be deployed for production environments. What should you do?
Define a resource for the policy assignment by using the audit effect, and ignore any errors for non-production environments.
Add a condition to your Bicep template so that the policy assignment is deployed only when the environmentName parameter value is set to Production.
environmentName
Production
Move the policy assignment into its own module.
Which one of the following is a good situation to use loops?
You need to deploy multiple resources that are almost identical but with some minor differences between them.
You need to deploy the same resources to multiple environments.
You need to run custom code inside your Bicep file.
How can you reference the current loop item within a Bicep loop?
Use the copyIndex() function.
copyIndex()
Use array functions.
Use the symbolic name you specified within the loop declaration.
You used an array parameter to create a specified number of storage accounts. You need to return the storage account names for all the storage accounts you deploy so that users who run the deployment can see it. Which option should you use to return the storage account names?
Use an output loop to return an array with the storage account names.
Use a variable loop to create a list of storage account names for each resource.
Use the output function within a resource declaration loop.
You must answer all questions before checking your work.
Was this page helpful?