Book Image

Azure Networking Cookbook

By : Mustafa Toroman
Book Image

Azure Networking Cookbook

By: Mustafa Toroman

Overview of this book

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.
Table of Contents (13 chapters)

Assigning an NSG with PowerShell

Alternatively, we can associate an NSG using Azure PowerShell. In this recipe, we are going to show you how to associate an NSG with a subnet.

Getting ready

Open the PowerShell console and make sure you are connected to your Azure subscription.

How to do it...

To associate an NSG with a subnet, execute the following command:

$vnet = Get-AzureRmVirtualNetwork -Name 'Packt-Script' -ResourceGroupName 'Packt-Networking-Script'
$subnet = Get-AzureRmVirtualNetworkSubnetConfig -VirtualNetwork $vnet -Name BackEnd
$nsg = Get-AzureRmNetworkSecurityGroup...