Reader small image

You're reading from  Azure Networking Cookbook, Second Edition - Second Edition

Product typeBook
Published inDec 2020
PublisherPackt
ISBN-139781800563759
Edition2nd Edition
Tools
Concepts
Right arrow
Author (1)
Mustafa Toroman
Mustafa Toroman
author image
Mustafa Toroman

Mustafa Toroman is a solution architect focused on cloud-native applications and migrating existing systems to the cloud. He is very interested in DevOps processes and cybersecurity, and he is also an Infrastructure as Code enthusiast and DevOps InstituteAmbassador. Mustafa often speaks at international conferences about cloud technologies. He has been an MVP for Microsoft Azure since 2016 and a C# Corner MVP since 2020. Mustafa has also authored several books about Microsoft Azure and cloud computing, all published by Packt.
Read more about Mustafa Toroman

Right arrow

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...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Azure Networking Cookbook, Second Edition - Second Edition
Published in: Dec 2020Publisher: PacktISBN-13: 9781800563759

Author (1)

author image
Mustafa Toroman

Mustafa Toroman is a solution architect focused on cloud-native applications and migrating existing systems to the cloud. He is very interested in DevOps processes and cybersecurity, and he is also an Infrastructure as Code enthusiast and DevOps InstituteAmbassador. Mustafa often speaks at international conferences about cloud technologies. He has been an MVP for Microsoft Azure since 2016 and a C# Corner MVP since 2020. Mustafa has also authored several books about Microsoft Azure and cloud computing, all published by Packt.
Read more about Mustafa Toroman