- A
Azure Application Gateway
Why wrong: Application Gateway is a layer 7 load balancer with Web Application Firewall (WAF) capabilities. It does not manage outbound traffic and is unnecessary for the stated requirement for simple per-VM rules.
- B
Azure Firewall
Why wrong: Azure Firewall is a stateful network firewall with advanced features. While it can perform this function, it is more complex and costly than needed for a single VM scenario.
- C
Network Security Group (NSG)
An NSG attached to the VM's subnet or NIC can allow inbound HTTP/HTTPS and default outbound internet access. It is simple, managed, and cost-effective.
- D
Azure Bastion
Why wrong: Azure Bastion provides secure RDP/SSH access to VMs. It does not handle HTTP/HTTPS traffic or any outbound internet access.
AZ-500 Secure networking Practice Question
This AZ-500 practice question tests your understanding of secure networking. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. A key principle to apply: nSGs filter network traffic at Layer 4 (TCP/UDP) based on rules.. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
You have an Azure virtual machine that hosts a web application. You need to allow inbound HTTP (80) and HTTPS (443) traffic from the internet to this VM only. You also need to allow outbound traffic to the internet from the VM. You want to use a managed Azure service with minimal configuration. What should you use?
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
Network Security Group (NSG)
A Network Security Group (NSG) is the correct choice because it is a managed Azure service that provides a stateful, layer-3/4 firewall for filtering inbound and outbound traffic to a virtual machine. With minimal configuration, you can create inbound rules to allow HTTP (TCP/80) and HTTPS (TCP/443) from the internet (source 'Internet' or 'Any') and an outbound rule to allow all traffic to the internet (default outbound rule already allows this). NSGs are directly associated with a VM's subnet or network interface, making them the simplest managed solution for this scenario.
Key principle: NSGs filter network traffic at Layer 4 (TCP/UDP) based on rules.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Azure Application Gateway
Why it's wrong here
Application Gateway is a layer 7 load balancer with Web Application Firewall (WAF) capabilities. It does not manage outbound traffic and is unnecessary for the stated requirement for simple per-VM rules.
- ✗
Azure Firewall
- ✓
Network Security Group (NSG)
- ✗
Azure Bastion
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates often overthink and choose Azure Firewall or Application Gateway for simple traffic filtering, forgetting that an NSG is the most lightweight, cost-effective, and minimal-configuration managed service for basic inbound/outbound access control on a single VM.
Trap categories for this question
Scenario analysis trap
Azure Firewall is a stateful network firewall with advanced features. While it can perform this function, it is more complex and costly than needed for a single VM scenario.
Detailed technical explanation
How to think about this question
NSGs are stateful, meaning that if you allow inbound traffic on port 80, the return outbound traffic is automatically permitted without an explicit outbound rule. By default, an NSG includes an outbound rule that allows all internet traffic, so no additional outbound rule is needed for the VM to reach the internet. In a real-world scenario, if you need to restrict outbound traffic to specific ports or IPs, you would add custom outbound rules, but the default rule suffices for the stated requirement.
KKey Concepts to Remember
- NSGs filter network traffic at Layer 4 (TCP/UDP) based on rules.
- NSGs can be associated with a VM's NIC or the subnet it resides in.
- Default outbound rules in NSGs allow internet access.
- NSGs are a cost-effective and simple solution for basic VM traffic control.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
NSGs filter network traffic at Layer 4 (TCP/UDP) based on rules.
Real-world example
How this comes up in practice
A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.
What to study next
Got this wrong? Here's your next step.
Review nSGs filter network traffic at Layer 4 (TCP/UDP) based on rules., then practise related AZ-500 questions on the same topic to reinforce the concept.
- →
Secure networking — study guide chapter
Learn the concepts, then practise the questions
- →
Secure networking practice questions
Targeted practice on this topic area only
- →
All AZ-500 questions
1,000 questions across all exam domains
- →
Microsoft Azure Security Engineer Associate AZ-500 study guide
Full concept coverage aligned to exam objectives
- →
AZ-500 practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related AZ-500 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Secure identity and access practice questions
Practise AZ-500 questions linked to Secure identity and access.
Secure compute, storage, and databases practice questions
Practise AZ-500 questions linked to Secure compute, storage, and databases.
Secure Azure using Microsoft Defender for Cloud and Microsoft Sentinel practice questions
Practise AZ-500 questions linked to Secure Azure using Microsoft Defender for Cloud and Microsoft Sentinel.
Manage identity and access practice questions
Practise AZ-500 questions linked to Manage identity and access.
Secure networking practice questions
Practise AZ-500 questions linked to Secure networking.
AZ-500 fundamentals practice questions
Practise AZ-500 questions linked to AZ-500 fundamentals.
AZ-500 scenario practice questions
Practise AZ-500 questions linked to AZ-500 scenario.
AZ-500 troubleshooting practice questions
Practise AZ-500 questions linked to AZ-500 troubleshooting.
Practice this exam
Start a free AZ-500 practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this AZ-500 question test?
Secure networking — This question tests Secure networking — NSGs filter network traffic at Layer 4 (TCP/UDP) based on rules..
What is the correct answer to this question?
The correct answer is: Network Security Group (NSG) — A Network Security Group (NSG) is the correct choice because it is a managed Azure service that provides a stateful, layer-3/4 firewall for filtering inbound and outbound traffic to a virtual machine. With minimal configuration, you can create inbound rules to allow HTTP (TCP/80) and HTTPS (TCP/443) from the internet (source 'Internet' or 'Any') and an outbound rule to allow all traffic to the internet (default outbound rule already allows this). NSGs are directly associated with a VM's subnet or network interface, making them the simplest managed solution for this scenario.
What should I do if I get this AZ-500 question wrong?
Review nSGs filter network traffic at Layer 4 (TCP/UDP) based on rules., then practise related AZ-500 questions on the same topic to reinforce the concept.
What is the key concept behind this question?
NSGs filter network traffic at Layer 4 (TCP/UDP) based on rules.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 11, 2026
This AZ-500 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-500 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.