VNets in Azure can be managed using various tools, including the Azure portal. The fact is that, for some people, the portal is the easiest way to use Azure, as they are used to graphic tools and the UI really helps them understand what is going on or how to use a particular feature.
To create a peering (which will allow you to access a network from another network) from the portal, you can go through the following instructions:
- In the Settings section, you will find a Peerings blade:
- Initially, you should not see any available peering for your network (I am assuming that you are doing this on a new VNet). To create a new connection, click on the + Add button:
- In the displayed form, you will have to enter all the required information regarding the connection. Before we dig deeper into the available options, look at my configuration:
Using the default options should suffice for the most common scenarios (put simply, scenarios that do not require external communication or need you to disable external communication); however, you may want to consider additional options here:
- Allow virtual network access: By default, two peered networks can communicate with each other. With this option, you can change the behavior so that communication will be disallowed.
- Allow forwarded traffic: If you want to allow external communication (not originating from the peer) to access your VNet, check this checkbox.
- Allow gateway transit: When you want to use VNet gateways, you can allow the peer to use another peer gateway. With this option, you have to make sure that the peer does not use a gateway already.
- Use remote gateways: This option is the opposite of the previous one. Use it if you want to use the gateway of the peer.
When everything is set, you can click the OK button and wait until the peering is created.
Let’s now try to use the CLI to do the same operation without accessing the portal.