100% Latest & Updated Microsoft AZ-104 Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 120
An enterprise must reject any new Azure resource deployment into regions outside a fixed approved list. It is not enough to report noncompliance after the resource is created. Which Azure Policy effect should the administrator use?
- audit
- deny
- disabled
- auditIfNotExists
Explanation
Correct Answer
B:Deny evaluates matching creation and update requests and blocks ones that violate the allowed-location rule before the resource provider completes deployment. It directly enforces the prevention requirement.
Incorrect Answers
A:Audit marks a matching deployment as noncompliant but does not reject the incoming resource request. It is valuable for observation, not for the preventive region requirement.
C:Disabled turns off policy evaluation for the rule, so a request in an unapproved region proceeds without enforcement from that definition.
D:AuditIfNotExists checks related-resource existence and records compliance findings. It is not the effect for rejecting an otherwise valid resource whose region is disallowed.
Question 121
A security group must report Azure virtual machines that lack an associated resource diagnostic setting, but it does not want the governance rule to create or modify the setting on the resource. The compliance test must inspect a related child resource rather than only a tag on the VM. Which Azure Policy effect is designed for this?
- Use AuditIfNotExists with an existence condition for the related VM diagnostic-setting resource
- Use an Audit condition that checks a VM tag claiming that diagnostics were enabled, without inspecting the child resource
- Use DeployIfNotExists to create a diagnostic-setting resource whenever the related setting is absent
- Use Modify to insert a VM tag indicating diagnostics are configured, without checking the actual setting
Explanation
Correct Answer
A:AuditIfNotExists is designed to inspect for a related resource of a specified type and evaluate an existence condition after the target resource is provisioned. The team can identify VMs missing matching diagnostic settings without the policy creating or modifying those settings. The related-resource check is the crucial requirement; report the resulting noncompliance while remediation remains a separate operational action.
Incorrect Answers
B:The ordinary Audit effect can mark a VM noncompliant based on properties or policy aliases available on that resource. A team-maintained tag, however, is only metadata and may be present even when the related diagnostic-setting child resource is missing. It cannot establish the requested existence condition; the intended audit must inspect the actual related resource type.
C:DeployIfNotExists can check related-resource presence much like AuditIfNotExists, but it also runs an ARM deployment to create missing configuration with a managed identity and appropriate rights. That changes the VM’s associated diagnostic settings rather than simply reporting missing configuration. The security group explicitly forbids automatic creation or modification during this assessment phase.
D:Modify is used for supported property or tag changes and remediation operations, not as a substitute for evaluating the existence of a separately provisioned diagnostic-setting child resource. A newly inserted tag could suggest the VM is compliant even while diagnostic events are never exported. The team needs a compliance report based on actual related configuration, with no write side effect.
Question 122
A security committee needs visibility into new storage accounts that do not enforce a specified security setting. Workloads must continue deploying while the team measures the extent of noncompliance. Which policy effect aligns with this first phase?
- Deny every noncompliant create or update operation immediately
- DeployIfNotExists a replacement storage account on every evaluation
- Use a policy definition with effect Disabled and assume it still records noncompliant storage settings
- Audit the matching resources and surface their noncompliant evaluation results
Explanation
Correct Answer
D:The Audit effect records policy compliance state without rejecting the resource operation. It supports discovery while the organization prepares enforcement.
Incorrect Answers
A:Deny would prevent deployments that lack the setting. This conflicts with the explicit measure-first requirement to leave deployments operational.
B:DeployIfNotExists is an automated deployment mechanism for related configuration, not a passive assessment of the storage account itself. It would act rather than solely observe.
C:A Disabled Azure Policy effect stops the assignment from evaluating the targeted compliance condition. Use Audit when deployment must continue but each noncompliant storage account should still be surfaced in policy evaluation results.
Question 123
New Azure resources must receive a related diagnostic setting automatically when one is missing, but creation itself should not be denied. An approved template can deploy the setting after the resource is created. Which Azure Policy effect is designed for that?
- Use Deny to reject resources that are missing diagnostics and expect it to create the setting during rejection
- Use AuditIfNotExists to report the missing related setting and assume this effect also deploys it
- Use Modify to change a metadata field on the parent resource instead of creating the required diagnostic-setting child resource
- Use DeployIfNotExists with a suitable deployment definition, managed identity, and required permissions
Explanation
Correct Answer
D:DeployIfNotExists evaluates the existence of the related diagnostic-setting resource after the parent operation completes and can launch the specified ARM deployment when it is absent. The policy assignment’s managed identity must have the roles needed for that deployment, and existing resources may need a remediation task. This matches both requirements: permit creation and subsequently install missing diagnostics.
Incorrect Answers
A:Deny prevents a matching resource creation or update request from succeeding; it is a request-time enforcement effect, not a configuration deployment tool. The team expressly allows resource creation and needs a related diagnostic-setting resource added afterward. Rejecting the request does not provision that child resource and would interrupt workloads instead of satisfying the automated follow-up requirement.
B:AuditIfNotExists checks whether a related resource meeting the existence condition is present and reports a compliance violation if not. It is useful for visibility when changes should not occur automatically, but it does not execute an ARM template deployment. Here the specification explicitly calls for adding the missing setting without denying resource creation, so passive auditing alone leaves the problem unresolved.
C:Modify is useful for altering supported tags or provider-exposed properties and can be remediated in supported cases. A diagnostic setting is a related extension resource that must be deployed with the right parent scope, destination and authorization. Merely altering parent metadata does not establish that child resource or route diagnostic events to the required destination.
Question 124
A team must pilot a location-restriction Azure Policy across production. Compliance reports should identify would-be violations, but the policy must not yet deny new resource creation while owners correct old deployments. Which assignment-level setting supports this rollout?
- Set policy assignment enforcementMode to DoNotEnforce while keeping policy evaluation
- Create broad temporary Azure Policy exemptions for the same production resources
- Change the policy to Disabled while collecting no compliance results
- Grant the deployment service principal the Owner role to bypass policy evaluation
Explanation
Correct Answer
A:DoNotEnforce permits policy assessment and compliance reporting while disabling enforcement of deny or modify effects at the assignment during the trial. The team can later enable enforcement deliberately.
Incorrect Answers
B:Exemptions remove selected resources from normal compliance treatment; this would lose the uniform observation-only compliance reporting that the pilot requires. An assignment-wide non-enforcement trial is more precise.
C:A Disabled effect is not a trial that evaluates and reports potential violations. The team requires policy compliance visibility while avoiding enforcement of the original deny effect.
D:Owner does not generally bypass Azure Policy enforcement; escalating permissions also expands privilege without providing an audit-only setting.
Question 125
A subscription already contains storage accounts in an unapproved region. A new Azure Policy deny assignment blocks future unapproved deployments. The security team expects existing non-compliant storage accounts to vanish immediately. What should the administrator explain?
- The deny policy instantly deletes every resource whose location is outside the approved list
- The policy will silently migrate all existing accounts to the permitted region
- The deny assignment prevents querying existing accounts, so their compliance status is unknown
- Existing accounts are assessed as non-compliant but must be separately corrected or removed using an approved migration plan
Explanation
Correct Answer
D:Deny prevents violating create/update requests and identifies existing non-compliance. Operators must plan safe remediation for existing resources; no automatic deletion or migration follows from assignment.
Incorrect Answers
A:Policy deny controls evaluated requests; it is not a destructive cleanup job for existing resources. Automatically deleting storage accounts would be dangerous and is not how a deny effect operates.
B:Azure Policy does not perform cross-region resource migration. Region changes often require purpose-built migration processes and explicit data movement.
C:An existing resource can still be evaluated and reported as non-compliant; policy denial of invalid writes does not erase compliance visibility.
Question 126
A governance team assigns an Azure Policy definition with effect Disabled to a subscription to retain a controlled policy artifact temporarily without evaluating resources against it. Which observation follows?
- New deployments matching the condition are denied
- Treat Disabled as equivalent to assignment enforcementMode DoNotEnforce, with compliance still evaluated but no deny applied
- Expect the assignment to report every matching resource Non-compliant while simply skipping the remediation action
- That assignment does not evaluate compliance under the disabled effect
Explanation
Correct Answer
D:Disabled is used to turn off evaluation for the associated rule; it does not audit or deny incoming resources. It is different from an active Audit effect that marks violations.
Incorrect Answers
A:Deny performs request-time blocking, while Disabled does not execute the rule for enforcement. No denial occurs from this disabled effect.
B:These are distinct Azure Policy controls. Disabling enforcement can retain compliance evaluation, while the policy effect Disabled prevents evaluation for that definition; conflating them gives the wrong compliance expectation.
C:A Disabled effect does not run its rule to establish noncompliance in the usual way. It cannot be interpreted as an Audit or DeployIfNotExists effect that evaluates resources but avoids remediation.
Question 127
An operations team wants tagged production database resources to remain configurable but to reject direct DELETE requests at the Azure control plane. The policy team wants the rule to apply as governance policy rather than an all-purpose ReadOnly resource lock. What effect is intended?
- Use an appropriately scoped Azure Policy denyAction rule for delete requests
- Use the audit effect and rely on its compliance report to stop deletion
- Use deployIfNotExists to remove DELETE rights from the caller
- Apply an Azure Policy Disabled effect to the database resources
Explanation
Correct Answer
A:The denyAction effect can block a supported DELETE action on matching resources with a forbidden response, while permitting unrelated configuration changes as otherwise authorized. Its cascade behavior and scope must be deliberately reviewed.
Incorrect Answers
B:Audit records a compliance state; it does not reject the incoming DELETE operation and would leave the production database at risk.
C:DeployIfNotExists checks and can deploy related resources after evaluation; it is not an RBAC rights-removal or direct delete-denial mechanism.
D:Disabled stops evaluation of that policy definition. An inactive policy cannot protect the matching production resources from deletion.
Question 128
A policy using Modify attempts to update a resource property through an alias. The alias is not marked Modifiable for one older resource-provider API version, yet deployment requests made through that API must remain allowed while the mismatch is reported. Which Modify conflict behavior fits?
- Set the assignment enforcement mode to Default and assume that changes the alias metadata
- Set the Modify policy conflictEffect to audit for this alias compatibility case
- Set conflictEffect to deny so the unsupported alias will still be written
- Replace the alias with a tag that has the same displayed property name but does not update the actual property
Explanation
Correct Answer
B:For a nonmodifiable alias, conflictEffect audit lets the request proceed while skipping that unsupported modification; the mismatch can be investigated without failing legitimate deployments. It does not guarantee the desired property is changed.
Incorrect Answers
A:Default enforcement turns normal policy enforcement on but does not make a nonmodifiable alias writable under the older API version. The conflict effect remains decisive.
C:The deny conflict effect rejects requests when the Modify operation cannot be safely applied. That violates the specific requirement to permit existing clients using the older API version.
D:A resource tag and a real resource-provider property are different data. Adding a similarly named tag cannot substitute for writing the unsupported property alias.
Question 129
A governance architect imports a built-in Azure Policy definition that describes permitted VM SKUs. The portal shows the definition, but a new VM with a disallowed SKU is still created in a subscription that has no relevant policy assignment. What is missing?
- Place the built-in VM-SKU definition into an Azure Policy initiative but do not assign the initiative to any scope
- Create a policy assignment for the built-in definition at the intended subscription or other parent scope
- Change the policy definition's effect to deny but leave the definition unassigned to any subscription or management group
- Create a policy exemption for a different resource and expect the unassigned built-in definition to deny this VM deployment
Explanation
Correct Answer
B:A definition specifies a rule but does not activate enforcement by itself. The assignment binds the rule, parameters, and effect to a scope so incoming deployments can be evaluated.
Incorrect Answers
A:Grouping a definition into an initiative is a way to package and organize related policies; an unassigned initiative does not apply evaluation or denial to the target subscription. A policy or initiative assignment at the appropriate scope is needed before the disallowed SKU is blocked.
C:A deny effect is evaluated only when the policy definition is associated with an assignment at a scope that includes the requested resource. Modifying the effect in an otherwise unused definition cannot block a VM SKU in this subscription. The missing step is to create the scoped policy assignment with the intended parameters.
D:A policy exemption is a scoped exception to an existing policy assignment, not the action that activates a built-in policy definition. Creating an exemption for a different resource does not apply enforcement to the subscription. The VM deployment remains outside the rule until an appropriate policy or initiative assignment exists.
Question 130
A corporate policy definition uses a parameter `allowedSkus` so different environments can specify different VM sizes. Production should allow only two approved SKUs, while development may allow others. Where is the environment-specific list passed?
- Change the policy definition's default allowedSkus for every assignment, including development
- Put the two SKU values into an Azure Policy initiative's definition metadata while leaving the production assignment parameter unbound
- Supply the production SKU list in the production policy assignment's parameters
- Tag the production resource group allowedSkus with the permitted SKU names and assume the policy parameter reads tags automatically
Explanation
Correct Answer
C:A parameterized definition can be reused with different values at each assignment scope. Assignment-level values let production and development enforce separate approved lists without duplicating the rule.
Incorrect Answers
A:A definition default applies wherever the assignment omits a parameter. Editing the common default would risk changing development behavior too; the production assignment should pass the production-specific list explicitly.
B:Definition or initiative metadata describes an artifact; it does not supply a particular assignment's allowedSkus parameter value. Production needs its own parameter binding.
D:A resource-group tag is not automatically bound to an Azure Policy definition parameter. Without an explicit assignment parameter value or a definition that reads that tag, the intended production SKU list is not enforced.
Microsoft Azure Administrator (AZ-104) Practice Tests