Book Image

Azure Networking Cookbook, Second Edition - Second Edition

By : Mustafa Toroman
Book Image

Azure Networking Cookbook, Second Edition - Second Edition

By: Mustafa Toroman

Overview of this book

Azure's networking services enable organizations to manage their networks effectively. With the Azure Networking Cookbook, you’ll see how Azure paves the way for an enterprise to achieve reliable performance and secure connectivity. This updated second edition will take you through the latest networking features in Azure. The book starts with an introduction to Azure networking, covering basics such as creating Azure virtual networks, designing address spaces, and creating subnets. You’ll create and manage network security groups, application security groups, and IP addresses in Azure using easy-to-follow recipes. As you progress through the book, you’ll explore various aspects such as DNS and routing, load balancers, Traffic Manager, and site-to-site, point-to-site, and VNet-to-VNet connections. This cookbook covers all the functions crucial to understanding cloud networking practices and being able to plan, implement, and secure your network infrastructure with Azure. You’ll not only upscale your current environment but also get well-versed with monitoring, diagnosing, and ensuring secure connectivity. The book will help you grasp best practices as you learn how to create a robust environment. By the end of this Azure cookbook, you’ll have gained hands-on experience developing cost-effective solutions that can facilitate efficient connectivity in your organization.
Table of Contents (15 chapters)
14
Index

Adding a subnet with PowerShell

When creating an Azure virtual network with PowerShell, a subnet is not created in the same step and requires an additional command to be executed separately.

Getting ready

Before creating a subnet, we need to collect information about the virtual network that the new subnet will be associated with. The parameters that need to be provided are the name of the virtual network and the resource group that the virtual network is located in:

$VirtualNetwork = Get-AzVirtualNetwork -Name 'Packt-Script' -ResourceGroupName 'Packt-Networking-Script'

How to do it…

  1. To add a subnet to the virtual network using PowerShell, we need to execute a command and provide the name and address prefix. The address prefix is again in CIDR format:
    Add-AzVirtualNetworkSubnetConfig -Name FrontEnd -AddressPrefix 10.11.0.0/24 -VirtualNetwork $VirtualNetwork
  2. We need to confirm these changes by executing the following command:
    $VirtualNetwork...