100% Latest & Updated Microsoft AZ-104 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 390
A Bicep loop creates eight resources, but the target resource provider rejects parallel create operations for the same logical service. The operator wants to preserve one declaration and sequence the loop to avoid collisions. Which construct helps?
- Set @batchSize(8) on the resource loop, assuming one batch of eight means that Azure serializes each create
- Apply @batchSize(1) to the Bicep resource loop so that each of the eight deployments waits for the preceding one
- Give all eight resource declarations unique names while leaving the resource loop at its default deployment concurrency
- Change the ARM deployment mode from Incremental to Complete to serialize resource-provider create calls
Explanation
Correct Answer
B:The Bicep @batchSize decorator limits simultaneous instances of a resource loop. Setting the batch size to one imposes serial deployment, making later instances wait for the previous deployment. This directly resolves the provider’s parallel-create collision while retaining one loop declaration for all eight resources. A larger batch size would still permit concurrent resource operations.
Incorrect Answers
A:The decorator controls the number of instances that may deploy in the same batch, not the total iteration count. A batch size of eight permits all eight requested resources to start together, preserving the provider collision risk. For a provider requiring serial operations, the appropriate batch size is one.
C:Unique resource names prevent name conflicts but do not change concurrent scheduling of operations that the provider serializes internally. The scenario explicitly says the provider rejects parallel operations for its logical service, so merely renaming the eight deployments leaves the temporal collision unresolved. Control loop concurrency rather than only resource identifiers.
D:Incremental and Complete deployment modes concern how resources not in a template are handled, not whether items inside a Bicep loop execute in sequence. Using Complete mode can create deletion risk for unspecified resources and is not a provider-concurrency control. The desired behavior comes from the loop batching decorator.
Question 391
A Bicep template creates a storage account and, inside it, a Blob service configuration as a child resource. The author accidentally constructs a child resource name containing the full parent name twice, causing an invalid ID. Which Bicep construct best expresses the relationship?
- Add the parent name twice in the child's `name` until it matches an expected portal display
- Add dependsOn for the parent storage resource but keep the child's duplicated full parent name in the child name field
- Use the fully qualified parent/child ARM type but concatenate the parent storage-account name twice in the child's name
- Declare the child resource with the parent's symbolic reference in its `parent` property and the relative child name
Explanation
Correct Answer
D:Bicep understands the parent-child resource hierarchy and composes the correct ARM resource ID. Explicit parent association avoids accidentally repeating ancestor name segments in a manually concatenated identifier.
Incorrect Answers
A:Repeating names can create a malformed type/name path. Bicep has a direct parent relationship so guessing string segments is unnecessary.
B:Dependency ordering cannot repair an invalid child resource identifier. A parent symbolic reference and the relative child name avoid doubling the parent's name.
C:A correct nested type is insufficient when the child identifier repeats the parent name in a relative-name declaration. Use the parent property with a proper relative child name.
Question 392
A Bicep file should create a resource group and then a deployment module under that new group. An engineer writes the root file as a resource-group-scoped deployment and gets a scope mismatch creating the group. What declaration should be reconsidered?
- Set the root Bicep targetScope to subscription and deploy group resources through a module targeting the new group
- Keep resource-group scope and make the new group a VM extension resource
- Declare the new resource group as existing in the Bicep file while keeping the root deployment at resource-group scope
- Change the deployment command's target resource-group name but leave targetScope set to resourceGroup
Explanation
Correct Answer
A:A resource group is created at subscription scope. Bicep can then use a module scoped to that group for child resources, keeping management hierarchy aligned with declared deployment scope.
Incorrect Answers
B:A resource group is not a VM child extension and cannot be provisioned by falsely nesting it under an existing group deployment.
C:The existing keyword references a resource assumed to be present; it does not create the new group. Because a new resource group is a subscription-scoped resource, the root needs the matching subscription target scope before a child module can deploy into it.
D:Pointing the command at a different pre-existing resource group does not change the file's ability to declare a new group resource. The compilation and scope mismatch remains; a subscription-scoped root and a module scoped to the newly created group are required.
Question 393
An ARM JSON template deploys a network interface and a virtual machine that must attach to it. The VM deployment must not start until the NIC resource has been deployed. Which template mechanism expresses this deployment dependency?
- The outputs section that returns the VM name
- A dependsOn relationship for the virtual machine resource
- Set a parameter default that names the network interface without declaring a dependency
- Use only an ARM condition expression to include both VM and NIC resources
Explanation
Correct Answer
B:The ARM dependsOn property declares that a resource depends on another deployment resource. Resource Manager can then order the operations so the network interface is created before the dependent VM.
Incorrect Answers
A:Outputs expose values after a deployment but do not themselves enforce creation order. Returning the VM name cannot ensure that its network interface was available first.
C:A parameter can supply a resource name, but does not on its own express an ARM deployment dependency. The VM could still be scheduled before the NIC is provisioned.
D:Conditional deployment determines whether resources exist in the template, not their required creation order. The dependency must be represented in ARM deployment semantics.
Question 394
A Bicep template creates a storage account and a child configuration whose property uses the account’s symbolic reference. The author wonders whether to add a manual dependsOn clause merely to force the child to wait. What does this symbolic reference generally provide?
- Automatic deletion of the parent account when the child is deployed
- An implicit resource dependency when the expression references the parent resource
- A guarantee the two resources will always deploy simultaneously in any order
- A temporary replacement of ARM’s authorization checks
Explanation
Correct Answer
B:Bicep analyzes resource references and can infer deployment ordering. Explicit dependsOn is usually unnecessary when dependency follows from a property reference in the template.
Incorrect Answers
A:Resource dependency references establish deployment order, not a request to delete the referenced storage account.
C:The reference establishes ordering requirements rather than enforcing concurrent deployment. A dependent resource must wait for the referenced resource when required.
D:Template dependency ordering does not grant resource-provider permissions. The deployment identity still needs appropriate Azure RBAC rights.
Question 395
A company deploys the same ARM template to development and production. Both environments create the same resource types but require different location, SKU, and naming values. Which deployment design avoids changing the template’s resource logic?
- Use a subscription cost budget to substitute for all template parameter values
- Keep values as template parameters and supply separate environment-specific parameter files
- Create a different resource-provider namespace for each environment
- Manually edit every hard-coded location and SKU in the resource declarations for each deployment
Explanation
Correct Answer
B:ARM parameters separate variable environment inputs from declarative resource definitions. Using different parameter sets preserves common template logic while selecting distinct deployment settings.
Incorrect Answers
A:Budgets monitor costs and cannot supply resource names, SKUs, or regions to an ARM deployment.
C:Provider namespaces identify Azure service types and cannot be arbitrarily changed to express environment values. This would make deployments invalid.
D:Repeated template edits introduce configuration drift and risk accidental cross-environment values. Parameterizing was meant to avoid that fragility.
Question 396
An ARM JSON template must create five similarly configured storage accounts, each with a predictable distinct name. Maintaining five duplicated resource objects has already caused drift. Which ARM templating feature is intended for repetition?
- Use a resource copy loop with an index-based name expression
- Create five separate resource declarations with identical names in the same template
- Use dependsOn to repeat a single storage account deployment five times
- Use a condition on one resource with a constant true expression
Explanation
Correct Answer
A:An ARM resource copy loop creates multiple instances from a parameterized declaration, with a copy index or equivalent naming logic separating their identities.
Incorrect Answers
B:Duplicate resource declarations with the same name/type do not create five uniquely named accounts; they are a template-maintenance error.
C:dependsOn controls ordering of resource operations, not the number of resource instances or their distinct names.
D:An ARM resource condition decides whether to deploy the one declaration; it does not iterate and emit five independent resources.
Question 397
A legacy deployment script applies an ARM template containing two storage accounts to a resource group that already has a third, unrelated account. The team must preserve the third account. What deployment behavior must the operator ensure?
- Use complete deployment mode after listing only the two intended storage accounts
- Enable complete-mode resource deletion to reconcile the group exactly
- Use incremental deployment behavior so resources absent from the template are not targeted for removal
- Run a what-if analysis and then deploy in complete mode without adding the third storage account
Explanation
Correct Answer
C:Incremental deployment manages resources in the template without automatically deleting every pre-existing resource not listed. It suits the requirement to preserve the unrelated account.
Incorrect Answers
A:Complete mode may remove resources not represented in the template, putting the third unrelated account at risk rather than preserving it.
B:Complete-mode semantics can delete applicable resources omitted from the template, which is the risk the operator wants to avoid.
D:What-if may warn about predicted deletion but does not change complete-mode semantics. Deploying anyway would still endanger the omitted resource.
Question 398
A deployment pipeline emits a freshly generated database credential from a Bicep module as a string output for a downstream protected stage. The security team will not accept a value that is stored in deployment history or printed in CLI output. With Bicep 0.35.1 or later, what output declaration meets this constraint?
- Declare the output as an ordinary string and add a description that says confidential.
- Decorate the string output with @secure() and pass it through a protected downstream consumption path.
- Set the output type to int so Azure Resource Manager will automatically hide the value.
- Mark a module input parameter @secure(), but return the newly generated credential through an ordinary unprotected string output.
Explanation
Correct Answer
B:The @secure() decorator is supported for string and object outputs in Bicep 0.35.1 and later. Azure Resource Manager treats those outputs as sensitive and does not log or display the values in deployment history, portal, or command-line output. The downstream stage still needs to protect its own secret handling.
Incorrect Answers
A:An ordinary string output is visible in deployment output material. A description is human-readable metadata, not a confidentiality mechanism, so the generated credential would still violate the stated history and logging restriction.
C:Changing the type to int both corrupts the credential representation and does not constitute secure output handling. Bicep secure outputs are deliberately constrained to string and object; other data must be wrapped or serialized appropriately.
D:A secure input parameter protects the value while supplied to the deployment but does not automatically mark an ordinary generated output as sensitive. The requirement explicitly rules out output visibility in CLI and deployment history; the output itself must be declared @secure() with a protected downstream handling path.
Question 399
Team A deploys an Azure resource with an ARM template and Team B’s subsequent workflow must consume the actual resource ID without hardcoding a generated name. Which template mechanism should Team A expose?
- Declare every name as a literal in Team B’s script
- Read a resource tag named id from the deployment regardless of whether the tag is present
- Use dependsOn to identify the resource ID at the end of deployment
- Define a template output with the resource ID for the downstream process to read
Explanation
Correct Answer
D:ARM template outputs return evaluated values after deployment, including resource IDs. Team B can consume that result without making assumptions about naming or manually discovering the resource.
Incorrect Answers
A:Hardcoding names can drift when the deployment uses parameters or generated identifiers. It also fails to capture the actual resource ID returned by ARM.
B:A tag can hold arbitrary metadata but is not a guaranteed structured output containing the created resource’s ARM ID. The workflow needs an explicit deployment output.
C:DependsOn changes deployment ordering rather than returning a value for downstream consumption. It cannot replace an output declaration.
Question 400
A virtual network module exports a subnet resource ID. A VM module consumes that output for its NIC deployment. The team asks how to avoid explicit manual sequencing when one module depends on another’s output. What should the root Bicep file do?
- Launch both modules independently and hardcode the subnet ID before it exists
- Declare the subnet module above the VM module in source-file order, but never reference its output
- Mark both modules as existing and assume Bicep infers the VM NIC's new subnet ID automatically
- Pass the first module’s output directly as the second module’s input
Explanation
Correct Answer
D:A symbolic reference to the first module output establishes a dependency in Bicep’s deployment graph. The downstream module receives the actual subnet ID after it is produced.
Incorrect Answers
A:Parallel hardcoded execution risks using an incorrect or unavailable resource ID. It discards the dependency information already exposed by the module output.
B:Declaration order alone does not establish a resource dependency in Bicep. Passing the subnet module's output to the VM module creates the actual data dependency and deployment order.
C:The existing keyword addresses an already-deployed resource; it does not communicate a newly created module output to another module or automatically infer a missing NIC subnet ID.
Microsoft Azure Administrator (AZ-104) Practice Tests