Creating rules with an NSG and an ASG
As a final step, we can use NSGs and ASGs to create new rules with better control. This approach allows us to have better control of traffic, limiting incoming traffic not only to a specific subnet but also only based on whether or not the resource is part of the ASG.
Getting ready
Before you start, open your browser and go to the Azure portal at https://portal.azure.com. Locate the previously created NSG.
How to do it...
To create a rule using both an ASG and an NSG, we must follow these steps:
- In the NSG pane, find Inbound security rules. Select Add to add a new rule.
- For the source, select Application Security Group, and then select the ASG you want to use as the source. We also need to provide parameters for Source, Source port ranges, Destination, Destination port ranges, Protocol, Action, Priority, Name, and Description. An example is shown in Figure 3.15:
Figure 3.15: Adding an inbound security rule