The task is to modify an Azure Network Security Group Rule.
I am all OK there (using az network nsg rule update ), provided the name of the NSG and the actual Rule.
But what I want to do is edit that rule with the VM Name (subscription ID, RG name and Rule name are already known and will be explicit) as the input parameter.
I am using az (not Az) commands.
What I see is az vm show, but it doesn't show which NSG the VM is connected to.
I would like to ask how to get the NSG name where a VM is associated, using CLI. Straight answers, guides or links to resources will all be appreciated.
Thank you and thanks in advance!