Connecting Azure to Your Network: VPN Gateway, ExpressRoute, Network Security Groups, Firewall and Private Endpoints
Connecting to Azure
| Option | How | Notes |
|---|---|---|
| Site-to-site VPN | Encrypted tunnel over the public internet between your office and Azure (VPN Gateway) | Cheaper, quicker to set up. Speed varies with internet |
| Point-to-site VPN | One computer connects to Azure | Good for remote workers |
| ExpressRoute | Private dedicated connection through a connectivity provider | Does not use the public internet. More reliable, faster, more private, higher cost |
Exam tip Public internet VPN = cheap. Private dedicated line = ExpressRoute.
Network Security Groups (NSG)
- A basic firewall with allow/deny rules for traffic to and from resources
- Attach to a subnet or a network interface
- A rule has a priority (lower number is checked first), source, destination, port, protocol and action
| Priority | Name | Port | Action |
|---|---|---|---|
| 100 | Allow-HTTPS | 443 | Allow |
| 200 | Allow-SSH-from-office | 22 | Allow (only office IP) |
| 65500 | DenyAllInbound | Any | Deny (default) |
Azure Firewall
- A managed, cloud-based firewall with built-in high availability
- Filters traffic by application (FQDN names) and network rules, and can use threat intelligence
- Use for central control of many VNets. NSG is simpler and per subnet or NIC
Other Protection
| Service | Purpose |
|---|---|
| DDoS Protection | Defends against floods of traffic that try to take your app down |
| Azure Bastion | Connect to VMs from the portal over HTTPS with no public IP on the VM |
| Web Application Firewall (WAF) | Blocks common web attacks like SQL injection. Works with Application Gateway and Front Door |
Private Endpoints
- Give an Azure service (like a storage account or SQL database) a private IP inside your VNet
- Traffic stays on the Microsoft network and the service can be closed to the internet
- Used for secure access to PaaS services
Practice
- Which connects to Azure privately without the internet: VPN or ExpressRoute?
- What does an NSG do?
- How can you reach a VM without giving it a public IP?
Conclusion
Use VPN Gateway for encrypted internet-based links and ExpressRoute for private dedicated connections. Protect with NSGs, Firewall, DDoS Protection, Bastion and private endpoints.
Quick Summary: connecting; NSG; firewall; other protection; private endpoints.

