Least-privilege SQL1 firewall access for a private-IP VM

SC-500 By islever Editorial Last updated

Short answer

C Add an existing virtual network so the SQL1 firewall admits VM1's subnet under least privilege.

Question

You have an Azure subscription that contains an Azure SQL Database logical server named SQL1 and an Azure virtual machine named VM1. VM1 uses a private IP address only.
The Firewall and virtual networks settings for SQL1 are shown in the following exhibit.
Exhibit: Least-privilege SQL1 firewall access for a private-IP VM
You need to ensure that VM1 can connect to SQL1. The solution must use the principle of least privilege.
What should you do on the SQL1 Firewall and virtual network settings?
  1. Set Allow Azure services and resources to access this server to Yes.
  2. Create a new firewall rule.
  3. Add an existing virtual network. Correct Answer
  4. Set Connection Policy to Proxy.

Key Takeaways

The test is recognizing that a private-IP VM needs a VNet rule, not an IP firewall rule or the broad "Allow Azure services" toggle, which the least-privilege constraint rules out.

This SC-500 question tests how to let a private-IP Azure VM reach an Azure SQL Database logical server under least privilege. The correct choice is C: add an existing virtual network (a VNet rule) on SQL1's Firewall and virtual networks blade.

Common mistake: Option A is the tempting wrong answer: setting "Allow Azure services and resources to access this server" to Yes adds 0.0.0.0 and exposes SQL1 to every Azure IP, violating least privilege; option D only changes connection routing, not authorization.

Expert Analysis

What the exhibit implies: SQL1 is an Azure SQL Database logical server whose "Firewall and virtual networks" blade offers three levers: an IP firewall-rule list, the shared "Allow Azure services and resources to access this server" switch (currently set to No, i.e., 0.0.0.0 is not open), and the "Virtual networks" list where you add existing VNets/subnets as a VNet rule.

Why VM1 cannot use an IP rule: The question states VM1 uses a private IP address only. A SQL firewall rule is expressed as a start/end public IP range, so a rule built from VM1's private address will not match the source address that arrives at SQL1's endpoint — private traffic reaching the logical server is not identifiable by that IPv4 rule. The natural next move, then, is not a firewall rule.

Why C is correct: Adding an existing virtual network creates a VNet rule that permits traffic from VM1's subnet to reach the endpoint. This is the least-privilege mechanism on the blade: it scopes access to one named VNet/subnet instead of opening the server to every Azure tenant. Option C is therefore the right action.

Why the other options fail: Option A (Allow Azure services = Yes) inserts the 0.0.0.0 entry, which admits every Azure IP address and public endpoint — a textbook least-privilege violation and the classic trap in this question type. Option B (a new firewall rule) is the wrong rule type because the source is a private IP. Option D (Connection Policy = Proxy) changes only how the client establishes its session (redirect vs proxy) for management and connection routing; it does not grant network authorization and does not open SQL1 to VM1.

The adjacent knowledge this covers: this same blade also governs whether Microsoft Entra ID or managed identity connections are affected, and the scenario that would flip the answer is if VM1 had a public IP — then option B (a scoped firewall rule for that IP) would become the least-privilege choice, while option C would still be valid but no longer uniquely correct. Operationally, choosing A instead of C leaves the subscription wide open to any Azure-hosted workload, and choosing D instead of C simply fails the connectivity test while looking plausible.

Bottom line: The correct option is C.

Official Reference

https://learn.microsoft.com/azure/azure-sql/database/network-access-controls-overview

This link opens the official vendor documentation in a new tab.

Exam Strategy

On Azure SQL firewall questions, first classify the client's source address: a private IP means the answer must be a VNet rule, so scan options for "virtual network" before considering IP rules. Treat any option containing "Allow Azure services" or a 0.0.0.0-style blanket as an automatic least-privilege violation unless the question explicitly permits it. Finally, separate authorization options (firewall/VNet rules) from routing options such as Connection Policy or Redirect/Proxy, which never grant access by themselves.

Frequently Asked Questions

Why can't I add a firewall rule for VM1's private IP address?

SQL Database firewall rules are matched against public IPv4 source addresses, so a rule built from a private IP never matches the traffic arriving at the logical server. You must authorize the source VNet/subnet instead.

What does setting Allow Azure services and resources to access this server to Yes actually do?

It adds the 0.0.0.0 entry, permitting connections from any Azure IP address across all tenants. That is a broad, not least-privilege, grant and is the classic trap in this question.

Does changing the Connection Policy to Proxy let VM1 connect to SQL1?

No. Connection Policy only selects whether clients use the proxy or redirect endpoint for session routing; it does not authorize any network source and will not open SQL1 to VM1.

Community Votes

C
100%

100% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 1 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 1

  1. M15tin 👍 1 Answered C
    C. Agregar una red virtual existente. Explicación: VM1 utiliza únicamente una dirección IP privada, por lo que no puede conectarse a SQL1 mediante una regla de firewall basada en IP pública. Debes configurar una regla de red virtual (VNet rule) en SQL1 para permitir el acceso desde la subred donde se encuentra VM1.

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Practice All SC-500 Questions

Access 100 questions with complete answers and detailed explanations.

View Full SC-500 Practice Test →

← Back to SC-500 Study Guide