Microsoft AZ-104 Exam Dumps, Practice Test Questions

100% Latest & Updated Microsoft AZ-104 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!

Microsoft AZ-104 Premium Bundle
$79.97
$59.98

AZ-104 Premium Bundle

  • Premium File: 606 Questions & Answers. Last update: Nov 5, 2026
  • Training Course: 132 Video Lectures
  • Study Guide: 458 Pages
  • Latest Questions
  • 100% Accurate Answers
  • Fast Exam Updates

AZ-104 Premium Bundle

Microsoft AZ-104 Premium Bundle
  • Premium File: 606 Questions & Answers. Last update: Nov 5, 2026
  • Training Course: 132 Video Lectures
  • Study Guide: 458 Pages
  • Latest Questions
  • 100% Accurate Answers
  • Fast Exam Updates
$79.97
$59.98

Microsoft AZ-104 Practice Test 39

Question 380

A team uses one Bicep file for production and test. The production environment needs an optional diagnostic VM, but test environments must not create or pay for that VM. Both environments should retain the same source file. Which construct belongs on the optional VM resource?

  1. Deploy the diagnostic VM in all environments and use a Bicep output to hide its resource ID in test
  2. A resource-level if condition controlled by a Boolean parameter
  3. Set a Bicep parameter for the VM name but always instantiate the optional resource
  4. An NSG deny rule that prevents test users connecting to an always-created VM

Explanation

Correct Answer

B:

A Bicep conditional resource declaration creates the VM only when its Boolean expression is true. Passing false for test omits that resource while preserving one reusable template.

Incorrect Answers

A:

Outputs affect returned deployment values, not the creation of underlying resources. The diagnostic VM would still be provisioned and billed in test.

C:

Parameters can customize names, but without conditional resource creation the VM still exists in both environments, violating the explicit no-VM test requirement.

D:

Blocking connectivity does not remove VM compute charges. The stated requirement is to omit the optional resource, not merely hide its network access.

Question 381

A deployment pipeline accepts an environment string in a Bicep parameter and must reject any value other than dev, test, or prod before provisioning starts. What parameter declaration mechanism expresses the accepted set?

  1. Use an output statement containing dev, test, and prod
  2. Apply an @allowed decorator or equivalent permitted-value type constraint to the parameter
  3. Set a default value of dev and allow pipelines to override it with any string
  4. Add @description with the approved environment names

Explanation

Correct Answer

B:

Bicep parameter constraints can validate an input against the approved values. Invalid input fails validation rather than silently deploying an unsupported environment.

Incorrect Answers

A:

Outputs describe values produced by a deployment. They do not constrain the values accepted for an input parameter before resource creation.

C:

A default provides a fallback but does not prohibit the caller from supplying an unapproved value. The required validation needs an explicit accepted set.

D:

Description metadata helps operators understand expected values, but it does not enforce the permitted set when a pipeline supplies an unsupported string.

Question 382

An Azure administrator uses Bicep to deploy an application with a secret reference identifier. Operational policy requires the identifier parameter to be at least 12 characters, regardless of deployment environment. Which Bicep construct enforces this minimum?

  1. Set a default identifier that is twelve characters but allow callers to override it
  2. A @secure decorator by itself
  3. A @minLength(12) decorator on the string parameter
  4. Use @maxLength(12) to enforce the stated minimum

Explanation

Correct Answer

C:

The minLength constraint declares a numeric minimum acceptable length. Deployment parameter validation can reject shorter values before resource provisioning.

Incorrect Answers

A:

A default meets the minimum only when omitted. An explicitly supplied shorter identifier would remain valid unless a length constraint is declared.

B:

The secure decorator helps prevent sensitive input exposure in deployment history but does not enforce string length. The security property and input constraint are separate.

D:

MaxLength enforces an upper bound, so it would reject long identifiers rather than those shorter than twelve. The business requirement needs a minimum-length constraint.

Question 383

A Bicep author declares param vmCount int and wants invalid requests greater than 25 rejected by deployment validation before any VM deployment begins. The existing code has no bounds check. What is the targeted fix?

  1. Add a @maxValue(25) decorator to the vmCount parameter
  2. Set @minLength(25) on the integer parameter
  3. Add @secure() to vmCount
  4. Set a parameter description stating the maximum value is 25

