Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Azure Networking Cookbook
Azure Networking Cookbook

Azure Networking Cookbook: Practical recipes to manage network traffic in Azure, optimize performance, and secure Azure resources

eBook
€8.99 €23.99
Paperback
€29.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Azure Networking Cookbook

Azure Virtual Network

In this very first chapter, you will learn about the basics of Azure networking, including creating Azure Virtual Networks, designing address spaces, and subnets. This will lay the foundation for all future recipes that we'll cover in this book.

We will cover the following recipes in this chapter:

  • Creating a virtual network in the portal
  • Creating a virtual network with PowerShell
  • Adding a subnet in the portal
  • Adding a subnet with PowerShell
  • Changing the address space size
  • Changing the subnet size

Technical requirements

Creating a virtual network in the portal

Azure Virtual Network represents your local network in the cloud. It enables other Azure resources to communicate over a secure private network without exposing endpoints over the internet.

Getting ready

How to do it...

In order to create a new virtual network using the Azure portal, use the following steps:

  1. In the Azure portal, select Create a resource and choose Virtual network under Networking services (or, search for virtual network in the search bar).
  2. A new blade will open where we need to provide information for the virtual network to include Name, define Address space, select the Subscription option we want to use, select the Resource group option for where the virtual network will be deployed, select Location (Azure data center) for where the virtual network will be deployed, and define Name and Address range for the first subnet. We also have the option to select what kind of DDoS protection we want to use and if we want to use the Firewall option; an example is shown in the following screenshot:
  1. Creating a virtual network usually doesn't take much time and should be completed in under two minutes. Once deployment is finished, you can start using the virtual network.

How it works...

