AZ-305 Design infrastructure solutions Practice Question
Exhibit
Refer to the exhibit.
```json
{
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Compute/virtualMachines"
},
{
"field": "Microsoft.Compute/virtualMachines/sku.name",
"like": "Standard_DS*"
}
]
},
"then": {
"effect": "deny"
}
}
}You are an Azure administrator. The above Azure Policy definition is assigned to a subscription. A developer tries to deploy a Virtual Machine with SKU Standard_DS2_v2. What will happen?
⚠ Common exam trap
It's easy for candidates to confuse the 'deny' effect with 'audit' or 'modify' effects, assuming a policy only logs non-compliance or automatically corrects the resource, rather than understanding that 'deny' actively blocks the deployment.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The deployment is denied and an error message is returned.
The Azure Policy definition assigned to the subscription includes a 'deny' effect for VM SKUs that are not in the allowed list. Since Standard_DS2_v2 is not an allowed SKU, the deployment is denied and an error message is returned to the developer, preventing the VM from being created.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The deployment is denied and an error message is returned.
Why this is correct
The policy definition's effect is Deny, so Azure Resource Manager evaluates the VM SKU against the condition before the resource provider accepts the request. When the condition matches, the create or update call is blocked, the deployment status is Failed, and the response contains the policy violation, including the policy name and assignment ID. Because evaluation happens during the PUT request, no VM is ever created or partially provisioned.
- ✗
The deployment succeeds with a warning logged.
Why it's wrong here
When the Deny effect is triggered, Azure Policy injects a conflict error into the deployment response, so the result is a failed deployment, not a successful one with a warning. Azure Resource Manager doesn't have a 'succeeded with policy warning' outcome for a deny; any policy that blocks a required property is a hard failure. A warning could only appear in compliance reports or activity logs, never as the deployment status.
- ✗
The VM is created but the SKU is changed to a different series.
Why it's wrong here
Deny effect never alters the requested resource; it only rejects the request if the SKU doesn't match the allowed condition. The resource provider receives the original SKU value, and since the request is denied, there is no VM to resize or change. To automatically replace a denied SKU, you would need a separate Modify or DeployIfNotExists policy with a remediation task, which is not part of the Deny effect.
- ✗
The deployment succeeds because the policy only audits.
Why it's wrong here
The effect in the policy is Deny, not Audit, so the deployment is blocked, not merely flagged. AuditEffect records the resource as non-compliant after (or while) it is created, but DenyEffect prevents the resource from being created in the first place. The behavior the answer describes would only happen if the assignment had been built with the audit effect.
Go deeper
Related to this question
About these practice questions
This AZ-305 question is part of Courseiva's 212-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-305 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-305 exam.