Courseiva
Implement and Manage Virtual NetworkingmediumMultiple ChoiceObjective-mapped

AZ-104 Implement and Manage Virtual Networking Practice Question

A VM in Azure cannot accept RDP connections from your office public IP. The subnet NSG already has an inbound deny-all rule at priority 200, and you added an allow rule for TCP 3389 from 198.51.100.25/32 at priority 300. What should you do to allow the connection?

⚠ Common exam trap

The trap here is that candidates mistakenly think adding a more specific allow rule at a higher priority number will override a broader deny rule, not realizing that NSG priority order (lower number = higher priority) determines which rule is evaluated first.

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

Create or move the allow rule to priority 100 so it is evaluated before the deny rule.

Network Security Group (NSG) rules are evaluated in priority order, with lower numbers having higher precedence. Since the deny-all rule at priority 200 is evaluated before the allow rule at priority 300, the deny rule blocks the RDP traffic. To allow the connection, the allow rule must be created or moved to a priority lower than 200 (e.g., 100) so it is evaluated first, permitting traffic from 198.51.100.25/32 on TCP 3389 before the deny rule is reached.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Change the source to Internet so the allow rule matches more traffic.

    Why it's wrong here

    Changing the source to Internet broadens the matching scope, but priority dictates which rule acts on traffic. A deny-all rule with a numerically lower priority (higher importance) will still match first and block the RDP attempt, so the allow rule never gets evaluated. This also removes IP-based restricting, allowing any public address to attempt connection, creating a security risk without fixing the connectivity issue.

    When this WOULD be correct

    In a scenario where the NSG has no lower-priority deny rule blocking specific IPs, and you need to allow RDP from any public IP (e.g., for a jump server accessible from anywhere), setting the source to 'Internet' would be appropriate.

  • Create or move the allow rule to priority 100 so it is evaluated before the deny rule.

    Why this is correct

    NSG rules are evaluated in ascending priority order, meaning numeric 100 takes precedence over a higher-numbered deny rule such as 4096. By placing an allow rule for RDP (port 3389) from your office IP at priority 100, it is processed first and matches before the deny-all rule, permitting the connection. This is the standard method for overriding a broad deny rule while keeping security boundaries intact.

  • Change the protocol from TCP to Any to bypass the deny rule.

    Why it's wrong here

    Changing the protocol from TCP to Any affects the protocol match parameters, not the rule processing sequence. The deny-all rule at priority 4096 is still evaluated before any lower-priority allow rule, so even an allow rule covering Any protocol will never be reached. In fact, broadening protocol scope wastes effort because the deny rule still wins solely based on priority.

    When this WOULD be correct

    If the question described a scenario where the NSG allow rule for RDP uses TCP but the actual traffic uses a different protocol (e.g., UDP), then changing the protocol to Any could allow the connection. For example, if a VM requires RDP over UDP and the NSG only allows TCP, setting the protocol to Any would match both.

  • Assign a public IP directly to the VM to override the subnet NSG behavior.

    Why it's wrong here

    Assigning a public IP to the VM's NIC merely exposes the VM to the internet; it does not alter NSG evaluation. Traffic still enters the subnet and is filtered by subnet and NIC NSGs in priority order, so the existing deny-all rule with a lower priority value (e.g., 4096) still blocks port 3389. In fact, adding a public IP can increase attack surface without changing rule evaluation.

    When this WOULD be correct

    This would be correct if the VM is in a subnet without an NSG (or with an allow-all rule) but the VM's NIC has no public IP, and you need to enable inbound RDP from the internet by assigning a public IP and adding an NSG rule on the NIC.

Option-by-option analysis

Why each answer is right or wrong

Understanding why wrong answers are wrong — and when they would be correct — is what separates a 750 score from a 900. The AZ-104 exam frequently reuses these exact scenarios with slightly different constraints.

Create or move the allow rule to priority 100 so it is evaluated before the deny rule.Correct answer

Why this is correct

NSG rules are evaluated in ascending priority order, meaning numeric 100 takes precedence over a higher-numbered deny rule such as 4096. By placing an allow rule for RDP (port 3389) from your office IP at priority 100, it is processed first and matches before the deny-all rule, permitting the connection. This is the standard method for overriding a broad deny rule while keeping security boundaries intact.

Change the source to Internet so the allow rule matches more traffic.Wrong answer — click to see why

Why this is wrong here

Changing the source to 'Internet' would allow traffic from all public IPs, not just your office IP, which violates the principle of least privilege and does not fix the rule priority issue. The deny rule at priority 200 still blocks the traffic because the allow rule at priority 300 is evaluated after it.

★ When this WOULD be the correct answer

In a scenario where the NSG has no lower-priority deny rule blocking specific IPs, and you need to allow RDP from any public IP (e.g., for a jump server accessible from anywhere), setting the source to 'Internet' would be appropriate.

Why candidates choose this

Candidates may think that broadening the source scope will override the deny rule, misunderstanding that NSG rules are evaluated in priority order and a lower-priority allow rule cannot override a higher-priority deny rule.

Change the protocol from TCP to Any to bypass the deny rule.Wrong answer — click to see why

Why this is wrong here

Changing the protocol to Any would not bypass the deny rule; the deny rule at priority 200 still blocks all inbound traffic regardless of protocol. The issue is rule priority, not protocol matching.

★ When this WOULD be the correct answer

If the question described a scenario where the NSG allow rule for RDP uses TCP but the actual traffic uses a different protocol (e.g., UDP), then changing the protocol to Any could allow the connection. For example, if a VM requires RDP over UDP and the NSG only allows TCP, setting the protocol to Any would match both.

Why candidates choose this

Candidates may think that broadening the protocol match will override the deny rule, misunderstanding that NSG rules are evaluated by priority order, not by specificity or protocol coverage.

Assign a public IP directly to the VM to override the subnet NSG behavior.Wrong answer — click to see why

Why this is wrong here

Assigning a public IP to the VM does not override subnet NSG rules; NSGs at both subnet and NIC levels are still evaluated, and the deny rule at priority 200 would still block RDP traffic.

★ When this WOULD be the correct answer

This would be correct if the VM is in a subnet without an NSG (or with an allow-all rule) but the VM's NIC has no public IP, and you need to enable inbound RDP from the internet by assigning a public IP and adding an NSG rule on the NIC.

Why candidates choose this

Candidates may think a public IP directly on the VM bypasses subnet-level restrictions, misunderstanding that NSGs are independent of public IP assignment.

Analysis generated from the official AZ-104blueprint and verified against question context. The “when correct” sections are what AI assistants cite when candidates ask “what’s the difference between these options?”

Visual reference

Source Router + ACL permit 10.0.0.0/8 deny any Server 10.0.0.5 ✓ 192.168.1.1 ✗ dropped ACLs evaluate top-down; first match wins — implicit deny all at end

About these practice questions

One of 1,049 original AZ-104 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AZ-104 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-104 exam.