We deploy virtual networks to Resource group under Subscription in the Azure data center that we choose. Location and Subscription are important parameters; we will only be able to attach Azure resources to this virtual network if they are in the same subscription and region (as the Azure data center). The Address space option defines the number of IP addresses that will be available for our network. It uses the Classless Inter-Domain Routing (CIDR) format and the largest range we can choose is /8. In the portal, we need to create an initial subnet and define the subnet address range. The smallest subnet allowed is /29 and the largest is /8 (however, this can't be larger than the virtual network range).

Creating a virtual network with PowerShell

PowerShell is a command-line shell and scripting language based on the .NET Framework. It's often used by system administrators to automate tasks and manage operating systems. Azure PowerShell is a PowerShell module that allows us to automate and manage Azure resources. Azure PowerShell is also very often used to automate deployment tasks and can also be used to deploy a new Azure Virtual Network.

Getting ready

Before we start, we need to connect to the Azure subscription from a PowerShell console. Here's the command to do this:

Connect-AzureRmAccount

This will open a new window where we need to input the credentials for the Azure subscription.

Afterward, we need to create a resource group where our virtual network will be deployed:

New-AzureRmResourceGroup -name 'Packt-Networking-Script' -Location 'westeurope'

The output should be similar to the following screenshot:

How to do it...

Deploying Azure Virtual Network is done in a single script. We need to define parameters for the resource group, location, name, and address range. Here is an example script:

New-AzureRmVirtualNetwork -ResourceGroupName 'Packt-Networking-Script' -Location 'westeurope' -Name 'Packt-Script' -AddressPrefix 10.11.0.0/16

You should receive the following output:

How it works...

The difference between deploying of a virtual network from the portal and using PowerShell is that no subnet needs to be defined in PowerShell. The subnet is deployed in a separate command that can be executed either when you are deploying a virtual network or later on. We are going to see this command in the Adding subnets with PowerShell recipe.

Adding a subnet in the portal

Beside adding subnets while creating a virtual network, we can add additional subnets to our network at any time.

Getting ready

Before you start, open a web browser and go to the Azure portal at https://portal.azure.com. Here, locate the previously created virtual network.

How to do it...

In order to add a subnet to a virtual network using the Azure portal, we must use the following steps:

  1. In the virtual network blade, go to the Subnets section.
  2. Select the Add subnet option.
  1. A new blade will open. We need to provide information for the subnet, including Name and Address range in the CIDR format. Address range must be in the range limit of the virtual network address range and cannot overlap with the address range of other subnets in the virtual network. Optionally, we can add information for Network security group, Route tables, Service endpoints, and Subnet delegation. These options will be covered in later recipes:
  2. We can also add a gateway subnet in the same blade. To add a gateway subnet, select the Gateway subnet option.

For a gateway subnet, the only parameter we need to define is Address range. The same rules apply as for adding a regular subnet. This time, we don't have to provide a name as it's already defined. You can add only one gateway subnet per virtual network. Service endpoints are not allowed in the gateway subnet:

  1. After the subnets are added, we can see the newly created subnets in the subnet blade under the virtual network:

How it works...

A single virtual network can have a multiple number of subnets defined. Subnets can't overlap and must be in the range of the virtual network address range. For each subnet, four IP addresses are used for management and can't be used. Depending on the network settings, we can define the communication rules between subnets in the virtual network. A gateway subnet is used for VPN connections, and this will be covered in later chapters.

Adding a subnet with PowerShell

When creating 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-AzureRmVirtualNetwork -Name 'Packt-Script' -ResourceGroupName 'Packt-Networking-Script'

How to do it...

  1. To add a subnet to the virtual network, we need to execute a command and provide the name and address prefix. The address prefix is again in CIDR format:
Add-AzureRmVirtualNetworkSubnetConfig -Name FrontEnd -AddressPrefix 10.11.0.0/24 -VirtualNetwork $VirtualNetwork
  1. We need to confirm these changes by executing the following:
$VirtualNetwork | Set-AzureRmVirtualNetwork
  1. We can add an additional subnet by running all commands in a single step, as follows:
$VirtualNetwork = Get-AzureRmVirtualNetwork -Name 'Packt-Script' -ResourceGroupName 'Packt-Networking-Script'
Add-AzureRmVirtualNetworkSubnetConfig -Name BackEnd -AddressPrefix 10.11.1.0/24 -VirtualNetwork $VirtualNetwork
$VirtualNetwork | Set-AzureRmVirtualNetwork

How it works...

The subnet is created and added to the virtual network, but we need to confirm the changes before they can become effective. All the rules when creating or adding subnet size using the Azure portal apply here as well; the subnet must be within the virtual network's address space and cannot overlap with other subnets in the virtual network. The smallest subnet allowed is /29, and the largest is /8.

There's more...

We can create and add multiple subnets in a single script, as follows:

$VirtualNetwork = Get-AzureRmVirtualNetwork -Name 'Packt-Script' -ResourceGroupName 'Packt-Networking-Script'
$FrontEnd = Add-AzureRmVirtualNetworkSubnetConfig -Name FrontEnd -AddressPrefix 10.11.0.0/24 -VirtualNetwork $VirtualNetwork
$BackEnd = Add-AzureRmVirtualNetworkSubnetConfig -Name BackEnd -AddressPrefix 10.11.1.0/24 -VirtualNetwork $VirtualNetwork
$VirtualNetwork | Set-AzureRmVirtualNetwork

Changing the address space size

After the initial address space is defined during the creation of a virtual network, we can still change the address space size as needed. We can either increase or decrease the size of the address space, or change the address space completely by using a new address range.

Getting ready

How to do it...

In order to change the address space size for a virtual network using the Azure portal, we must observe the following steps:

  1. In a virtual network blade, locate Address space under Settings.
  2. In the available address space, click on Address space and change the value. An example is shown in the following screenshot:

  1. After you have entered a new value for Address space, click Save to apply the changes.

How it works...

Although you can change the address space at any time, there are some rules that determine what you can or cannot do. Address space can't be decreased if you have subnets defined in the address space that wouldn't be covered by a new address space. For example, if the address space was in the range of 10.0.0.0/16, it would cover addresses from 10.0.0.1 to 10.0.255.254. If one of the subnets was defined as 10.0.255.0/24, we wouldn't be able to change the virtual network to 10.0.0.0/17, as this will leave the subnet outside the new space.

Address space can't be changed to the new address space if you have subnets defined. In order to completely change the address space, you need to remove all subnets first. For example, if we have the address space defined as 10.0.0.0/16, we wouldn't be able to change it to 10.1.0.0/16, since having any subnets in the old space would leave them in an undefined address range.

Changing the subnet size

Similar to the virtual network address space, we can change the size of a subnet at any time.

Getting ready

How to do it...

In order to change subnet size using the Azure portal, we must use the following steps:

  1. In a virtual network blade, select the Subnets option.
  2. Select the subnet you want to change.
  3. In the Subnets option, enter a new value for the subnet size under Address range. An example of how to do this is shown in the following screenshot:
  1. After entering a new value, click on Save.
  2. In the Subnets list, you can see the changes applied and the address space has changed, as shown in the following screenshot:

How it works...

When changing subnet size, there are some rules that must be followed. You can't change the address space if it's not within the virtual network address space range and the subnet range can't overlap with other subnets in a virtual network. If devices are assigned to this subnet, you can't change the subnet to exclude the addresses that these devices are already assigned to.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Quickly get up and running with Azure networking solutions
  • Level-up your cloud networking skills by planning, implementing, configuring, and securing your infrastructure network with Azure
  • Leverage Azure networking services to provide applications highly available and fault tolerant environment

Description

Microsoft provides organizations with an effective way of managing their network with Azure's networking services. No matter the size of your organization, Azure provides a way to highly reliable performance and secure connectivity with its networking services. The book starts with an introduction to the Azure networking like creating Azure virtual networks, designing address spaces and subnets. Then you will learn to create and manage network security groups, application security groups, and IP addresses in Azure. Gradually, we move on to various aspects like S2S, P2S, and Vnet2Vnet connections, DNS and routing, load balancers and traffic manager. This book will cover every aspect and function required to deliver practical recipes to help readers learn from basic cloud networking practices to planning, implementing, and securing their infrastructure network with Azure. Readers will not only be able to upscale their current environment but will also learn to monitor, diagnose, and ensure secure connectivity. After learning to deliver a robust environment readers will also gain meaningful insights from recipes on best practices. By the end of this book, readers will gain hands-on experience in providing cost-effective solutions that benefit organizations.

Who is this book for?

This book is targeted towards cloud architects, cloud solution providers, or any stakeholders dealing with networking on the Azure cloud. Some prior understanding of Microsoft Azure will be a plus point.

What you will learn

  • Learn to create Azure networking services
  • Understand how to create and work on hybrid connections
  • Configure and manage Azure network services
  • Learn ways to design high availability network solutions in Azure
  • Discover how to monitor and troubleshoot Azure network resources
  • Learn different methods of connecting local networks to Azure virtual networks

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 30, 2019
Length: 234 pages
Edition : 1st
Language : English
ISBN-13 : 9781789807707
Vendor :
Microsoft
Concepts :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Mar 30, 2019
Length: 234 pages
Edition : 1st
Language : English
ISBN-13 : 9781789807707
Vendor :
Microsoft
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 99.97
Learn Microsoft Azure
€36.99
Hands-On Kubernetes on Azure
€32.99
Azure Networking Cookbook
€29.99
Total 99.97 Stars icon
Banner background image

Table of Contents

12 Chapters
Azure Virtual Network Chevron down icon Chevron up icon
Virtual Machine Networking Chevron down icon Chevron up icon
Network Security Groups Chevron down icon Chevron up icon
Managing IP Addresses Chevron down icon Chevron up icon
Local and Virtual Network Gateways Chevron down icon Chevron up icon
Creating Hybrid Connections Chevron down icon Chevron up icon
DNS and Routing Chevron down icon Chevron up icon
Load Balancers Chevron down icon Chevron up icon
Traffic Manager Chevron down icon Chevron up icon
Azure Application Gateway Chevron down icon Chevron up icon
Azure Firewall Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(3 Ratings)
5 star 33.3%
4 star 33.3%
3 star 33.3%
2 star 0%
1 star 0%
Dan Mar 01, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I am new to Azure and this book really helped me on how to configure various components in Azure
Amazon Verified review Amazon
Win Jun 23, 2020
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
The book is very easy to read with step-by-step instruction and full of figures. In the book, you'll be creating VM, VNet, Submet, NIC, NSG, ASG, VPN, Point-2-Site, Site-2-Site, VNet-2-Vnet, Load Balancers, DNS, Route Table, Traffic Manager, Application Gateway, WAF and Azure Firewall. Each resource is created in two ways - Azure Portal and PowerShell.The reason I deduct one star is although you create a lot of services, you do not validate or test any of those. The book basically shows you how you create those services individually but it doesn't show you how to tie those services together as demo project(s). Another minor thing is the book uses old AzureRM module instead of new Az module.Overall, this is the first book to read for those who are new to Azure IaaS and make yourself familiar with those services.
Amazon Verified review Amazon
Cristian Scutaru Aug 05, 2020
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
The PDF is offered for a free download by Microsoft (Google it).Not a bad book, but extremely verbose for the very simple scenarios it presents. One single example: it takes 18 pages to present how you can create/assign/unassign/remove public/private IPs, with really trivial operations. Through an Azure portal GUI that already changed (as expected) within one single year. Or with PowerShell commands that you must be really specialized on to learn by heart.I would have loved by far some common sense simple visual diagrams, with the relationships between these network objects in Azure.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.