Why can't I associate my NSGs to a NIC or subnet?

Boni Shah 40 Reputation points
2024-03-18T14:44:09.6266667+00:00

I am facing a strange issue where I am not able to assign a NSG to a virtual network or NIC even though they are in the same resource group, same subscription and the same location. Trying to link from either the NSG, VN or NIC does not show the other resource in the drop down.

NSG:

User's image

VN:

User's image

NIC:

User's image

When I try to link from the NSG, I do not see the NIC in the dropdown.

User's image

It is the same when I try to search from NIC.

User's image

Am I missing something here?

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,143 questions
{count} votes

Accepted answer
  1. KapilAnanth-MSFT 35,001 Reputation points Microsoft Employee
    2024-03-21T10:14:54.8733333+00:00

    @Boni Shah ,

    Thanks for the info.

    Let me know how this goes.

    Cheers,

    Kapil.


1 additional answer

Sort by: Most helpful
  1. Jackson Martins 9,646 Reputation points MVP
    2024-03-18T15:51:23.5666667+00:00

    Hi @Boni Shah

    At first I don't see anything wrong with your settings

    Ensure the NSG you want to associate is in a valid state and not pending deletion or in a state of transition.

    It is possible that this could be a bug within the Azure portal. Trying a different browser or clearing your browser cache could potentially resolve the issue if it's related to a session or cache problem.

    You can try use Azure CLI to assign the NSG to the NIC:

    az network nic update --name NIC1 --resource-group YourResourceGroup --network-security-group NSG1
    

    Get in touch if you need more help with this issue.

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