Explanation

Correct Answer

A:

Bicep parameter decorators can enforce inclusive numeric validation at deployment time. The maxValue constraint rejects out-of-range submitted values before resource operations depend on them.

Incorrect Answers

B:

minLength is for strings and arrays, not upper-bounding an integer. It cannot implement the count constraint as requested.

C:

The secure decorator protects sensitive strings or objects from logging; it is not a maximum-value validator for an integer count.

D:

A description documents intended usage but does not enforce a deployment-time upper-bound constraint on an integer parameter.

Question 384

A Bicep parameter file receives a secure database password and builds a non-secure connectionString parameter by interpolating that password. The linter warns that a secret may appear in deployment history. What is the safe design correction?

  1. Decorate only the original dbPassword parameter with @secure() while leaving the derived connectionString target parameter plain
  2. Keep sensitive derived parameters secure rather than passing secure values into non-secure parameters
  3. Enable the secure-params-in-parameters-file linter warning but deploy the unchanged non-secure connectionString parameter
  4. Mark a separate deployment output as secure while continuing to pass the derived connectionString through an unprotected input parameter

Explanation

Correct Answer

B:

Marking the receiving parameter secure or avoiding the insecure interpolation preserves the confidential treatment through deployment. Secure data must not be downgraded into plaintext parameter history.

Incorrect Answers

A:

Securing the source password does not protect a second parameter that receives its value by interpolation. The derived connectionString parameter must also be marked @secure(), or the insecure transfer must be avoided, so deployment history does not expose the secret.

C:

A linter rule can detect the insecure flow but does not change the parameter's protection or redact its deployment-history value. Mark the target secure or eliminate the insecure interpolation before deploying.

D:

Protecting an output does not retroactively secure an input parameter recorded in deployment history. The receiving connectionString parameter itself requires confidential handling, regardless of output configuration.

Question 385

A deployment must create several nearly identical storage accounts, but each depends on a naming array and selected region. The author duplicated a full Bicep resource block for every array element and now wants a concise declaration. What Bicep construct is most appropriate?

  1. Set the symbolic resource name to the string of all array values
  2. Declare the first storage account as existing and assume the rest are created from the array
  3. Use a resource for-expression over the input array and derive each name and location
  4. Use dependsOn with every array index and keep a single static resource name

Explanation

Correct Answer

C:

A Bicep resource loop iterates declaratively over a collection to create multiple resources while keeping the resource type and properties in one maintained definition.

Incorrect Answers

A:

A symbolic identifier is not a loop and cannot independently create an account for each item in a list.

B:

The existing keyword references a separately provisioned resource. It does not iterate through a list to create the remaining accounts.

D:

Dependency ordering cannot multiply one uniquely named Azure resource into several requested account instances.

Question 386

A Bicep template declares an object parameter for application settings. A developer mistypes an expected property name and wants the compiler to treat suspected typos as errors rather than warnings. Which decorator can strengthen validation of the user-defined object type?

  1. Use @secure() on the object merely to check property spelling
  2. Add @secure() to the application-settings object parameter and assume it makes mistyped property names compilation errors
  3. Annotate every object property with @description() only
  4. Use @sealed() on the applicable user-defined object type

Explanation

Correct Answer

D:

The sealed decorator raises a diagnostic about likely misspelled properties to an error for supported typed object definitions. That catches errors earlier than deployment to production.

Incorrect Answers

A:

Secure affects sensitive parameter disclosure, not the compiler's warning level for incorrect property names.

B:

@secure() suppresses exposure of sensitive values; it does not promote unknown-property-name warnings into type-checking errors. @sealed() on the relevant user-defined object type raises possible property typos to an error.

C:

Descriptions document intent but do not elevate likely misspelled user-defined object properties to compilation errors.

Question 387

A Bicep deployment declares an int parameter minNodes for a high-availability set, but operators sometimes submit zero despite the application requiring at least two instances. Which targeted validation should be added?

  1. Use @minValue(2) on the integer parameter
  2. Use @maxLength(2) on the int parameter
  3. Mark the int parameter with @secure()
  4. Use only @description() to explain the two-instance minimum

Explanation

Correct Answer

