Complete the code to enable Network Watcher in a specific Azure region.
az network watcher configure --locations [1] --enabled trueThe --locations parameter specifies the Azure region where Network Watcher is enabled. Here, westus2 is used as an example region.
Complete the code to start a packet capture session on a VM's network interface.
az network watcher packet-capture create --resource-group MyResourceGroup --vm [1] --name MyPacketCapture --time-limit 60
The --vm parameter requires the name of the virtual machine where the packet capture will run.
Fix the error in the command to check IP flow verify between source and destination.
az network watcher [1] --resource-group MyResourceGroup --vm MyVM --direction Outbound --local-port 80 --remote-port 443 --protocol Tcp
The ip-flow-verify command checks if traffic is allowed or denied between source and destination IP addresses and ports.
Fill both blanks to create a flow log for a Network Security Group (NSG) with logging enabled and retention set.
az network watcher flow-log create --resource-group MyResourceGroup --nsg [1] --enabled [2] --retention 7
The --nsg parameter requires the NSG name, and --enabled should be set to true to activate flow logging.
Fill all three blanks to list all Network Watcher resources in a subscription filtered by location and status.
az network watcher list --query "[?location=='[1]' && provisioningState=='[2]'].[3]"
The query filters Network Watchers by location and provisioningState, then selects the name property to list their names.