az network watcher flow-log configure
az network watcher flow-log configure --resource-group <resource-group-name> --nsg <nsg-name> --enabled true
az network nsg rule create
az network nsg rule create --resource-group <resource-group-name> --nsg-name <nsg-name> --name <rule-name> --priority <priority-value> --source-address-prefix <source-address> --destination-address-prefix <destination-address> --destination-port-range <port-range> --access <access-type> --protocol <protocol>
az network ddos-protection update
az network ddos-protection update --resource-group <resource-group-name> --name <virtual-network-name> --ddos-protection-plan <ddos-protection-plan-name> --enabled true
<resource-group-name>
, <nsg-name>
, <rule-name>
, <priority-value>
, <source-address>
, <destination-address>
, <port-range>
, <access-type>
, <protocol>
, <virtual-network-name>
, and <ddos-protection-plan-name>
with the appropriate values specific to your Azure environment.
azure.mgmt.network
package to retrieve the NSG resource.enable_flow_logs
property to True
.network_client.network_security_groups.create_or_update
method.azure.mgmt.network
package to retrieve the NSG resource.security_rules
list.network_client.network_security_groups.create_or_update
method.azure.mgmt.network
package to retrieve the NSG resource.network_client.network_security_groups.create_or_update
method.