A:

Bicep numeric parameter constraints can reject values below the minimum before deployment. This protects the application's minimum-capacity assumption without runtime code.

Incorrect Answers

B:

maxLength applies to strings and arrays, not the lower bound for a numeric instance count.

C:

Secure decorates supported sensitive parameter types and does not impose a minimum number of instances.

D:

A textual description documents the minimum but does not reject zero or one during Bicep parameter validation.

Question 388

A Bicep deployment runs in resource group rg-web. The web app needs the blob endpoint of an already-deployed account in rg-data in the same subscription. The template must not recreate or relocate that storage account. How should it reference the account?

  1. Write the storage-account key as a secure parameter instead of referencing the account
  2. Declare the storage account as existing and set its scope to resourceGroup("rg-data")
  3. Declare a new storage account resource with the same name and assume ARM ignores it
  4. Use the current resourceGroup() scope without specifying the other group

Explanation

Correct Answer

B:

An existing declaration with an explicit scope references an object managed outside the current deployment. Its symbolic name can expose properties without attempting to deploy the storage account again.

Incorrect Answers

A:

An access key is not the account resource ID or an endpoint reference. Introducing a secret also expands exposure without satisfying the property lookup.

C:

A normal resource declaration participates in deployment. It is not a read-only reference and could produce unwanted changes or fail because of resource scope.

D:

The default current-group scope would search rg-web for the account, not rg-data. The target can be reported missing despite existing elsewhere.

Question 389

A Bicep deployment already has a resource loop `[for name in nicNames: { ... }]` creating three NICs. The NIC names and subnet IDs are stored in two positionally aligned parameter arrays. Every iteration currently sets its subnet `id` to `subnetIds[0]`, so all NICs join the first subnet. Which Bicep change assigns each generated NIC to the corresponding subnet WITHOUT changing the number of NICs?

  1. Use the array-and-index loop form `[for (name, i) in nicNames: ...]` and set the subnet ID to `subnetIds[i]`
  2. Add `@batchSize(1)` to the existing resource loop but keep the subnet ID as `subnetIds[0]`
  3. Replace `subnetIds[0]` with `first(subnetIds)` inside the existing loop
  4. Add an explicit `dependsOn` entry for the virtual network to the loop but keep the subnet ID as `subnetIds[0]`

Explanation

Correct Answer

A:

Bicep supports `[for (item, index) in collection: ...]`, so each NIC iteration can use its numeric index to select the aligned subnet ID from the second array. Because `nicNames` and `subnetIds` are positionally aligned, `subnetIds[i]` binds each generated NIC to the correct tier subnet instead of repeating entry zero. Confirm both arrays have matching lengths.

Incorrect Answers

B:

The `@batchSize(1)` decorator serializes resource loop deployment but does not change which array element is read inside each iteration. Leaving `subnetIds[0]` means all three NICs still point to the first subnet, just deployed sequentially.

C:

`first(subnetIds)` is equivalent to selecting the first array entry, so it retains the broken constant subnet assignment for every NIC. The template needs the iteration index, not another spelling of the same first-element selection.

D:

`dependsOn` can order resource provisioning, but it does not rewrite the subnet `id` expression. All NICs would still use `subnetIds[0]` after the virtual network is ready. Select the corresponding array element with the loop index instead.

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?

  1. Set @batchSize(8) on the resource loop, assuming one batch of eight means that Azure serializes each create
  2. Apply @batchSize(1) to the Bicep resource loop so that each of the eight deployments waits for the preceding one
  3. Give all eight resource declarations unique names while leaving the resource loop at its default deployment concurrency
  4. 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.

Microsoft Azure Administrator (AZ-104) Practice Tests

UP

SPECIAL OFFER: GET 10% OFF

This is ONE TIME OFFER

ExamSnap Discount Offer
Enter Your Email Address to Receive Your 10% Off Discount Code

A confirmation link will be sent to this email address to verify your login. *We value your privacy. We will not rent or sell your email address.

Download Free Demo of VCE Exam Simulator

Experience Avanset VCE Exam Simulator for yourself.

Simply submit your e-mail address below to get started with our interactive software demo of your free trial.

Free Demo Limits: In the demo version you will be able to access only first 5 questions from exam.