Cannot connect to VM without NSG

Mateusz U 61 Reputation points
2022-09-15T23:37:45.323+00:00

Hey,
I noticed a strange behaviour (tested in North Europe and Central US) that goes against what docs say (that VM without any NSG on vm/subnet should have open access).

My situation:

  1. Created VNet
  2. Created Subnet without NSG
  3. Created VM in subnet created above without NSG (linux). Tested that connecting to ssh(22)/www(80) works from other VM in that network.
  4. Two approaches tested:
    a) Created public ip for that VM and tried to connect
    b) Created a load balancer with 2VMs and balancing on port 80
  5. The result indicates that VMs without any NSG are unreachable:
    a) single VM with single public ip is unreachable on port 22. After adding NSG allowing 22 starts to work. After disassociating stops to work
    b) 2VMs brhing load balancer work flawlessly only when they have NSGs assigned that allow port 22 (tested with NSG on NIC, none on subnet). After disassociating NSG from one of the VM's NIC this particular VM stops being reachable. The backend pool is still healthy (checked metrics and also when hitting F5 in browser it randomly hangs suggesting that it tries to hit VM without NSG, VM with NSG works when it gets picked).

Overall it seems like default NSG is applied underneath when there is no NSG applied in configuration (because somehow only load balancer health checks go through).

Is this some new change in Azure that did not yet get reflected in the docs ?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,790 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,401 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jackson Martins 10,151 Reputation points MVP
    2022-09-15T23:41:55.767+00:00

    Hi @Mateusz U
    you are probably using Standard IP and it is blocked by default, if you use Basic Public IP you wouldn't need NSG

    241579-image.png

    Reference: https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/public-ip-addresses#sku
    Get in touch if you need more help with this issue.

    --please don't forget to "[Accept the answer]" if the reply is helpful--

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.