Ebook SysAdmin Guide To Azure IaaS
Ebook SysAdmin Guide To Azure IaaS
Register to the Altaro DOJO now to gain unrestricted access to all content and
AUTOMATION
AZURE
BACKUP & DR
CLOUD
MANAGEMENT
NETWORKING
SECURITY
STORAGE
WINDOWS SERVER
BECOME A KICK-ASS
SYSTEM ADMINISTRATOR –
JOIN THE DOJO!
www.altaro.com/dojo 2
THE SYSADMIN’S GUIDE TO
AZURE INFRASTRUCTURE
AS A SERVICE
www.hornetsecurity.com/en
any form or by any means without the prior written permission of the publisher
or author. Every effort has been made to make this book as complete and as
provided is on an “as is” basis. The author and the publisher shall have neither
liability nor responsibility to any person or entity with respect to any loss or
If you have any feedback about this book, its content, questions for the author,
Its award-winning product portfolio covers all important areas of email security,
including spam and virus filters, legally compliant archiving and encryption,
Its flagship product is the most extensive cloud security solution for Microsoft 365.
FREE TRIAL
FREE TRIAL
4
ABOUT THE AUTHOR
the cutting edge. And as much as the IT industry has evolved since then,
writes in-depth technical articles, focused on Microsoft 365, Azure public cloud,
www.altaro.com/dojo/author/paul-schnackenburg/
tellitasitis.com.au
FREE TRIAL 5
INTRODUCTION
The cloud computing era is well and truly upon us. Knowing how to take
security, manageability and cost control are vital skills for any IT Pro.
One thing that has changed significantly over the past couple of years
is the shift towards making IaaS VMs more like PaaS services. VMs are great
but they require a lot of maintenance and care, whereas all the business
is really interested in are the applications and data that run inside of them.
Microsoft’s Azure platform; learn how to create VMs, size them correctly,
and manage storage, networking, and security, along with backup. You’ll also
manage security, and automate your infrastructure. And, if you have VMs
in your own datacenter and are looking to migrate to Azure, we’ll also teach
you that, or how to manage them from the cloud without migrating them there.
and/or Google Cloud Platform but not Azure) this book will cover the basics
as well as advanced skills. Given how fast things change in the cloud, we’ll cover
the why (as well as the how) so that as features and interfaces are updated,
You’ll benefit most from this book if you follow along with the tutorials,
if you don’t have access to an Azure subscription you can sign up for a trial here.
This will give you 30 days to use $200 USD worth of Azure resources, along with
12 months of free resources. Most of these “12 months” services aren’t related
to IaaS VMs (apart from a few SSD-based virtual disks and a small VM that you
can run for 750 hours a month). There are also another 25 services that have
If you’ve read the first edition, this second edition was updated in Dec 2021
and covers new features and updates throughout. All the step-by-step tutorials
have been updated. Two new chapters, Automanage (Chapter 11) and Azure
Arc (Chapter 12), have been added to bring a lot of automation to IaaS,
FREE TRIAL 7
CONTENTS
Introduction ................................................................................................................... 6
VM Management .............................................................................................20
VM Inspector ...................................................................................................23
VM Series ..........................................................................................................25
VM Performance...............................................................................................29
Chapter 3 – Storage.................................................................................................... 31
Disk Considerations.........................................................................................33
File Shares.........................................................................................................35
Speed ................................................................................................................41
Network services..............................................................................................41
VM Performance...............................................................................................46
Blueprints..........................................................................................................54
FREE TRIAL 9
Chapter 7 – Many VMs................................................................................................ 60
Availability ........................................................................................................60
Many VMs..........................................................................................................61
Backup ..............................................................................................................68
Restore Points...................................................................................................70
Replication ........................................................................................................71
Migrate ..............................................................................................................71
Managed Identities..........................................................................................75
Patching ............................................................................................................80
Bastion...............................................................................................................80
Chapter 11 – Automanage......................................................................................... 87
Chapter 13 – Automation........................................................................................... 95
Azure Automation............................................................................................95
VM Applications...............................................................................................98
FREE TRIAL 11
Chapter 14 – Beyond IaaS........................................................................................101
Serverless....................................................................................................... 104
Conclusion.................................................................................................................105
In this chapter we’re going to look at different ways of creating VMs, using the
(CLI). After this first chapter we’ll move on to other topics such as the different
VM sizes available (Chapter 2), Storage (Chapter 3) and Networking (Chapter 4).
Login at portal.azure.com.
Click the plus sign – create a resource and click on Compute. Select Virtual
machine; let’s step through the wizard that comes up. First, you must create a
could contain two VMs running a web front end, a load balancer, and a backend
SQL database (both PaaS services). You can assign permissions (Chapter 10) for
FREE TRIAL 13
First step to create a VM
Give your VM a name, AzureIaaSVM1, pick the East US region, and select the
Windows Server 2022 Datacenter: Azure Edition – Gen2 image. The suggested
size will most likely be a Standard D series which will be fine for this first walkthrough.
Define an administrator account username (note that you can’t use Admin
and similar account names) and a password at least 12 characters (123 max)
with three out of four – lowercase, uppercase, number, and special characters.
For this first VM (for learning purposes), we’re going to allow RDP (3389) access
from the internet, which is a pretty obvious security no-no. However, we’ll be
haven’t set up any networking prior to creating this VM, Azure will suggest
creating a new Virtual network (vNet), a new subnet and a new Public IP,
along with a Network Security Group (NSG) with the RDP port open.
Creating a VM - Management
FREE TRIAL 15
On the Management step of the wizard enable Azure Security Center and
leave all other options as default, do the same on the Advanced step and ditto
for Tags. On the Review screen click the Create button. A notification will appear
under the bell ( ) in the top right and if you click on it, it’ll show you the
deployment progress. Once it’s deployed the notification will change and
The Overview page for your VM will show its status and configured settings,
along with performance statistics for CPU, Network and Disk. When you click
the Connect button, it’ll download an RDP file that lets you connect to your VM
and login. Pro tip – if you’re new to Azure you might think that shutting down
the VM from within the OS will stop the running cost accruing in Azure – not so,
as this shutdown isn’t something Azure is aware of. To stop paying for the VM
click the Stop button in the portal which will change the state (once it’s shut
VM Overview screen
16
Azure has two command line interfaces – PowerShell and the cross platform CLI.
Which one to use is mostly up to you; if you’re a Windows person and comfortable
with PowerShell, it makes sense to use PowerShell, while the CLI is BASH-based
Time to create a second VM, this time using PowerShell. There are two ways of
running PowerShell against Azure. You can download the appropriate modules
and install them on your local PC. Or you can use CloudShell, which is PowerShell,
or the CLI (see below), running in a browser, that already has the required
modules installed. You can get to CloudShell using shell.azure.com, which will
give you a full browser experience window or you can click the button (>_)
in the top right of the portal, which will give you a smaller shell at the bottom
To create a new VM in the same RG that we created the first one in,
OpenPorts 3389
It’ll ask you for credentials for the new VM and then proceed to deploy it for you.
We’ve put this VM in the same RG and vNet / Subnet as the first one we created.
Once the deployment has completed, go back to the Azure portal to make sure
One nice thing about CloudShell is that you can simply swap between CLI and
PowerShell in the top left of the browser. If you want to run the CLI on your local PC
it’s available for Windows, macOS, and Linux. You can even run it in a Docker container.
Swap to Bash (CLI) and type in the following on one line to create our third VM:
--admin-password YourGoodPassword
FREE TRIAL 18
Check again in the portal to make sure that the new VM shows up in your RG.
The previous methods are useful for creating VMs on an ad-hoc basis or perhaps
using scripts but realistically, once you move production workloads to Azure
and you want to have repeatability, ARM templates are your friend. We’ll cover
these in detail in Chapter 6 but let’s create a VM from a template to whet your
appetite. Head over to Azure QuickStart Templates, and scroll to see some of the
different templates. Clicking on See all lets you filter based on the resource type;
pick Microsoft Compute and then click on Deploy a simple Windows VM template.
Click the Deploy to Azure button which will take you to the portal where you
enter the same information as when you created the other VMs, such as admin
the terms and conditions and click the Purchase button to deploy your fourth VM.
VM MANAGEMENT
Pick one of the VMs and click on its name. The overview page will show you
basic settings. If you click the Networking link in the left-hand menu it’ll show
you the port rules in the Network Security Group and gives you the option to
add additional network interfaces to the VM. You can also configure Application
FREE TRIAL 20
security groups (ASG) which is a way to group VMs together under logical names
(“DB”, FrontEnd” etc.) and then build your NSG security rules using these names
instead of IP addresses. When you then need to add another VM to one of the tiers,
simply add it to the ASG and the right NSG rules will apply.
Windows Admin Center, currently in preview, is a free web-based tool that’s been
available to manage Windows Servers on premises for a few years now and is
now available as a blade in the Azure portal. It makes it easy to manage a fleet
The Disks interface lets you add data disks to your VMs, whereas the Size
link lets you resize your VM. Note that this will require a restart if it’s running
so schedule this during non-business hours. The Security link gives you alerts
and recommendations but it’s better to use Defender for Cloud (Chapter 10) to
handle this across all your resources than managing it on an individual VM basis.
Extensions are interesting and allow you to add functionality to your VMs,
both from Microsoft and third parties. The ones I would recommend as a baseline
third-party AV solution.
The configuration link lets you enable Just-in-time access which protects RDP,
SSH or WinRM access to your VMs through those ports being closed normally.
When you need to administer the VM, you login to the Azure portal, perform
the required port for three hours. If you have Software Assurance for your
Windows (or SQL Server) licenses, you can use Hybrid Benefit to lower the cost
of your Azure VMs. If your application has low latency requirements, consider
are used for scenarios where you have to follow a regulation that prevents
you from running VMs alongside VMs from other businesses, so you have
Any resource type (not just VMs) can have a lock applied to them, either preventing
configuration changes (Read-only) or deletion (Delete) and the lock can only be
Guest + Host updates help you configure Update management for Windows
and Linux server OS regular patching (see chapter 10). It also allows you to see
if there is any upcoming planned maintenance for the Hyper-V hosts underneath
your VM, giving you about 35 days to pick when the maintenance works for you.
settings inside your VMs OS using Desired State Configuration (DSC) management.
Resource health tells you if there are any Azure issues currently with the fabric
where your VM runs and provides a history of any platform issues for the past
four weeks. The Boot diagnostics link shows you screenshots of the system,
in situations where you can’t access the VM, and the Serial log shows you the
output of the boot process (most useful for Linux VMs). If you’d like to interact
FREE TRIAL 22
with boot process use the Serial console for Windows and Linux. If you’ve
forgotten the administrator password you can use Reset password. Connection
troubleshoot helps you figure out why you can’t connect to the VM if it’s caused
by NSG rule misconfiguration. If you’ve got performance issues with your VMs
you can run Performance diagnostics, preferably before you open a New
VM INSPECTOR
If the issue is with the OS inside your VM, there’s a tool in preview called VM Inspector
that collects event logs, configuration, settings and registry keys from Windows
and Linux VM’s OS disk and outputs them as a zip file to a storage account.
Throughout this book we pick the Windows Server 2022 Datacenter: Azure Edition
as it’s the first version of Server that unlocks special features when it runs in
Azure (or on Azure Stack HCI – chapter 12). It lets you create a “no user action”
Azure Edition file share using SMB over QUIC, securely connected over TLS 1.3.
This edition also supports hotpatching, the ability to update the OS without having
to restart the server (on Server Core only, Server with a UI doesn’t yet have it).
Before we proceed to Chapter 2, let’s make sure you don’t use up all your free
credit on these VMs, simply by deleting the entire RG. Click on the hamburger
menu in the top left of the portal, select Resource groups and click on the
Azure IaaS RG. You should see your VMs, and associated resources listed.
Click the Delete resource group button and confirm that you want to delete it.
FREE TRIAL 24
CHAPTER 2 – SIZING VMS
In this chapter we’re going to look at how you pick the VM family and size for
your workload. If you use virtualization on-premise, you’re used to being able
to choose exactly the number of virtual CPU cores and memory for a new VM,
along with (maybe) choosing between different backend storage arrays and
VM SERIES
In contrast in Azure you must pick from the T-shirt sizes on offer and you have
to know which family to select; there are quite a few to choose from. It should
start with your workload. You need to know what performance characteristics
the application requires and what type of deployment it is, development, test,
QA, or production. As you pay per minute it’s vital that you don’t let your
developers pick whatever they want (we’ll cover Azure policy in Chapter 6
The first distinction is between the Basic and Standard Tier; the former doesn’t
support SSD storage or high availability features and so is appropriate for test / dev
workloads but not production. Each series also comes in versions as the underlying
fabric is upgraded, designated by a “v” number such as v4. You’ll often find
deals on the previous versions as the new ones are rolled out. The “s” in a VM
size indicates that the VM can use Premium Storage (SSD based) and an “m”
while “r” is for Remote Direct Memory Access (RDMA), ultrafast, low latency
Hyper-V host runs on AMD processors, instead of Intel CPUs and an “i” shows
For your general-purpose workloads look at the A, B or D series VMs. The Av2 series
is good for smaller VMs and test and dev workloads that don’t need a lot of grunt.
The B series on the other hand, is appropriate for bursty workloads that don’t
use a lot of CPU, except for short periods of time. Your VM will accrue CPU
credits when it’s running but the processor isn’t taxed, which it then uses when
the VM uses the CPU heavily. When your accrued credits run out, the CPU will
be throttled back. The B series is a bit of a hidden secret (it’s considerably more
cost-effective than the D series), as many server workloads don’t use the CPU
very heavily most of the time. For production workloads, the D series is the
go-to workhorse, including the Dasv4 series (running on the AMD EPYC™
7452 processor) and the Dasv5 (on the EPYC™ 7763v processor).
For workloads requiring a higher ratio of memory to CPU look at the Ev4 and
Ev5 (and Easv5 on AMD) series and the Mv2 series. For workloads requiring
higher CPU to memory ratio look at the Fsv2 series. If you need very fast storage
(Big Data, SQL and NoSQL databases) look at the Lsv2 series, because you
won’t want to pay too much for the database software licensing when you pay
per core, however, for workloads that require a LOT of memory but fewer cores,
FREE TRIAL 26
Next up, If you’re doing High Performance compute (clusters of nodes crunching
large datasets) look to the HBv3, HC and H series VMs; they come with either
100 or 200 Gbps networking. And if you need graphics performance look to
the various N series, which offer GPUs, either for remote desktop access
Azure offers the NVv4 series that provides partitioned GPUs, where you can
have access to a portion of a GPU, all the way from 2 GB to the full 16 GB
Finally, the DC series gives you encrypted hardware enclaves where you can run
your own code and no-one except you will have access to the data as it’s being
Now let’s look at individual VM sizes and the naming standard. This is a list of
number in the name), 128 GiB of memory (4x), supports up to 32 data disks (1x),
is a Standard VM size (not Basic) and comes from the third version of the D series.
has 32 vCPU (1x) but 256 GiB of memory (8x), whereas the compute optimized
Standard_F32s_v2 also has 32 vCPU (1x) but only 64 GiB of memory (2x).
If it feels like there are WAY too many choices of VMs, you’re not alone. Azure
offers a web-based tool, the Virtual machines selector, to help you pick the right
28
VM PERFORMANCE
If you find that your VM isn’t using all its resources and you need to size it down
or alternatively that it doesn’t have enough and should be bigger you can easily
and if the size you’re looking to move to isn’t available in the hardware cluster
where it’s currently running, the VM needs to be stopped and deallocated first.
value where a Standard_A1 is 100 and thus you can compare how much faster
each VM series is to this baseline. If real world figures are more your cup of tea
look at the benchmarks that Microsoft has run across all VM sizes.
If you have regulations that state that your workloads can’t live on shared
infrastructure (or you’re REALLY cautious and have deep pockets) there are
a few VM sizes that guarantee that yours is the only VM on that host. You’ll then
use nested virtualization to carve up that VM for each of the VMs you need to
run on your isolated host. These VM sizes were Microsoft’s first crack at isolated
hosts, the next iteration is Dedicated host. This takes away the responsibility to
manage the nested virtualization; you simply pick the VM sizes you need, and
they’re deployed on your host. It also lets you manage OS patching and other
platform needs.
If you’ve got experience with Hyper-V, you know that a few versions ago we got
a new VM type, Generation 2 (Gen 2). The support for Gen 2 features has been
steadily increasing since 2019. It now includes Trusted Launch which builds on
Integrity (HVCI) and Windows Defender Credential Guard which protect against
credential theft attacks like Pass-the-Hash (PtH). Trusted Launch also integrates
For the right scenarios, particularly for specific compliance regulations or for very
FREE TRIAL 30
CHAPTER 3 – STORAGE
In this chapter we’re going to look at the different types of disks you can pick
for your VMs and why this is an especially important step for the overall performance
of your servers.
Most IT Pros are aware of the difference that fast storage can make for server
workloads but it’s much harder to quantify than memory and processor
processor cores” is very common. Less common is “requires 500 IOPS per GB
of database data stored”. Overall, both on-premises and in the cloud, storage
Input Output Operations Per Second (IOPS), throughput in MB/s and latency
When we created our first VMs in chapter 1 we had different options for the OS
disk. The same options are available for additional data disks you attach to your
VMs as well. All disk storage (except for Ultra, see below) is remote to your VMs
and sits in a storage stamp which introduces some latency between the Hyper-V
host that runs your VM and its associated disks. The first choice is between hard
drive and SSD storage, where hard drive (as you might guess) is the most cost
effective, but the slowest and only comes in a Standard flavor. The speed varies
with the size of the provisioned disk but starts at 500 IOPS per disk.
per disk between 128 GB and 4TB in size but with more even performance than
HDD based storage) and Premium SSD. The latter varies in IOPS; a 128 GB disk
has 500 IOPS, a 256 GB disk has 1100 and a 32 TB disk comes in at 20,000
IOPS. Premium and Standard SSD disks smaller than 512 GiB support credit-
based bursting, where it accrues credits when it’s not being used at full speed,
and then can use those credits to temporarily increase the performance when a
spike of disk activity occurs, at no extra costs. Premium SSDs larger than 512 GiB
on the other hand offer on-demand bursting which does incur additional charges.
If you have IO heavy workloads it pays (literally) to pay attention to disk performance.
If you enable on-demand bursting and the disk is using bursting a lot, it will be
more cost effective to change the performance tier of the disk instead.
You can use Storage Spaces in Windows and software RAID in Linux to combine
multiple data disks for increased performance. Remember in both cases that
you’re not configuring for redundancy / data protection (unlike what you’d do
on-premises) as that’s taken care of by the underlying storage fabric, only for speed.
This detailed article covers how to configure storage for high performance in Azure
160,000 IOPS and 2000 MB/s per disk. Another benefit is that you can change
the performance characteristics of the disk while it’s running so if you have a
reporting server for instance that crunches end of month reports from a large
database for two days every month, schedule an Azure Automation job to dial
up the performance for those two days and then bring it back to a normal (and
less costly) level for the rest of the time.
FREE TRIAL 32
Be aware as you work out the disk throughput, latency and IOPS requirements
for your workload as different VM sizes have overall limits on the maximum IOPS
they will support. Smaller VMs for instance such as a B1s only supports up to
3200 IOPS whereas a D16s_v3 tops out at 25600 IOPS, even if you connect
DISK CONSIDERATIONS
One difference to consider between managed and Standard (but not Premium)
unmanaged disks is that the former charges you for the entire size of the disk,
whether you’re using all of it or not, whereas the latter only charges you for
disk space actually used. However, there are so many benefits to managed disks.
You can offset the cost premium by using smaller disks for the OS drive using
the [smalldisk] templates that give you a 30 GB OS drive, instead of 127 GB.
Linux machines) which is located on the local host on SSD drives (for most VM
series), but this drive should only be used for truly disposable data (TempDB
Also consider your options for caching on VM disks . Azure hosts provide a read
or a read/write cache for both OS and data disks. Depending on your workload,
enabling caching can improve performance.
FREE TRIAL 34
One tip that I’ve learnt the hard way is to not oversize your premium disks –
you can increase their size later but not shrink them (apart from copying all
the data to a new drive and then changing the drive letters). Since you pay
Currently in preview is the ability to resize managed disks while the VM is running.
Azure also supports shared disks for guest clustering scenarios. Imagine several
VMs running SQL Server, all working from a single, shared, managed disk.
You can even have copies of the shared disk be distributed across Availability
We’ll cover migrating VMs at scale in Chapter 8 but you can actually upload
a VHD file to Azure and create a VM from it. You can even upload a VHD directly
as a managed disk.
FILE SHARES
The most common workload for a Windows server on-premises is as a file server.
So, you might imagine that just lifting and shifting those VMs to Azure is the
solution for offering those files to VMs in Azure. A better solution is Azure Files,
part of Azure storage. Think of this as a managed file share where you don’t
have to worry about managing the underlying server. Also, you can use Azure
sync older files to the cloud to effectively make your file servers “bottomless”.
Azure storage can now also be accessed over Secure File Transfer Protocol (SFTP).
A GIBIBYTE VS A GIGABYTE
measure size such as Mebibyte (MiB), Gibibyte (GiB) and Tebibyte (TiB) which
are the proper calculation of 1024 bytes (not 1000), so 1 Kilobyte is 1000 bytes,
while one Kibibyte is 1024 bytes and so forth. This “rounding off” that hard drive
manufacturers are fond of is why your brand new 4 TB drive only fits 3,725 GB
FREE TRIAL 36
CHAPTER 4 – NETWORKING
In this chapter we’ll look at a better way of setting up your VMs in Azure
by laying the foundation of a well-designed network first. After all, if you were
setting up a new branch office, you’d make sure cabling, switches and routers
The best way to pick the region in Azure to host your workloads is to keep
them close to your datacenter or customers – use Azure Latency Test from
AzureSpeed.com. This free service is not affiliated with Microsoft but very useful
(and open sourced on GitHub). It can also give you performance metrics for
37
Azure Speed latency test
Once you know which region provides the lowest latency, login to the portal
and click the Create a resource button. Select Networking in the left-hand menu
and search for Virtual network (it used to be at the top of the list but now it doesn’t
even show up). Give it the name vnet-AzureIaaSVnet and note how it picks
an address space that gives you 65,536 addresses, the maximum amount a vNet
can have. If you’re ever planning to connect your on-premises network to Azure,
make absolutely sure that you’re picking an address space for your vNets that
Each vNet can be divided into subnets (one called default will be created
for you), create one more subnet – call it snet-Production with the address space
Support for IPv6 is improving in Azure and you can use it if you need it.
Leave DDoS protection at Basic (the same overall protection that all resources
get in Azure from the daily DDoS attacks). Standard gives protection for your
and specific reporting, along with cost protection (if you incur network charges
due to the attack they’ll be refunded by Azure). Only enable Standard DDoS
if you really need, it’s quite expensive. Leave Service endpoints, BastionHost
FREE TRIAL 39
Go to your new network and click on the Subnets button on the left and click
the +Subnet button to add another called snet-Test with the default space.
Note that three addresses are reserved for Azure and each subnet provides 251
addresses for you to use. While we’re here you should create a Gateway subnet
In this tutorial we’re only creating a single vNet but in larger deployments you’ll
likely have several, perhaps in the popular hub and spoke model where a central
vNet contains shared services (AD DCs, DNS, Firewall and VPN connectivity
to on-premises) and spoke networks contain workloads. You can easily connect
("peer") vNets together, both in the same region and across regions.
vNets at scale. Some Azure customers end up with 100’s or 1000’s of vNets
on rules) include vNets into network groups. These can span subscriptions
and Management groups. Then you can apply connectivity configurations that
define how each vNet should be peered with the others (hub-spoke or mesh)
and security configurations that add NSG rules that can’t be altered by resource
owners, finally giving the security team centralized control over traffic flow.
SPEED
offering speeds from 40 Gbps to 100 Gbps. If you need lightning fast VM
to VM networking with low latency, make sure you pick the right VM series
that supports the speed you need. The FPGAs can also be accessed to perform
If you need to figure out the latency between two endpoints, use the right tools.
NETWORK SERVICES
Azure Private Link is the newer way to access PaaS services (Azure Storage
and SQL Database for example) over a private endpoint in your virtual network.
FREE TRIAL 41
This service also enables you to access third party partner services securely
and publish your own services to other companies. Not all services fully support
Private Link today but it’s the best way to not access PaaS services over the
are a way to add named PaaS services in Azure (AAD, KeyVault, SQL, Storage
and Web apps etc.) to your vNets / subnets to control traffic so that it doesn’t
have to pass over the internet. There are subtle differences between the two
If you need to capture all VM network traffic for security inspection or forensics,
be aware that the vNet TAP service that was in preview is currently “on hold”.
Azure will automatically assign IP addresses to your VMs (DHCP with infinite
lease times). Don’t ever try to assign a specific address to a VM from within
the OS itself. If a VM needs a specific IP address in your vNet use the portal
to assign one. If, on the other hand, you need a fixed public IP address, perhaps
to publish an application to the internet through DNS, you can reserve those.
By default, every vNet will use Azure provided DNS name resolution but
depending on your workloads you may want to point VMs to your own DNS
servers (if you’re running DCs in Azure for instance) or if you’re using a Site
to Site (S2S) VPN, back to your on-premises DNS servers. This is configured
in the left-hand menu under DNS servers. There’s also DNS private zones which
is a managed DNS solution where you have complete control over the records
for your vNet(s), without the overhead of running your own DNS servers.
Use this article to ensure you design the right DNS solution for your IaaS workloads.
On the other hand, if you need public DNS services, consider Azure DNS.
a global DNS-based traffic load balancer. The endpoints that Traffic Manager
clouds as well. If you have a large, multi-region service the evolution of Traffic
Manager is Front Door which provides TLS termination (SSL Offload) and many
If you need load balancing Azure provides one as a PaaS, it can be used
for instance) or as a public Load Balancer for internet traffic (layer 4). For SSL
instead, it can also be combined with Azure’s Web application firewall (WAF)
which will protect your websites from common attacks with the OWASP based
If these last paragraphs were a bit overwhelming and left you wondering –
which one should I use – use this article and the flow chart in it to narrow down
HYBRID NETWORKING
For many businesses having VMs running in isolation in Azure is not enough –
is required. For ad-hoc connectivity from individual computers you can use Point
to Site (P2S) VPN connectivity but for more permanent linking you need to look
at either Site to Site (S2S) VPN or ExpressRoute.
FREE TRIAL 43
The former requires a VPN router in your datacenter and a VPN gateway
(that’s why we created the Gateway subnet earlier) and a connection in Azure.
The largest VPN gateway SKUs go all the way up to 10 Gbps speeds (provided
your internet connectivity can keep up of course) but S2S VPN is still going
over the internet with the corresponding issues around security, latency,
ExpressRoute on the other hand provides a private link between your datacenter(s)
and Azure and comes in speeds from 50 Mbps to 10 Gbps (ExpressRoute Direct
goes all the way up to 100 Gbps). There are three connectivity models –
any (IPVPN) Connection. You can also use an ExpressRoute connection in one
region to reach other regions over Azure’s backbone (with the Premium SKU).
If you have ExpressRoute you can have failover to a S2S VPN for even higher
availability and if you have multiple S2S and ExpressRoute connections in different
locations you can use Virtual WAN to connect these locations over Azure’s
For scenarios where your existing on-premises workloads can’t have their IP
addresses changed as you migrate them to the cloud you can extend your
IP address range into a vNet. If on the other hand you want your BGP routes
that you use on-premises to be propagated into Azure and vice versa, consider
the Azure Network Adapter to easily deploy a P2S VPN to connect each individual
server to your vNet – handy for branch office scenarios for instance.
To prepare for the next chapter create a small VM in your new vNet using
the steps in Chapter 1, call it vm-IaaSVM5, we’re going to use it for monitoring
and performance.
FREE TRIAL 45
CHAPTER 5 – MONITORING
& PERFORMANCE
This chapter will show you how to monitor your VMs performance and their
networking along with tips on how to set up alerts to let you know when things
VM PERFORMANCE
The first place to go if you get reports that a VM is misbehaving is the overview
for that VM (in our case, vm-IaaSVM5). That screen will show you key metrics such
as CPU, Network and Disk statistics for the last couple of hours (up to 30 days).
To dig deeper head to the Metrics blade under the Monitoring heading where
you can pick performance metrics to measure. Click the Add metric button
to keep adding additional measurements to track down your issue. You change
the time span in the top right and change the chart type as well as pin your final
layout to your dashboard. Furthermore, you can create an alert rule based on
a specific condition (CPU greater than 75% for more than 5 minutes as an example)
and then an Action group where you can set up email, SMS, Voice or Azure app
Push Notifications (see below) or set up emails that go to a specific Azure RBAC role.
You can also enable the common alert schema which brings the alerts across
Azure into unison. In the past they all had their own set up and configuration.
On the Action tab you can configure several Actions to take such as Automation
Runbooks, Azure Functions, ITSM (connect to Service Now, System Center Service
Manager, Provance and Cherwell), Logic App, Secure Webhook or Event Hub.
This provides a comprehensive way to integrate alerts from Azure IaaS into your
If you’d like deeper information from within the guest OS, click Diagnostics
application supports it (.NET, .NET Core, Node.js, Mobile or web app) you can
use Application Insights to provide information from within your own code.
All the steps we did to configure metrics and setup an alert are actually provided
by Monitor, the umbrella term for monitoring not just a single VM but your entire
FREE TRIAL 47
Azure estate. If you click the hamburger menu and click Monitor in the list you can
start monitoring across VMs, storage accounts, containers, and Cosmos DB etc.
Apart from monitoring your own resources it pays to keep an eye on the Azure
platform itself. You can get to Service Health from the hamburger menu (look
for the broken blue heart). This lets you pick the subscriptions, resources, services,
and regions that matter to you to see if there are any issues with Azure itself.
You can also set up an alert to let you know if there are any service health issues.
Also make sure to follow @azurestatus on Twitter. From a VM you can click
on Resource health under the Support heading; this will give you an indication
if there’s anything in Azure affecting the VM as well a list of past health events.
NETWORK MONITORING
Network Performance Monitor is now retired (you can’t create any new tests;
existing ones will keep working until 29 February 2024). Instead use Connection
hybrid infrastructure. It’ll show you loss, latency, response time and bandwidth
usage between your different locations and build a topology map to show you how
that shows topology, dependencies, and health for all your network nodes.
data from your Azure subscription(s) and displays it in a dashboard that you
A great way to keep an eye on your Azure deployments is the free Azure App
for iOS and Android. It shows you the health and status of your deployments
(including alerts), lets you stop and start VMs and even run PowerShell / CLI
49
Azure App on Android
THE PORTAL
There are a few good habits to adopt to get the most out of the Azure portal.
If you hover your mouse cursor over a resource, a card appears where you can
take actions on it (for a VM, start, stop etc.) and see more information about it.
The settings gear ( ) lets you choose whether to open the portal on a dashboard
or the home view, whether the left-hand portal menu should be docked or hidden
(under the hamburger menu), pick a theme (including dark theme!) and high
contrast settings. It also lets you set language and region settings, as well as swap
Portal Settings
FREE TRIAL 50
To get to the search bar to find deployed resources or new services that you may
want to use, click G+/. If you want to live on the edge and see what’s coming
You can also create custom dashboards; click on the hamburger and pick Dashboard,
here you can edit the layout and add resources, share the dashboard with others
and enable full screen (think large screen displays in your NOC).
As mentioned, you can use Windows Admin Center (WAC) directly in the
Azure portal. This web-based UI for managing Windows Servers at scale has
gone from strength to strength over the last few years and has a particularly
strong hybrid story where you can create Azure VMs, set up backup of on-premises
VMs to Azure, configure Azure Site Recovery for Disaster Recovery etc.
the control plane of Azure and what it means for your IaaS deployments.
INFRASTRUCTURE AS CODE
A concept that’s slowly permeating IT departments is the idea of having the code
and storage etc. treated just like application code written by developers –
To see how you could use templates to achieve this repeatability nirvana,
link on the left. Do a search for SharePoint and click on the SharePoint 2019,
2016 / 2013 fully configured template. Click on the Browse on GitHub button
to see the files associated with the template as well the Visualize button which
gives you either a diagram of the resources in the deployment, and their relationship,
or a code view of the template. When you click on a resource in the diagram,
you’re taken to the part of the template that defines that part of the deployment.
FREE TRIAL 52
Four VM SharePoint ARM template
Scroll through and you’ll see that the Java Script Object Notation (JSON) layout
is quite easy to understand. Start at the top where you’ll see bits about what
Schema version is used and then the definition of several parameters. Together
with a parameters file you could deploy an entire SharePoint farm with a single
line of PowerShell or CLI. If you’ve ever done that manually this will give you
dive on the ARM language is beyond the scope of this book but take this free
course. ARM takes care of deploying all the VMs and associated infrastructure
but when it comes to configuring the OS inside those VMs, look to Desired State
Configuration (DSC) from PowerShell. For editing ARM templates (and DSC),
Visual Studio Code with the right extensions is my favorite tool (and it’s free!).
not every IT Pro is comfortable with the complex nature of JSON ARM code.
The solution is Bicep (Arm – Bicep – get it?), an intermediate language that lets
you write and edit templates easier and then when you deploy them they’re
transcribed into ARM code that Azure understands. The current 0.4 version
Looking beyond ARM and Azure there are several other approaches to Infrastructure
as Code, one is Terraform by Hashicorp, which works in Azure, GCP and AWS.
BLUEPRINTS
a superset on top of ARM templates that adds support for Roles and Policy
(which you can store anywhere you want), Blueprints are stored in Cosmos DB
and are replicated to several regions, and they maintain a link back to the
Microsoft also provides many Blueprints aligned with regulations such as ISO 27001,
FREE TRIAL 54
AZURE POLICY
This is probably one of the most underused and most powerful “hidden”
features of Azure. As a subscription owner you can define policies that restrict
what size VMs (and other resources) your IT staff can create, in which regions
they can create them as well as require them to add tags (see below) when they
create them for example. After resources have been deployed you can audit
their state to see if they have disk encryption enabled or backup is configured
for instance along with many other policies. And if the resources don’t conform
governance goal.
(used to be 15) which are simple name value pairs. Examples are Environment
(Dev, Test, QA, Production), Owner, Cost Center (which will show up in your bill
from Azure) and Department. And you can use Azure Policy to enforce the use
of tags for your resources, creating a well governed cloud estate instead
NAMING STANDARDS
If there’s one single thing that’s most important for you to do after reading
this book, it’s to define an Azure naming standard for your organization.
will save many, many hours down the track as you’re trying to figure out why
and we’ve been using the standard throughout most of the tutorials in this book.
MANAGEMENT GROUPS
A big puzzle piece for a large, well -governed Azure deployment is Management
Groups (MG). These are a way to group many different subscriptions and their
associated RGs under one organization umbrella. Once you have enabled the
first root MG (takes up to 15 minutes) you can create further MGs to mimic your
FREE TRIAL 56
company structure and then apply Azure Policy and RBAC permissions at each level.
So, if you need a company-wide policy, apply it at the root MG. Policies that should
apply only to European resources are applied at that MG level, and so forth.
RESOURCE GRAPH
The final piece of ARM and governance is Azure Resource Graph which lets you
query and explore already deployed resources to filter, group and sort to figure
out what is out there and assess the impact of applying Azure policy in large
deployments. The best way to try it out is to have some resources deployed and
then do a portal search for resource graph queries – try out some of the samples.
You can also use Resource Explorer to drill down in a graphical way to see what’s
deployed, test it out with vm-IaaSVM5 and see the separate components,
such as a NIC, and disks that make up a VM. Resource Explorer is particularly
and you’re trying to figure out what resources there are and how it’s structured.
Resource Explorer
FREE TRIAL 58
CLOUD ADOPTION FRAMEWORK
Adopting cloud is more than just the technical aspects and Azure has
which comes with best practices, documentation, and tools to align business
AVAILABILITY
A single VM running on Premium SSD disks (OS and data disks) receives
a financially backed 99.9% SLA from Azure. If you want better uptime look
at Availability Sets (AS). As an example, say you have two Domain Controllers
with a S2S VPN). If you put them in an AS, Azure will automatically distribute
If you need even better VM availability, use Availability Zones (AZs). Each Azure
redundancy for services that are AZ aware. In the 23 regions that are AZ enabled
(there were 10 when the first edition eBook was written) you can choose
to deploy resources to numbered AZs (1-3). Note that you can’t rely on this
may not refer to the same datacentre in another subscription. If you spread VM
FREE TRIAL 60
MANY VMS
If you need an “elastic pool” of VMs that can be scaled out or in based on demand,
VM Scale Sets (VMSS) are your friend. They’re also AZ aware. There are now two
versions of VM Scale Sets, the older version is called Uniform orchestration mode.
The new version, called Flexible orchestration (“Flex”) is the recommended option
going forward, think of it as the best of Availability Sets combined with the best
of the old Scale Sets. It supports 1000 VMs compared to 100 in the old model,
it supports all Azure VM sizes, you can associate an existing VM with a VMSS
and most importantly, you manage the VMs exactly like you manage single VMs.
and pick Virtual machine scale sets in the results. Click Create virtual machine
scale set and call the VMSS vm-IaaSSS, pick Windows Server 2022 Datacenter:
Azure Edition, put it in the rg-AzureIaaS and select all three zones under AZ.
(less costly than the D series it defaults to). Set the initial instance count to 3
and scaling policy to Custom to see all the different options you have
for controlling how many VMs your VMSS will scale up and down to.
available (HA), load balanced set of three VMs, spread across three datacenters.
Let’s look at some of the options that we left at default when we created our VMSS,
such as Spot VMs, which takes advantage of the spare capacity in certain Azure
regions. You pay a lot less for these VMs (they have no SLA), but they can be turned
off at any time so are only appropriate for stateless workloads or applications
where you’re continually storing data for the applications outside of the VMSS.
New here is the ability to test your application’s resiliency by simulating VMs
being evicted and also a new API call to try to restore an evicted VM.
You can combine low priority with Ephemeral OS disks which are stored
on the local Hyper-V hosts in Azure and thus provide lower latency and faster
Once your VMSS is deployed, you can click on the Scaling option to manually
scale up the number of nodes – note that the maximum is 1000; you don’t want
To make sure you don’t use up your free credits – go to Home in the portal,
click on All resources and delete vm-IaaSSS so you don’t continue paying
It lets you create experiments with many different options such as shutting down
VMs or VMSS, adding CPU / memory or disk pressure, DNS failures or killing services.
FREE TRIAL 64
Note that specific RBAC permissions are required to create an experiment and
resources must be opted in to participate in one, as well as have the right permissions.
And there’s a big stop button to halt an experiment if it goes wrong.
you want to ensure that all the HA features that we’re looking at in this chapter are
actually going to work as expected, take Chaos Studio for a spin (it’s lots of fun!).
CAPACITY RESERVATION
capacity “on tap” when you need it, was tested early in the Covid pandemic
when certain regions in Azure simply ran out of capacity. A new feature,
because you know you’ve got a heavy workload coming up next week (Black
SHARING IMAGES
images company wide and Azure Compute Gallery (formerly Shared Image
Gallery) is the solution for this. It lets you version and group VM images and
store them in a HA way in Zone Redundant Storage (ZRS), replicate them between
regions and share them across subscriptions and between AAD tenants.
There is no extra cost for the gallery functionality, just the storage cost.
COST MANAGEMENT
One of the great challenges in moving to the cloud for many organizations
is managing cost. Most CFOs will be more than happy to move from a Capital
If you’re early in your cloud migration journey, start with the TCO Calculator
that lets you compare your on-premises workload costs against Azure costs.
Another great option, which we’ll cover more in detail in Chapter 8, is Azure
Migrate which helps evaluate your VMware, Hyper-V and physical server workloads
to use in Azure (based on actual performance data, not the size your VMs
Reserved Instances (RI) are another option where you pay per month for a certain
collection of VM capacity that you’ve committed to for one or three years, providing
you a substantial discount. You can also scale VMs up and down in size within
the overall capacity you’ve reserved. Note that RI works best for VMs that are
on 24/7, if you turn them off during non-business hours, RI may not be cost
effective. Azure reservations has also expanded to many services other than VMs,
FREE TRIAL 66
For a quick overview of your spend, click on the hamburger menu and Subscriptions,
this’ll show you a donut graph of your current spend in this billing month on
various resources. For more in-depth analysis head to Cost Management + Billing
where you can slice and dice your costs for various billing periods and resources.
Here you can also set alerts on spending and create budgets to manage spending
about the cloud. We’ll focus on backup, replication, and Disaster Recovery (DR).
We’ll also look at migrating VMs to Azure and how you can continue to run your
BACKUP
The myth that “since it’s in the cloud I don’t need to back it up” is persistent but
nothing could be further from the truth. First, you may be subject to regulations
that require you to keep backups of production applications and data for several
years. Beyond that, you need backups of your VMs to protect yourself against
user mistakes (deleting or overwriting the wrong file or clicking the wrong button),
admin mistakes (“oh, I thought that was the test VM that you wanted me to delete”),
At this stage you should have a single VM, vm-IaaSVM5 (you did remember
to delete the scale set – didn’t you?). Open it in the portal and click on the Backup
link under Operations. It’ll suggest creating a Recovery Services vault to store
your backups, click Edit this policy under the suggested backup policy and set
your backup frequency and retention period (up to 99 years for the yearly points),
FREE TRIAL 68
Backup Policy Configuration
When you have production VMs take a holistic approach; go to the search bar
and type in Backup, click on Recovery Services Vaults and click on the name of
your vault, select Backup in the left-hand menu. Here you can pick what to backup
and where it’s running, once you click Backup pick your policy and then you’d select
all VMs that require protection (instead of having to do it on each individual one).
You can also use Azure Policy to enforce the configuration of backup on VMs.
Note that Backup works for both Windows and Linux VMs, and that you can
restore individual files and folders, as well as whole VMs. On top of that SQL
several steps are required to ensure that, should a ransomware event occur, the
attacker who is encrypting your files can’t easily get rid of your backups to leave
you with no choice but to pay the ransom. Note that when you do delete
backups, they’re still kept (14 days) in case you change your mind.
RESTORE POINTS
what about checkpoints? They’re not proper backups but they’re a handy way to
points, which expands the existing support for incremental disk snapshots.
FREE TRIAL 70
REPLICATION
For complete protection you should use Site Recovery to replicate business
critical VMs from one region to another, in case a whole region has an outage
(it has happened). Note that you’ll need to create another vault in a separate
ALTARO VM BACKUP
To protect your on-premises VMs (VMware and Hyper-V) you can use Altaro VM
Backup which easily replicates VMs to Azure storage. You can then restore the
protected VMs to the original host or an alternate host or if it’s a major disaster
MIGRATE
requirements and any blocking issues for running them in Azure in reports that
use to assess your expected costs for a “lift and shift migration”. It’ll also help
you with the actual migration of servers to Azure. Migrate also integrates with
If you don’t want to convert your VMware VMs to run on Azure and would
prefer to keep using VCenter and other VMware tools to manage your VMs,
look at Azure VMware Solution. It gives you the full power of VMware together
Another service you can use as part of your migration to the cloud is the Storage
Migration Service built into Windows Server 2019 / 2022. It lets you move file
servers from one server to another. Originally positioned as an “help you upgrade”
tool to go from earlier Windows Server versions to Windows Server 2019 / 2022,
you can use it to migrate (and upgrade them simultaneously) file servers from
FREE TRIAL 72
CHAPTER 9 – AZURE AD
In this chapter we’ll look at Azure Active Directory (AAD) and how you can integrate
identity with VMs as well as Azure AD Domain Services, a service that makes it
Typing Active into the search bar and click AAD will take you to your default
directory, created with your trial subscription (if you’re not using a trial subscription,
tread lightly here as you could interfere with production AAD operations).
Clicking Roles and administrators on the left introduces you to the built
in Administrative roles in AAD. Note that many of these are there because
AAD isn’t just the directory for your users in Azure, it’s also the directory for
users the permissions they need to do their work (and no more). If you have
AAD Premium P1 or P2 (paid versions of AAD, part of M365 E3/E5) you can
create custom admin roles, as well as use Privileged Identity Management (PIM)
to turn administrative users into “eligible” accounts, where they have to request
the role for a short amount of time. If you’re not going to use PIM, at least make
sure every single administrator has to use MFA to sign in to Azure. Preferably
every user in your tenant should be required to use MFA. , It stops 99.9% of all
negating the need for VPNs. Azure AD Connect is the umbilical cord back to
your on-premises AD and definitely something you should use for your hybrid
cloud: creating / changing and deleting accounts in a single place (AD) and
Make sure you create at least one, preferably two Global Admin accounts that
are exempt from ALL Conditional Access policies and MFA. Give these accounts
REALLY long and secure passwords and store them securely. These break glass
accounts are only to be used in emergencies if MFA is down in Azure for instance.
There’s a lot more to AAD that’s beyond the scope of this book.
FREE TRIAL 74
MANAGED IDENTITIES
nor checked into source control. In Azure this is accomplished with the free
service managed identities. This puts a service principal into AAD that’s used
in the application or the VM. There are two types: System-assigned and
lifecycle and is used only by that resource. The latter in contrast is created
authentication to the cloud, you may have to spin up one or more DCs in VMs
in the cloud (make sure you don’t put the AD database on the temporary D: drive).
This is a bit of management overhead; you have to keep them running, back
them up, patch and protect them against malware etc. AAD Domain Services
that integrates with your AAD tenant (which in turn is synched with your
topic here!
If you have one or two test VMs in the cloud, logging in with a local admin
account works but as your estate grows, better solutions are needed. You can
use your AAD account to RDP to Windows (Server 2019+ and Windows 10).
and you can use Role Based Access Control (RBAC) to assign permissions to VMs.
FREE TRIAL 76
CHAPTER 10 – SECURITY
This chapter looks at Microsoft Defender for Cloud (used to be called Azure
Security Center / Azure Defender), patching Linux and Windows VMs, Bastion,
Just-In-Time VM access, Disk Encryption, Key Vault, Firewall, and other services –
Some things are taken off your plate compared to on-premises such as physical
the applications in your VMs and the OS in those VMs are your responsibility,
Microsoft Defender for Cloud helps you with these challenges – it’s your one
stop shop for understanding the security posture of your workloads (whether
(CSPM). It uses the same concept as Microsoft 365 – Secure Score to “gamify”
security related actions you take by assigning them a score tracking the
improvement in your overall score over time. The CSPM parts of Defender
for Cloud (showing you where your configuration is weak) is free, but when
you want to actively protect your workloads (VMs and PaaS services) you enable
definitely turn on the enhanced security features for any production workloads
in Azure, especially as Defender for Cloud can now also show and protect
Defender for Cloud will draw a Network map to show the topology of your
workloads and how they’re connected to spot potential avenues for bad guys,
improve security. Features you can audit to see if they’re on, and enable
if they’re not, include just-in-time access, which blocks access to RDP / WinRM
for Windows servers and SSH for Linux until you unlock it for a period of three
hours from the portal when you need to administer the VM. Adaptive application
controls uses Machine Learning (ML) to build an allow list of applications running
in your VMs. Allow listing applications like this is notoriously difficult on end-user
workloads and lend themselves to making sure only known software can run
(you can also alert rather than block other executables). File Integrity Monitoring
tracks changes to file and registry entries, while Adaptive Network Hardening
monitors your network flows and NSG rules to identify opportunities to further
harden the rules. All three of these security measures apply to both Linux
(Windows and Linux) you are automatically licensed for Defender for Endpoint.
FREE TRIAL 78
endpoint protection solution for Windows, Linux, MacOS, iOS and Android.
It also offers Threat and Vulnerability management and identifies all installed
vulnerable versions.
Software updates is part of Automation (Chapter 13) and lets you manage OS
updates for both Windows and Linux. You can run assessments to identify
what patches your machines are missing, pick what classifications to deploy
and patch VMs to bring them in line with your baseline. Set up alerts so you’re
notified when things are working and when they’re not. It also integrates with
BASTION
An alternative to leaving RDP/SSH ports open to the internet (a really bad idea)
It provides SSH and RDP access directly from within the Azure portal, to your VMs.
It is even better than a jump box (a single VM that is open to the on-premises
no open management ports and it’s a managed PaaS service instead of a VM that
you have to manage. New in Bastion is the ability to manage VMs in peered vNets.
To create a Bastion, start by going to your vNet (for the vm-IaaSVM5) and create
a new subnet called AzureBastionSubnet (must have exactly that name) with
at least a /27 space. Do a search in the portal for Bastions and click Create
FREE TRIAL 80
Create a Bastion
Creation will take a few minutes, then go to your vm-IaaSVM5 and under
A separate browser tab will open and let you login to the VM.
There’s one place in Azure to securely store your tokens, passwords, certificates,
API keys, encryption keys and the like and that’s Key Vault. Backed either by
Hardware Security Modules (HSM) with the Premium SKU or software (Standard
SKU), Key Vault lets you securely store and access secrets from Windows and
Linux VMs. It also manages certificates and integrates with third party Certificate
Authorities (CAs) DigiCert and GlobalSign so that you can use KeyVault to
generate new certificates and automatically renew existing ones. Let’s Encrypt
certificates (free and just as secure as the ones from commercial CAs) are
FREE TRIAL 82
DISK ENCRYPTION
One good way to protect your VMs in the cloud is to encrypt their disks, Windows
VMs use Bitlocker, Linux uses DM-Crypt. Note that the first version of disk
encryption stored the keys in AAD, the current version uses Key Vault.
encryption with customer managed keys is a powerful way for you to have
control over the keys, but you must store the keys in Azure Key Vault.
AAD was introduced in the last chapter. Here we’ll look at the common Azure
roles you’ll want to apply to different people who are managing your VMs.
The basic RBAC principle is that there are three levels: Owner, Contributor
and Reader. The first can make any change as well as assign permissions
but not change its permissions. The Reader can see the configuration but not
make any changes. These permissions can then be applied at a resource level
(not a good idea, too hard to manage), RG level, Subscription level and
Management Group level (all commonly used). VMs have other roles such
We’ve mentioned NSGs several times but not explained them. They’re a free
software firewall solution that can filter traffic into and out of vNets, and between
vNets. The vm-IaaSVM5 that we have should have an NSG associated with it.
You’ll find it under Settings – Networking under the Inbound port rules list.
It should be called vm-IaaSVM5-nsg, click on it. On the Overview tab you can
see the default rules that are created for both inbound and outbound traffic
and under Settings you can add or edit rules, associate the NSG with a NIC
FREE TRIAL 84
Network Security Group rules
AZURE FIREWALL
control and lets you easily build hub and spoke vNet architectures. The best way
to manage Azure Firewall (and the only way for the new Azure Firewall Premium)
is the unified management console, Firewall Manager that lets you manage all
Azure Firewalls in your estate. Coming soon is also the ability to manage DDOS
MICROSOFT SENTINEL
based SIEM tool hosted in Azure is a perfect complement to give you security
insight into your VMs (and your AAD, Microsoft 365 + 100’s of non-Microsoft
data sources) in a single console.
Back when edition 1 was being written, Azure Confidential Computing was in
its infancy, now it’s ready for prime time for the right workloads. For a long time,
we’ve been protecting data in flight / on the network using TLS or VPN tunnels.
Similarly, we protect data at rest with full disk encryption such as Bitlocker
(standard in Azure and should be on for all your mobile devices). But protecting
data while it’s being processed has been significantly harder to achieve.
In recent years, both Intel and AMD have released CPUs that offer enclaves,
parts of the CPU and associated memory that’s encrypted and not available
to the rest of the OS, only the application written specifically to take advantage
administrators don’t have access to this data, even if they otherwise have full
control over the VM. Early iterations of these enclaves provided very little
Recently both AMD and Intel now offer CPUs that can “contain” a whole VM
in Confidential Computing. Particularly the new AMD based DCasv5 and ECasv5
VM series lets you lift and shift VMs from on-premises to Azure into Confidential
Computing, while the Intel SGX Gen3 CPUs offer 8 vCPUs and 1500x the amount
of memory previous enclaves provided. This technology is also available for Azure
Kubernetes Services (AKS) worker nodes and built into SQL Server / Azure SQL.
only part of the puzzle. You’re only as strong as your weakest link!
86
CHAPTER 11 – AUTOMANAGE
The overhead of managing VMs compared to other cloud services can be a challenge,
in this chapter we’re going to look at a simple way to lessen this burden.
IAAS VS PAAS
and all the other PaaS services are so popular is the fact that they (more or less)
abstract away the underlying infrastructure and complexity. VMs on the other
hand require a lot of “care and feeding” in the form of patching, governance,
back up, security, monitoring etc. Most IT Pros don’t notice because it’s what
we’ve been doing for the last 20 years on-premises. Lifting and shifting VMs
to the cloud doesn’t fundamentally change how you do IT, apart from no longer
having to swap broken HDDs or NICs. If I had to pick the single best improvement
in Azure IaaS since the first edition of this eBook, this is it.
maintenance, both in Azure and for any Arc connected machine (chapter 12).
You can think of this as taking Microsoft documentation on best practices for
having to read all the docs and then manually configure all the right settings.
FREE TRIAL 87
Do a search for Automanage and click Enable on existing machine,
Enable Automanage
Click on View Azure Best Practices profiles to see what each profile configures.
Automation Account, Log Analytics Workspace and Boot Diagnostics. Dev / Test
is similar but drops Backup and Monitoring (common for non-production VMs).
Note that you can click on the arrow next to each service and see exactly how
Not only does Automanage set all these settings for each VM you apply the
configuration to, but it also monitors for drift over time. Most importantly, you
can use Policy to enforce that it’s applied to VMs when they’re created. And you
can create custom profiles with exactly the settings your organization requires.
Using Automanage itself is free, but if you haven’t used Backup for example
before, enabling it will incur the normal cost of Backup storage etc. Currently
If you have production VMs in Azure (or elsewhere and are using Arc), do yourself
a favor and adopt Automanage, it’ll make managing your VM fleet much easier.
89
CHAPTER 12 AZURE ARC
Another interesting thing that’s happened since the first edition of this eBook is
the release of Azure Arc. Here Microsoft shows their leadership in hybrid cloud,
supporting businesses who are all in the cloud, businesses who are just starting
not a quick stop along the way. In this chapter we’ll look at Azure Arc and
how you can use it to make Azure your control plane for your resources,
HYBRID HARDWARE
On the hardware side there’s Azure Stack Hub, a rack of 4-16 servers that you
buy from a set of OEMs which run “real Azure” code and offer a subset of the
services in public Azure. You then put these racks wherever you need them
(remote operations, cruise ships etc.) and write ARM templates and applications
for it just like you would for public Azure. It’s an appliance where you have no
access to the underlying hosts, and you pay for what you use. It also runs VMs.
If you’d like more control over the hosts there’s Azure Stack HCI, which combines
the best of Windows Server, Hyper-V, Storage Spaces Direct into clusters you
build or purchase from an OEM. You also pay a subscription fee based on
the number of cores in each host, but in return you get all new features such
as the ability to run Azure Kubernetes Services (AKS) anywhere, and now in preview
FREE TRIAL 90
the ability to run Azure Virtual Desktop. Then there’s Azure Stack Edge, a set
HYBRID SOFTWARE
On the software side there’s Azure Arc, a set of features that extend Azure’s control
plane to VMs, databases and Kubernetes on-premises and in any other cloud.
Arc gives you inventory, management, governance, and security for ALL your
machines (connected via Arc) in any location. You can use Arc to deploy Azure
VM extensions to monitor, secure and patch servers. For any Cloud Native
and secure them using Azure Policy, plus use GitOps to configure the cluster
automatically from a Git repository. You can also run Azure data services on any
(in preview) uses Kubernetes clusters to train, inference and manage ML models.
Most excitingly however, is the preview of Azure Arc for VMware vSphere.
(stop, start, restart, resize, adding or updating disks, managing NICs) directly
from the Azure portal. It also supports ARM templates to enable DevOps
to each VM. The synchronization between Azure and your vSphere infrastructure
Arc is an interesting twist to the multi cloud approach. Some businesses choose
to deploy some workloads in AWS and some in Azure for example, the thinking
being that they won’t have a widespread outage simultaneously. There are many
challenges with this approach, such as skilling staff to manage multiple platforms
and ending up with “lowest common denominator” deployments to ensure portability.
But one big challenge, managing multiple clouds in different portals can be
a lot easier with Arc – deploy VMs, Kubernetes clusters and databases in AWS,
There’s also a marriage between the hardware and software, specifically Azure
Stack HCI now automatically Arc enrolls the hosts (from version 21H2) which
will also let you easily deploy extensions to VMs. Further, you can create and
manage VMs on your on-premises Azure Stack HCI cluster from the Azure portal.
FREE TRIAL 92
ARC FOR SERVERS
Since we’re focusing on VMs, let’s dig deeper into what Azure Arc for Servers
offers. Arc connected Linux and Windows servers are given a Resource ID and
are placed in a Resource Group that you designate. You can now tag each server
and you can apply Policy guest configurations (chapter 6) to them, use Defender
for Endpoint via Defender for Cloud (chapter 10), connect them to Microsoft
If you’re running SQL Server inside an Arc server, other scenarios light up as well.
VMs that lets you try out many different scenarios hands on.
It pays to follow Arc if you have any kind of hybrid infrastructure – Arc is spreading
FREE TRIAL 94
CHAPTER 13 – AUTOMATION
In this chapter we’ll tie the previous chapters together. You’ve learnt how
to deploy single VMs and groups of VMs, how to lay the foundation with
networking and picking the right storage for VMs, selecting the right type of VM,
how to monitor them, using ARM and Bicep to templatize your deployments,
back up and protect your VMs data, use AAD for identity wisely, and how to
Here we’re going to round out the IaaS story with Automation and Azure Advisor
recommendations, which will give you the foundation to manage Azure IaaS VMs
like an expert.
AZURE AUTOMATION
your on-premises, Azure and other clouds resources. It lets you orchestrate
and track changes and configure desired state, and as we saw in the last chapter,
click Create. Call your account aa-IaaS, put it in the rg-AzureIaaS RG, leave
System assigned Managed Identity selected, click Create. Once it’s been
gallery. Here you can see a list of ready-made runbooks that you can customize,
you can also filter based on the type of runbook. You’ll find runbooks to start
and stop VMs (by tags if you’d like), find and delete orphaned disks, resize VMs
FREE TRIAL 96
Automation Runbook Gallery
Hybrid worker groups lets you set up agents on-premises or in other clouds
to automate processes there. It’s generally easy to automate actions for Azure
Hybrid Worker Extension works with Arc connected servers (chapter 12) should
make this easier. Schedules lets you define custom timetables that you can then
use for your runbooks and Credentials lets you enter various secrets that can
Change Tracking and Inventory keeps track of changes to files, registry entries,
services, and Linux daemons in VMs to help you catch operational issues. State
your configurations, resources and target node information across both Linux
and Windows.
(currently in preview) which combines the best features of DSC (without the
RUN COMMANDS
Azure has had the ability to run commands from the portal in VMs for some
time. Recently the managed Run Command preview was released which lets
you deploy them using ARM templates, run them in parallel or sequentially,
specify the time out and let scripts run for hours / days and let you pass
VM APPLICATIONS
Currently in preview there’s a new way to manage applications for your Azure
IaaS Linux and Windows VMs called VM Applications. It uses the Azure Compute
Gallery to distribute the applications, globally if you need it. There are some
limitations in the preview, only five applications per VM and each installer
FREE TRIAL 98
AZURE LIGHTHOUSE
estate for you, make sure they’re using Azure Lighthouse. This allows them
to publish an offer to you where they get scoped access to a set of resources
in your tenant with RBAC permissions so that they can either be readers
or contributors (but not owners). Furthermore, you can enforce that they use
MFA when managing your resources and you can revoke access at any time.
AZURE ADVISOR
Advisor dashboard 99
As a human cloud consultant my advice is – take the recommendations from
Advisor with a pinch of salt. Sometimes they’re very useful and alert you to
implemented with less-than-ideal results. But Azure changes very quickly and
to remember to go to the Advisor blade you can set up alerts to notify you
of recommendations.
The last 13 chapters have all focused on running and managing VMs in Azure – IaaS.
This is comfortable territory for most IT Pros, after all we’ve been virtualizing
workloads on premises for a long time and the paradigm is familiar. It also helps
But Azure is SO much more than just IaaS and in fact started as a PaaS platform
(unlike AWS which started as an IaaS platform). In this chapter we’re giving you
a taste of what’s beyond the familiar walls of the IaaS castle that you can apply
to your business requirements. The main benefits you get from complementing
IaaS with PaaS and SaaS services is cost effectiveness (for example, Azure SQL
is considerably more cost effective than running your own SQL database in a VM
and that’s before you count the labor cost of managing yet another VM) and agility.
In fact, this book has already taught you many PaaS / SaaS services that help you
run your VMs such as vNets, Azure Monitor, AAD, Azure Bastion, NSGs / Firewall
and ASC as well as Automation. This chapter will show you a few more services
This service has grown tremendously over the last couple of years, as many
their staff that they could access from their homes on any device. AVD (formerly
Windows Virtual Desktop) has clients for Android, iOS, MacOS and Windows.
One of the things you manage as an AVD administrator is the underlying VMs,
how many users can fit onto each Windows 10 Multisession host in the pool is
controlled by the size of that VM. So, everything you learnt in chapter 2 applies.
AZURE SQL
There are three basic flavors of SQL Server in Azure – you can run it as your
own VM which gives you full control but considerable management overhead
(although Azure helps with Backup and hybrid licensing). Or you can use Azure
SQL Database, a fully managed platform where you don’t have to worry about
the VMs or backup at the cost of some SQL compatibility. Scale is not an issue
with the Hyperscale SKU which lets you go up to 100 TB databases with lightning
fast backups and restores, read-only replicas and rapid compute scale up and down.
The third option is SQL Managed Instance, which is “real” SQL server running
in VMs but they’re managed by Microsoft, with near 100% compatibility with
your existing SQL Servers that you’re migrating to Azure. So, if you’re the application
you’re migrating relies on SQL Server, investigate your options carefully; perhaps
managing and paying for that large VM to run 24/7 isn’t the best option.
If you need a global database that can have both read and write replicas deployed
in multiple regions with a mouse click and that can “talk” several different languages,
Cosmos DB is your friend. It’s got APIs for SQL, MongoDB, Cassandra, Tables,
or Gremlin. There are five options for consistency levels; the tradeoff between
how up-to-date each copy of the database is globally versus the latency
There are other data services that’ll help you manage all types of data such
Data Lake (combining file storage semantics with Big data), Stream Analytics
Besides SQL and Cosmos, Azure has managed offerings of MySQL, PostgreSQL
and MariaDB.
WEB APPLICATIONS
If you have websites running on Apache or IIS, App Service is a good alternative
to migrate to instead of running your own web server VMs. If you need an isolated
Content Delivery Networks (CDN), Media Services for streaming video and AI
a whole server with a motherboard, ports, virtual CPUs, and memory etc.,
Linux pioneered containers and Windows has two flavors, including the more
secure and isolated Hyper-V container flavor that Azure uses. If you’re looking
to write new applications for the cloud era, using containers and a micro
by Azure Kubernetes Service (AKS). If that’s too much to manage, but your
SERVERLESS
A flavor of PaaS services that’s grown tremendously over the last few years
servers underneath. Azure Functions lets you upload your code and have
This book will have given you a good grounding in how to create, manage
and run VMs in Azure but this is just a start. In this rapidly changing landscape,
it’s important to keep up to date with the latest developments. A great way
of doing this is with Azure notes, the Azure Podcast, John Savill’s technical
Learning the technical steps for creating VMs and associated services is a great
first step for understanding Azure. Beyond this is the fundamental change in how
to “do IT” that comes with truly adopting a cloud mindset and DevOps (and
DevSecOps) that’s awaiting you and your team – I wish you success on this journey.
Make sure to delete the rg-AzureIaaS resource group and any other lingering
resources so you don’t use up your trial credits. If you’ve performed backups
of VMs you might have to jump through some extra hoops to delete them.
On-demand webinar
Watch >
Blog article
Read >
Blog article
Read >
Blog article
Read >
106
EXPLORE OTHER EBOOKS
Admin Center
of your investment!
107
SECURE YOUR DATA
TRY OUR TOOLS.
Hyper-V & VMware Backup & Replication Hyper-V & VMware Backup & Replication
Award-winning virtual machine (VM) Monthly subscription program enabling
backup and replication solution MSPs to offer Hyper-V, VMware and
for Hyper-V and VMware environments physical Windows server backup services
We offer you two comprehensive packages for your company security management developed for Microsoft 365:
With 365 Total Protection Business, you get a comprehensive security solution with a wide range of features that ensure your
email and data security in Microsoft 365. The Enterprise version covers legally compliant email archiving with advanced features
and offers intelligent protection against advanced persistent threats by using AI-based analysis mechanisms.
Protection from:
All aspects of security administration are easy to manage with 365 Total Protection –
without the need for maintenance or updates. Existing user profiles can be managed or created in mere seconds.
Operation in 3
certified
German
data centers Domains
User Automatic MICROSOFT 365
Groups synchronization
HORNETSECURITY
365 TOTAL PROTECTION
www.hornetsecurity.com I info@hornetsecurity.com
109
START YOUR 30-DAY TRIAL