which will override the other,Azure NSG on the subnet or NSG on the VM?

Mohamed Ashraf 21 Reputation points
2020-07-08T07:12:43.507+00:00

If I have NSG on the subnet and this subnet is associated with VM, and this VM also has its NSG.In this case which NSG will override the other?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,158 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Andreas Baumgarten 96,926 Reputation points MVP
    2020-07-08T08:22:12.437+00:00

    This is described here:

    How traffic is evaluated

    For inbound traffic, Azure processes the rules in a network security group associated to a subnet first, if there is one, and then the rules in a network security group associated to the network interface, if there is one.

    For outbound traffic, Azure processes the rules in a network security group associated to a network interface first, if there is one, and then the rules in a network security group associated to the subnet, if there is one.

    Maybe this is helpful.

    Regards

    Andreas Baumgarten

    (Please don't forget to Accept as answer if the reply is helpful)

  2. Moamen Hany 1,091 Reputation points MVP
    2020-08-07T22:29:37.317+00:00

    The most restriction will be applied, as both will effects.

    (Please don't forget to Accept as answer if the reply is helpful)
    http://www.moamenhany.com

    2 people found this answer helpful.