Question 27 — AZ-104 Case Study Set
Review Paideffort's deployment workflow.
- name: Deploy production infrastructure
run: |
az deployment group create \
--name paideffort-prod \
--resource-group $RESOURCE_GROUP \
--template-file ./infra/main.json \
--parameters environmentName=prod storageAccountType=Standard_GRS
- name: Discover storage settings
run: |
STORAGE_NAME=$(az storage account list \
--resource-group $RESOURCE_GROUP \
--query "[0].name" -o tsv)
STORAGE_ENDPOINT=$(az storage account show \
--resource-group $RESOURCE_GROUP \
--name $STORAGE_NAME \
--query "primaryEndpoints.blob" -o tsv)
Paideffort's ARM template already returns storageAccountName and storageEndpoint. Which improvement most directly aligns the workflow with the intended use of ARM outputs? (Select one answer)
Capture the deployment result and consume
storageAccountNameandstorageEndpointfrom its outputs instead of rediscovering the resource.Keep both discovery commands because deployment outputs are intended only for values known before deployment begins.
Remove the outputs section and use resource-list queries because output values cannot contain runtime resource properties.
Hardcode the generated account name into the workflow because outputs should be reserved exclusively for confidential values.
Correct answers
Capture the deployment result and consume
storageAccountNameandstorageEndpointfrom its outputs instead of rediscovering the resource.
Explanations
Correct Answer:
Capture the deployment result and consume storageAccountName and storageEndpoint from its outputs instead of rediscovering the resource.
Explanation:
Paideffort has already designed the ARM deployment to return the resource name and runtime endpoint. Consuming those outputs gives downstream stages the exact values produced by that deployment and eliminates redundant Azure CLI discovery calls.
Wrong Answers:
Keep both discovery commands because deployment outputs are intended only for values known before deployment begins.
Outputs are specifically returned after deployment and can contain values derived from deployed resources, including runtime properties obtained through reference().
Remove the outputs section and use resource-list queries because output values cannot contain runtime resource properties.
The storageEndpoint output uses reference() to retrieve the deployed storage account's runtime endpoints. Removing it would discard a suitable mechanism already aligned with Paideffort's pipeline requirements.
Hardcode the generated account name into the workflow because outputs should be reserved exclusively for confidential values.
Outputs are well suited for resource names, identifiers, endpoints, and other deployment results. Confidential values should generally not be exposed through outputs.