In Azure, a network security group is an access control list (ACL), which allows and denies network traffic to subnets or an individual NIC. In this recipe, we will create a network security group with some basic rules for allowing web (HTTP and HTTPS) and SSH (port 22) traffic and denying the rest of the traffic. Since a network security group is the property of the network and not the virtual machine, we can use subnets to group our virtual machines and keep them in the same network security group for the same ACL.
Managing an Azure network security group
How to do it...
- Create a network security group:
- name: Create network security group
azure_rm_securitygroup:
resource_group: example
name: mysg01
purge_rules...