Setting the file. One moment.
Chapter 15 · Azure Diagnostics
Subchapter 15.29
troubleshooting/compute/references/firewall-blocking.mdMarkdown2 KBView on GitHub
Use when NSG/platform rules allow traffic but the guest OS firewall blocks RDP/SSH.
| Symptom | OS | Action | Docs |
|---|---|---|---|
| Windows Firewall blocks RDP | Windows | Enable Remote Desktop firewall group | Guest firewall (opens in a new tab) |
| BlockInboundAlways or bad policy | Windows | Reset to blockinbound,allowoutbound | Firewall rule (opens in a new tab) |
| third-party AV/firewall | Windows | Stop for test, then reconfigure | Guest firewall (opens in a new tab) |
| iptables/nftables blocks SSH | Linux | Insert allow rule or remove blocking chain | SSH overview (opens in a new tab) |
| firewalld blocks SSH | Linux | Open SSH service in active zone | SSH overview (opens in a new tab) |
| UFW blocks SSH | Linux | ufw allow 22/tcp or disable temporarily | SSH overview (opens in a new tab) |
| no guest access | Any | Use Serial Console or offline repair | Offline firewall (opens in a new tab) / Linux repair (opens in a new tab) |
Commands use VM agent/extensions. Run Pre-Flight Safety Checks first.
# Windows
az vm user reset-remote-desktop --name <vm> -g <rg>
az vm run-command invoke --name <vm> -g <rg> --command-id RunPowerShellScript \
--scripts "netsh advfirewall firewall set rule group='Remote Desktop' new enable=yes"
# Linux
az vm run-command invoke --name <vm> -g <rg> --command-id RunShellScript \
--scripts "iptables -L -n; iptables -I INPUT -p tcp --dport 22 -j ACCEPT"
az vm run-command invoke --name <vm> -g <rg> --command-id RunShellScript \
--scripts "firewall-cmd --add-service=ssh --permanent && firewall-cmd --reload"
az vm run-command invoke --name <vm> -g <rg> --command-id RunShellScript \
--scripts "ufw status; ufw allow 22/tcp"