AZ-104 Implement and Manage Virtual Networking Practice Question
A web app running on an Azure VM must connect to an Azure SQL Database instance. The security team requires the database to be reachable through a private IP inside the VNet, and the application should keep using the normal SQL server name without any connection string change. What should the administrator implement?
⚠ Common exam trap
A common mix-up: candidates confuse service endpoints (which still use public IPs) with private endpoints (which use private IPs), leading them to choose Option A, thinking it provides private IP connectivity when it only provides source subnet restriction via the public endpoint.
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
✓
A private endpoint for Azure SQL and the corresponding private DNS zone linked to the VNet.
A private endpoint assigns Azure SQL Database a private IP from the VNet, making it reachable via a private IP while preserving the normal SQL server FQDN. The corresponding private DNS zone (privatelink.database.windows.net) linked to the VNet ensures that DNS resolution of the SQL server name resolves to the private IP, so no connection string changes are needed. This meets the security requirement of private IP reachability and the application requirement of unchanged connection strings.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
A service endpoint on the subnet and a firewall rule on the SQL server.
Why it's wrong here
Service endpoints do not create a private IP address for Azure SQL; they only route traffic from the selected subnet over the Azure backbone to the service's public endpoint while the firewall rule restricts source subnets. The SQL logical server's DNS name still resolves to a public IP, so the connection string remains unchanged but the path is not truly private, and the requirement for private name resolution inside the VNet is unfulfilled. A private endpoint with private DNS zone accomplishes both.
When this WOULD be correct
If the requirement was only to restrict access to the SQL server from a specific VNet without needing a private IP or keeping the same connection string, a service endpoint on the subnet combined with a firewall rule on the SQL server would be correct.
- ✓
A private endpoint for Azure SQL and the corresponding private DNS zone linked to the VNet.
Why this is correct
A private endpoint gives the SQL service a private IP address inside the VNet, and the private DNS zone allows the standard SQL name to resolve to that address. This meets both requirements: private network access and no connection string change. It is the correct Azure Private Link pattern for secure PaaS access.
- ✗
A public endpoint with selected network access and a network security group on the VM subnet.
Why it's wrong here
Enabling the public endpoint with selected network access still leaves the SQL logical server reachable via its public DNS name and public IP; any firewall rule is just an IP allow-list, and traffic outside those IPs is blocked, but the service itself is not within the VNet and has no private IP. An NSG on the VM subnet only filters traffic to and from the VM; it cannot secure the PaaS service's network endpoint or stop external clients from attempting connections to the database. This approach neither provides private connectivity nor private name resolution, so it fails the requirements.
When this WOULD be correct
This option would be correct if the requirement was to restrict access to the SQL server from specific public IP addresses while still using the public endpoint, and the application could tolerate internet exposure (e.g., for a non-production environment).
- ✗
A virtual network peering connection to the SQL service subnet.
Why it's wrong here
VNet peering connects two virtual networks at the network layer, but Azure SQL Database is a managed PaaS service that does not reside inside a peered 'SQL service subnet' in your topology. Peering could reach a VM running SQL, but not the platform database endpoint. A private endpoint is required to inject SQL's logical server into your VNet with a private IP, while peering alone leaves SQL's public DNS name exposed.
When this WOULD be correct
An administrator needs to connect two VNets in different regions to allow resources in one VNet to communicate with resources in the other VNet using private IPs, without requiring a VPN gateway or transitive routing.
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.
✓A private endpoint for Azure SQL and the corresponding private DNS zone linked to the VNet.Correct answer▾
Why this is correct
A private endpoint gives the SQL service a private IP address inside the VNet, and the private DNS zone allows the standard SQL name to resolve to that address. This meets both requirements: private network access and no connection string change. It is the correct Azure Private Link pattern for secure PaaS access.
✗A service endpoint on the subnet and a firewall rule on the SQL server.Wrong answer — click to see why▾
Why this is wrong here
A service endpoint does not provide a private IP for the SQL server; the SQL server still uses its public endpoint, and the connection string would need to change to use the private IP, violating the requirement to keep the normal SQL server name without connection string changes.
★ When this WOULD be the correct answer
If the requirement was only to restrict access to the SQL server from a specific VNet without needing a private IP or keeping the same connection string, a service endpoint on the subnet combined with a firewall rule on the SQL server would be correct.
Why candidates choose this
Candidates may confuse service endpoints with private endpoints, thinking both provide private connectivity, and overlook the requirement to keep the same connection string without changes.
✗A public endpoint with selected network access and a network security group on the VM subnet.Wrong answer — click to see why▾
Why this is wrong here
A public endpoint with selected network access still exposes the SQL server to the internet, failing the requirement for private IP reachability. Additionally, using a network security group on the VM subnet does not provide a private IP for the SQL server; it only controls traffic to/from the subnet.
★ When this WOULD be the correct answer
This option would be correct if the requirement was to restrict access to the SQL server from specific public IP addresses while still using the public endpoint, and the application could tolerate internet exposure (e.g., for a non-production environment).
Why candidates choose this
Candidates may think that selected network access and NSGs provide sufficient security and private connectivity, misunderstanding that the public endpoint still uses a public IP and that NSGs do not change the endpoint type.
✗A virtual network peering connection to the SQL service subnet.Wrong answer — click to see why▾
Why this is wrong here
VNet peering connects two VNets, but Azure SQL Database is a PaaS service not hosted in a VNet subnet, so peering does not provide private connectivity to SQL. The requirement is for private IP access without connection string changes, which peering cannot achieve.
★ When this WOULD be the correct answer
An administrator needs to connect two VNets in different regions to allow resources in one VNet to communicate with resources in the other VNet using private IPs, without requiring a VPN gateway or transitive routing.
Why candidates choose this
Candidates may think VNet peering can connect any Azure resource privately, misunderstanding that peering only links VNets, not PaaS services like Azure SQL.
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
Go deeper
Related to this question
Learn chapter
Managed Identities for Azure Resources
Key term
DNS zone
A DNS zone is a distinct part of the global Domain Name System (DNS) namespace that is delegated to a specific administrator or organization for management, containing resource records for a domain.
Key term
Azure SQL Database
Azure SQL Database is a fully managed relational database-as-a-service (DBaaS) in Microsoft Azure, based on the SQL Server engine, that handles scaling, backups, patching, and high availability automatically.
About these practice questions
This AZ-104 question is part of Courseiva's 1,049-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 →
Same concept, more angles
4 more ways this is tested on AZ-104
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. An app on a VM must connect to Azure SQL Database without using the public endpoint. The database name must resolve to a private IP inside the VNet, and public network access should be disabled. Which two actions should the administrator take? Select two.
medium- ✓ A.Create a private endpoint for the Azure SQL server in the VNet.
- ✓ B.Link the private DNS zone for the SQL private link domain to the VNet.
- C.Enable a service endpoint for Microsoft.Sql on the subnet.
- D.Grant the VM's managed identity Reader on the SQL server.
- E.Keep public network access enabled and restrict the firewall to the VNet.
Why A: A private endpoint assigns the Azure SQL Database server a private IP address from the VNet, allowing the VM to connect without using the public endpoint. This ensures traffic stays within the Microsoft backbone and the database name resolves to a private IP inside the VNet.
Variation 2. A VM in VNet-Prod must connect to Azure SQL Database over a private IP address, and the VM should resolve the server name automatically without manual DNS entries. Which three actions are required? Select three.
hard- ✓ A.Create a private endpoint for the Azure SQL server in VNet-Prod.
- ✓ B.Create the private DNS zone privatelink.database.windows.net.
- ✓ C.Link the private DNS zone to VNet-Prod.
- D.Enable a service endpoint for Microsoft.Sql on the subnet instead of using a private endpoint.
- E.Leave public network access enabled and add the VNet as an allowed firewall rule.
Why A: A private endpoint assigns a private IP address from VNet-Prod to the SQL server. To resolve the server name automatically, create the private DNS zone privatelink.database.windows.net and link it to VNet-Prod. Service endpoints do not provide a private IP, and leaving public network access enabled with a firewall rule does not meet the private IP requirement.
Variation 3. A workload in a VNet must connect to Azure SQL Database over a private IP address, and the database must not be reachable through its public endpoint. Users should still connect by using the normal server name. What should you configure?
medium- A.A service endpoint on the subnet and a public firewall rule on the SQL server.
- ✓ B.A private endpoint for Azure SQL Database and a private DNS zone linked to the VNet.
- C.A network security group rule that denies all public internet traffic to the subnet.
- D.A NAT gateway on the subnet so the SQL connection uses a private source address.
Why B: A private endpoint assigns Azure SQL Database a private IP address from the VNet, making it accessible over a private connection. By creating a private DNS zone linked to the VNet, the normal server name resolves to that private IP, allowing users to connect without using the public endpoint. However, to ensure the database is not reachable via its public endpoint, you must also set the SQL server's Public network access to Disabled. The private endpoint alone does not automatically disable public access.
Variation 4. You create a private endpoint for an Azure SQL Database server. Virtual machines in VNet-Prod must resolve the server name to the private IP address of the endpoint. What should you configure?
medium- ✓ A.A private DNS zone linked to VNet-Prod
- B.A user-defined route on the subnet
- C.An additional public IP address
- D.A Recovery Services vault
Why A: A private endpoint uses a private IP address from your VNet, but DNS resolution must be configured to map the Azure SQL Database server name (e.g., `server.database.windows.net`) to that private IP. By creating a private DNS zone (privatelink.database.windows.net) and linking it to VNet-Prod, Azure automatically creates an A record for the private endpoint, ensuring VMs resolve the server name to the private IP instead of the public IP. This is the standard and required configuration for private endpoint name resolution.
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.