Back to Azure Bicep templates index <–
![]()
A network security group (NSG) includes rules that allow or deny traffic to a virtual network subnet, network interface, or both.
Template Locations
Online documentation
Template reference
Service description
Requirements
- Resource group must been created with a valid name and location.
Input values
- tagBillingIdentifier : Cost Center.
- nsgCustomName :Name to use for the Network Security Group.
- rgLocation : The Azure Region that the resource should be created. Defaults to the current resource groups location.
- securityRules: Array of the security rules that should be applied to the Network Security Group.
Output values
- NsgName : The name of the created Network Security Group.
- NsgId : The resource Id of the created Network Security Group.
Additional information
A network security group (NSG) includes rules that allow or deny traffic to a virtual network subnet, network interface, or both based on the priority of the rule.
A network security group contains several default security rules that allow or deny traffic to or from resources. A network security group can be associated to a network interface, the subnet the network interface is in, or both. Best practices require that a subnet be associated with a Network Security Group.