Microsoft Azure Storage
Microsoft Azure Storage
Avinash Valiramani
Microsoft Azure Storage: The Definitive Guide
Published with the authorization of Microsoft Corporation by: CREDITS
Pearson Education, Inc.
EDITOR-IN-CHIEF
Copyright © 2024 by Pearson Education, Inc. Brett Bartow
All rights reserved. This publication is protected by copyright, and permission EXECUTIVE EDITOR
must be obtained from the publisher prior to any prohibited reproduction, Loretta Yates
storage in a retrieval system, or transmission in any form or by any means, DEVELOPMENT EDITOR
electronic, mechanical, photocopying, recording, or likewise. For information Kate Shoup
regarding permissions, request forms, and the appropriate contacts within the
Pearson Education Global Rights & Permissions Department, please visit MANAGING EDITOR
www.pearson.com/permissions. Sandra Schroeder
No patent liability is assumed with respect to the use of the information con- SENIOR PROJECT EDITOR
tained herein. Although every precaution has been taken in the preparation of Tracey Croom
this book, the publisher and author assume no responsibility for errors or omis-
COPY EDITOR
sions. Nor is any liability assumed for damages resulting from the use of the
Sarah Kearns
information contained herein.
INDEXER
ISBN-13: 978-0-13-759318-7 Ken Johnson
ISBN-10: 0-13-759318-X
PROOFREADER
Donna E. Mulder
Library of Congress Control Number: 2023938511
TECHNICAL EDITOR
$PrintCode Thomas Palathra
SPECIAL SALES
For information about buying this title in bulk quantities, or for special sales
opportunities (which may include electronic versions; custom cover designs;
and content particular to your business, training goals, marketing focus, or
branding interests), please contact our corporate sales department at
[email protected] or (800) 382-3419.
While we work hard to present unbiased content, we want to hear from you about any
concerns or needs with this Pearson product so that we can investigate and address them.
iii
Contents at a Glance
Acknowledgments xii
Chapter 2
Azure Files 79
Chapter 3
Azure Managed Disks 139
Chapter 4
Azure Queue Storage 193
Chapter 5
Azure Data Box 231
Chapter 6
Azure Data Share 251
Index 273
v
Contents
Acknowledgments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xii
About the author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Contents vii
Static website hosting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Data protection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Soft delete for containers and blobs 59
Blob versioning 59
Blob change feed 60
Point-in-time restore 61
Data protection walkthrough 61
Azure Backup integration 65
Blob snapshots 70
Disaster recovery. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Storage account failover 74
Last Sync Time 74
Best practices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
viii Contents
Encryption for at-rest data 124
Soft delete 124
Share snapshots 124
Azure Backup integration 127
Best practices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Contents ix
Requiring secure transfers 220
Enforcing TLS versions 220
Identity and access considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Data redundancy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Disaster recovery 225
Storage account failover 225
Last Sync Time 226
Data encryption. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Infrastructure encryption 227
Service-level encryption 228
Client-side encryption 228
Best practices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
x Contents
Chapter 6 Azure Data Share 251
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Key features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
Key concepts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Data types 252
Data provider 252
Data consumer 252
Sharing models 253
Data stores 254
Sharing caveats 254
Managed identities 256
Share and receive data with Azure Data Share . . . . . . . . . . . . . . . . . . . . . . 257
Set up an Azure Data Share resource to share data
walkthrough 257
Set up an Azure Data Share resource to receive data
walkthrough 265
Best practices. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Index 273
Contents xi
Acknowledgments
At the outset, I want to express my deepest gratitude to Loretta Yates for bestow-
ing upon me this tremendous responsibility. Only because of your unwavering trust
and belief in my abilities, these books have come to fruition. I am forever grateful
for the opportunity you have given me.
To my amazing mom, I am incredibly grateful for your unwavering support
throughout the past two years as I wrote these books. Your love and understanding
have meant the world to me. Thank you for being my rock.
To Celine, my sincere gratitude for being a constant source of guidance and
assistance, whenever I needed you, throughout the journey of these last three
books. Celine, thank you for your constant presence and encouragement. It has
made this journey all the more meaningful.
To my beloved family, I am forever grateful for your understanding and patience
during the countless hours I spent engrossed in writing these books.
To my extended family, thank you for tolerating my absence for over two years
as I immersed myself in this writing endeavor. Hope to catch up with you all soon.
A heartfelt thank you goes to Kate Shoup for her exceptional editing and review
work throughout all four books in the series. Your keen eye for detail and guidance
throughout these books have been immeasurably valuable. Collaborating with you
has been an enriching experience, and I am grateful for your exceptional skills as an
editor.
I would also like to express my appreciation to Thomas Palathra, Sarah Kearns,
and Tracey Croom for their meticulous contributions that brought this book to its
completion. This endeavor has been a collective labor of love, and I am elated and
grateful for our collaborative efforts.
Lastly, I extend my thanks to the entire Microsoft Press/Pearson team for their
support and guidance throughout this project. Your expertise and guidance have
been instrumental in shaping this book, and I am grateful for the opportunity to
work alongside such a dedicated team.
Thank you all for being a part of this incredible journey. Your contributions and
support have made these books a reality, and I am humbled and grateful for each
and every one of you.
xii
About the author
Avinash Valiramani is a highly experienced IT Infrastructure and Cloud Architect,
specializing in Microsoft Technologies such as Microsoft Azure, Microsoft 365,
Windows Server, Active Directory, Microsoft Exchange, SCCM, Intune, and Hyper-V.
With over 17 years of expertise, he has worked with large and mid-size enterprises
globally, designing their Cloud Architecture, devising migration strategies, and
executing complex implementations. Avinash holds multiple certifications in Azure
Infrastructure, Azure Artificial Intelligence, Azure Security, and Microsoft 365.
As part of the Microsoft Azure Best Practices series, Avinash is currently pub-
lishing four books, including this one, that draw from extensive real-world experi-
ences. These books provide a comprehensive and concise resource for aspiring
technologists and professionals alike. In addition to his Microsoft expertise, Avinash
is also certified in Amazon AWS, Barracuda, Citrix, VMware, and other IT/Security
industry domains, which further complements his skill set.
Avinash’s contributions extend beyond writing books. He has authored an
Azure Virtual Desktop course for O’Reilly Media and has plans for creating
additional courses in the near future. You can stay updated with Avinash’s insights
and updates by following him on Twitter at @avaliramani. Furthermore, he will
be sharing frequent blogs on his websites www.avinashvaliramani.com and
www.cloudconsulting.services.
With his wealth of experience, industry certifications, and passion for advanc-
ing cloud technologies, Avinash Valiramani is a trusted advisor and sought-after
resource in the realm of Microsoft Azure and Microsoft Office365. His expertise
and dedication make him an invaluable asset for anyone seeking to leverage the
full potential of the cloud.
xiii
Introduction to Microsoft Azure
Storage
Welcome to Microsoft Azure Storage: The Definitive Guide. This book includes
in-depth information about the various Azure services that provide storage capa-
bilities and shares best practices based on real-life experiences with these services
in different environments.
This book focuses primarily on Azure storage services generally available during
2022, encompassing development work done on these services over the years.
A few storage features and functionalities were under preview at the time of this
writing and could change before they are widely available; thus, we will cover the
most notable ones in subsequent iterations of this book as they go live globally.
Overview
Over the years, Microsoft has introduced services related to the Azure storage
stack to address various types of application and infrastructure requirements.
Microsoft has released regular updates to these services, introducing additional
features and functionality, enhancing each service’s support matrix, and making
these services easier to deploy and manage with each iteration.
Following is a brief timeline of the announcement of each of these services in
public preview or general availability:
■■ Azure Blob Storage February 2010
■■ Azure Queue Storage February 2010
■■ Azure Files September 2015
■■ Azure Managed Disks February 2017
■■ Azure Data Box September 2017
■■ Azure Data Share July 2019
Each service provides customers with different options and features to address
their storage requirements. This book dives into each of these services to highlight
important considerations in deploying and managing them and to share associated
best practices.
xiv
Each chapter focuses first on the features provided by a service. The chapter
then explores in-depth the concepts behind that service and the components that
comprise it so you will understand how that service can deliver value in your Azure
deployment. Finally, each chapter focuses on deployment considerations and strat-
egies where necessary, with step-by-step walkthroughs to illustrate deployment
and management methods, followed by some best practices.
Introduction xv
■■ Function as a service (FaaS) Function as a service (FaaS) offerings go one
step beyond PaaS to enable organizations to focus only on their application
code, leaving the entire back-end infrastructure deployment and manage-
ment to the cloud service provider. This provides developers with a great
way to deploy their code without worrying about the back-end infrastruc-
ture deployment, scaling, and management. It also enables the use of
microservices architectures for applications. An example of an Azure FaaS
offering is Azure Functions. There are no such examples for storage services.
In the Azure storage stack, some services fall under the PaaS category, including
the following:
■■ Azure Queue Storage This PaaS service enables you to store large num-
bers of messages in a queue that can be ingested and processed by various
application workloads.
■■ Azure File Share This PaaS service allows you to configure and manage
SMB/NFS file shares in the Azure cloud platform and access them from
Azure or on-premises environments.
Each cloud-service category has various features and limitations. Limitations
might relate to the application, technological know-how, costs for redevelopment,
among others. As a result, most organizations use some combination of different
types of these cloud services to maximize their cloud investments.
Each service provides a different level of control and ease of management. For
example:
■■ IaaS provides maximum control and flexibility in migration and use.
■■ FaaS provides maximum automation for workload deployment, manage-
ment, and use.
■■ PaaS provides a mix of both at varying levels, depending on the PaaS service
used.
Each service also offers varying levels of scalability or redundancy. For example:
■■ IaaS might require the use of additional services to achieve true geographi-
cal redundancy—for example, using Azure Site Recovery services, a PaaS
service, to replicate Azure VMs and the underlying Azure managed disks
across multiple Azure regions for redundancy and disaster recovery.
■■ PaaS and FaaS services are generally designed with built-in scalability and
load-balancing features—for example, Azure Blob Storage with GRS redun-
dancy level automatically replicates data to another Azure region.
xvi Introduction
Cost-wise, each service provides varying levels of efficiency. For example:
■■ FaaS offerings charge for compute based only on the usage hours for
compute services, making them extremely cost-effective.
■■ IaaS offerings charge for compute services regardless of usage once the
compute service (for example, a VM) is online.
■■ PaaS offerings are a mixed bag depending on how the services are config-
ured. Some PaaS products charge for storage resources regardless of usage,
while others, if configured correctly, charge based on usage alone. For
example:
■■ Azure standard file shares are charged based on the storage used to store
the data in the primary region and secondary region, if configured for
GRS.
■■ Azure premium file shares are charged based on the storage allocated to
store the data in the primary region and secondary region, if configured
for GRS, regardless of the storage used.
Introduction xvii
xviii
Start
Introduction
On-premises Cloud-native Storage
Disks Yes application that Migrate New Build Yes
Migrate or app with persistent
uses a local disk new build? unstructured data
or iSCSI
Option 1
No No
Backup and
Container-based Yes
disaster recovery or
Yes application using long-term data
persistent volumes retention
No
No
No
No Azure Managed
Disks
Yes
IaaS VM or VMSS with disk
Azure Data Box
Move large volume storage
Yes
of data to Azure
Archive Blob Storage Option 1
No
Container-based
application using Yes
persistent volumes
No
Option 2
Azure Files
Yes Storage
SMB/NFS cloud-native
File Share
Azure Data
Container-based Yes Shares
application using
persistent volumes
Introduction xix
■■ Chapter 5: Azure Data Box
■■ Chapter 6: Azure Data Share
Each chapter focuses on a specific Azure storage service, covering its inner
workings in depth, with walkthroughs to guide you in building and testing the
service and real-world best practices to help you maximize your Azure investments.
The approach adopted for the book is a unique mix of didactic, narrative, and
experiential instruction:
■■ The didactic component covers the core introductions to the services.
■■ The narrative leverages what you already understand and acts as a bridge to
introduce concepts.
■■ The experiential instruction takes into account real-world experiences and
challenges in small and large environments and the factors to consider while
designing and implementing workloads. Step-by-step walkthroughs on
how to configure each Azure monitoring and management service and its
related features and options enable you to take advantage of all the benefits
each service has to offer.
System requirements
To get the most out of this book, your system must meet the following
requirements:
■■ An Azure subscription Microsoft provides a 30-day USD200 trial
subscription that can be used to explore most services covered in this book.
Some services, such as dedicated hosts, cannot be created using the trial
subscription, however. To test and validate these services, you will need a
paid subscription. If you plan to deploy any of these restricted services, you
will need to procure a paid subscription.
■■ Windows 10/11 This should include the latest updates from Microsoft
Update Service.
■■ Azure PowerShell For more information, see https://docs.microsoft.com/
en-us/powershell/azure/install-az-ps.
■■ Azure CLI For more information, see https://docs.microsoft.com/en-us/cli/
azure/install-azure-cli.
■■ Display monitor This must be capable of 1024 x 768 resolution.
■■ Pointing device You need a Microsoft mouse or compatible pointing
device.
xx Introduction
About the companion content
The companion content for this book can be downloaded from one of the
following pages:
https://MicrosoftPressStore.com/StorageTDG/downloads
https://github.com/avinashvaliramani/AzureStorageTDG
The companion content includes the following:
■■ PowerShell code for each walkthrough in the book (where applicable)
■■ CLI code for each walkthrough in the book (where applicable)
MicrosoftPressStore.com/StorageTDG/errata
If you discover an error that is not already listed, please submit it to us at the
same page.
For additional book support and information, please visit MicrosoftPressStore.
com/Support.
Please note that product support for Microsoft software and hardware is
not offered through the previous addresses. For help with Microsoft software or
hardware, go to http://support.microsoft.com.
Stay in touch
Let’s keep the conversation going! We’re on Twitter: http://twitter.com/
MicrosoftPress.
Introduction xxi
Chapter 3
Key features
Some key features and benefits of using managed disks in your Azure environment
include the following:
■■ High availability, resiliency, and redundancy Microsoft provides 99.999%
availability for VM workloads that use managed disks. Managed disks are designed
to maintain multiple replicas—three to be exact, spread across an Azure region.
This makes managed disks extremely resilient, and ensures that your workload
can continue to process even if there are issues with one or two replicas. Microsoft
provides an industry leading 0% annualized failure rate.
■■ High scalability Microsoft currently supports the deployment of 50,000 man-
aged disks per region per subscription, allowing large enterprises to deploy thou-
sands of VMs in a single subscription.
■■ Support for large Virtual Machine Scale Sets (VMSS) You can use managed
disks with VMSS. The scalability of managed disks makes it possible to deploy large
VMSS consisting of up to 1,000 nodes.
139
■■ Support for availability sets Azure Managed Disks provides native integration with
availability sets. Disks for VMs that are part of an availability set are spread across mul-
tiple fault domains with the selected Azure region and isolated from each other.
■■ Support for availability zones You can deploy managed disks across availability
zones to improve redundancy. Availability zones provide additional redundancy over
availability sets because the power and networking in each availability zone is indepen-
dent of the others.
■■ Support for existing virtual hard disks (VHDs) You can easily upload existing VHDs
up to 32 terabytes (TB) in size to Azure for use as managed disks. This process makes it
extremely easy for organizations to migrate their existing workloads to Azure.
■■ Role-based access control (RBAC) Azure Managed Disks supports permission
management using Azure RBAC, making it possible to granularly assign permissions to
managed disks to administrators based on their roles and responsibilities.
■■ Native integration with Azure Backup You can use Azure Backup to back up man-
aged disks from within the Azure Managed Disks service. You can schedule backups
during off-peak hours and retain backups based on your organizational policies. You
restore backups from the Azure Backup service.
■■ Disk encryption Managed disks are encrypted by default. They support multiple
types of encryption, including Microsoft-managed encryption keys, customer-managed
encryption keys, and double encryption with both types of keys. In addition, managed
disks support Azure Disk Encryption, which allows you to encrypt the disk inside the VM
using BitLocker for Windows or DM-Crypt for Linux VMs.
■■ Easy migration for unmanaged disks You can easily migrate unmanaged disks
stored in Azure Storage accounts to managed disks. This increases the resiliency and
redundancy of your IaaS VMs and provides significantly higher availability for your
workloads.
■■ Support for shared disks for clustered applications You can set up managed disks
as shared disks. This allows you to attach them to multiple VMs to host or migrate clus-
tered applications to Azure.
■■ Disk bursting for better performance Managed disks allow you to increase the
IOPS available for use for Premium and Standard SSD disks with on-demand or credit-
based bursting models. Each model provides different capabilities to maximize the
performance of your workloads when needed.
■■ Private Link Support You can use Private Link to import or export managed disks to
or from Azure. This enables organizations to securely transfer disk data over a com-
pletely private connection.
Key concepts
Now that you have an initial understanding of the Azure Managed Disks service, let’s spend
some time going through all the different components and features in detail.
NOTE Every VM has an OS disk. Whether a VM has a temporary disk depends on the
VM model. Data disks are optional based on your workload requirements.
Disk types
Azure offers four types of disks:
■■ Standard HDD disks
■■ Standard SSD disks
■■ Premium SSD disks
■■ Ultra disks
Ultra disks
Ultra disks currently provide the highest level of performance in terms of IOPS and disk
throughput, with sub-millisecond latency 99.99% of the time. This makes Ultra disks suitable
for critical high-performance workloads such as SAP HANA, mission-critical databases, and
transaction-heavy applications.
TIP Review the latest guidance available from Microsoft when planning your deploy-
ment, as these limitations may have changed by that time.
IMPORTANT If you are following along, select resources and resource names based
on your environment.
IMPORTANT If you are following along, be sure to delete any unwanted resources
after you have completed testing to reduce charges levied by Microsoft.
FIGURE 3-1 Searching for the Disks service in the Azure portal.
3. In the Basics tab of the Create a Managed Disk wizard (see Figure 3-3), enter the follow-
ing information:
■■ Subscription Select the subscription in which you want to create the new man-
aged disk.
■■ Resource Group Select an existing resource group in which to create the new
managed disk or create a new one.
■■ Disk Name Enter a unique name for the managed disk.
■■ Region Select the Azure region where you want to host the managed disk.
■■ Availability Zone Select the availability zone you want to use or leave this option
set to None (the default).
■■ Source Type If the disk will be created from source data, such as a snapshot, stor-
age blob, another disk, etc., select the source type.
4. To create a disk that is a different redundancy level, type, size, or performance tier from
the default (1,024 GiB Premium SSD LRS), click the Change Size link in the Size section
of the wizard’s Basics tab.
5. In the Select a Disk Size dialog box, open the Disk SKU drop-down list and choose a
disk type/redundancy level pairing. (See Figure 3-4.)
FIGURE 3-3 The Basics tab of the Create a Managed Disk wizard.
7. Back in the Basics tab of the Create a Managed Disk wizard, click Next.
8. In the Encryption tab of the Create a Managed Disk wizard (see Figure 3-6), open the Key
Management drop-down list and choose Platform-Managed Key, Customer-
Managed Key, or Platform-Managed and Customer-Managed Keys. Then click Next.
NOTE To use customer-managed keys, you must first generate and store the keys in
the Azure Key Vault service.
FIGURE 3-6 The Encryption tab of the Create a Managed Disk wizard.
9. In the Networking tab of the Create a Managed Disk wizard (see Figure 3-7), in the
Network Access section, leave the Enable Public Access from All Networks option
button selected and click Next.
10. In the Advanced tab of the Create a Managed Disk wizard (see Figure 3-8), enter the
following information and click Next:
■■ Enable Shared Disk If you want to use this managed disk as a shared disk, select
the Yes Option button. Then use the Max Shares drop-down list to specify how
many VMs will share the disk.
NOTE For more on shared disks, see the section “Shared disks” later in this chapter.
NOTE The Enable On-Demand Bursting check box is available only if your managed
disk is 512 GB or more. This option is covered in more detail later in this chapter.
■■ Enable Data Access Authentication Mode Optionally, select this check box to
enable data access authentication. When you enable data access authentication, you
can limit who can download the disk to admins who are authorized using Azure AD
and authenticated using an approved account.
FIGURE 3-8 The Advanced tab of the Create a Managed Disk wizard.
FIGURE 3-9 The Tags tab of the Create a Managed Disk wizard.
12. In the Review + Create tab (see Figure 3-10), review your settings, and click Create to
create the managed disk.
FIGURE 3-10 The Review + Create tab of the Create a Managed Disk wizard.
#Define variables
$resourceGroup = "RG01"
$location = "EastUS2"
$vm = "SourceVM"
$MgdDiskName = "ManagedDisk01"
#Verify disk
Get-AzDisk `
-ResourceGroupName $resourceGroup `
$Azvm = Add-AzVMDataDisk `
-VM $vm `
-Name $MgdDiskName `
-CreateOption Attach `
-ManagedDiskId $MgdDisk.Id `
-Lun 1
Update-AzVM `
-ResourceGroupName $resourceGroup `
-VM $Azvm
#Define variables
resourceGroup="RG01"
location="EastUS2"
vm="SourceVM"
MgdDiskName="ManagedDisk01"
#Verify disk
mgddisk=$(az disk show \
--name $MgdDiskName \
--resource-group $resourceGroup)
NOTE Another book in this series, Microsoft Azure Networking: The Definitive Guide,
covers Private Link in detail in Chapter 10.
IMPORTANT If you are following along, select resources and resource names based
on your environment.
IMPORTANT If you are following along, be sure to delete any unwanted resources
after you have completed testing to reduce charges levied by Microsoft.
2. On the Disk Access page, click Create Disk Access. (See Figure 3-13.)
3. In the Basics tab of the Create a Disk Access wizard (see Figure 3-14), enter the following
information:
■■ Subscription Select the subscription in which you want to create the disk access
resource.
■■ Resource Group Select an existing resource group in which to create the disk
access resource or create a new one.
■■ Name Enter a unique name for the disk access resource.
■■ Region Select the Azure region where you want to host the disk access resource.
Before you continue with the Create a Disk Access wizard, you need to create the private
endpoint. You’ll do that next.
4. At the bottom of the Basics tab, click Add.
5. In the Create a Private Endpoint dialog box (see Figure 3-15), enter the following infor-
mation and click OK:
■■ Subscription Select the subscription you want to use to create the private
endpoint.
■■ Resource Group Select an existing resource group in which to create the private
endpoint or create a new one.
■■ Location Select the Azure region where you want to host the private endpoint.
■■ Name Enter a unique name for the private endpoint.
■■ Target Resource Select Disks.
■■ Virtual Network Select the virtual network on which to create the private
endpoint.
■■ Subnet Select the subnet on which to create the private endpoint.
■■ Integrate with Private DNS Zone Select Yes to integrate with a private DNS zone
or select No if you plan to create a DNS record in your own DNS servers or on the
host files of the workloads VMs. In this case, select Yes.
■■ Private DNS Zone Select the private DNS zone with which you want to integrate
the private endpoint. In this case, leave it set to the default, privatelink.blob.core.
windows.net.
6. Click the Tags tab (see Figure 3-16), enter any tags you want to associate with the private
endpoint, and click Next.
7. In the Review + Create tab (see Figure 3-17), review your settings and click Create to
create the private endpoint.
FIGURE 3-17 The Review + Create tab of the Create a Disk Access wizard.
8. After the private endpoint is created, click Go to Resource to access its page. (See
Figure 3-18.)
9. In the left pane of the page for the managed disk you created earlier, under Settings,
click Networking.
10. On the managed disk’s Networking page (see Figure 3-19), perform the following steps
and click Save:
■■ Network Access Select the Disable Public Access and Enable Private Access
option button.
■■ Disk Access Select the private endpoint you just created.
#Define variables
resourceGroup="RG01"
az disk update \
--name $diskName \
--resource-group $resourceGroup \
--network-access-policy AllowPrivate \
--disk-access $diskAccessId
Encryption
Managed disks support two types of disk encryption:
■■ Server-Side Encryption (SSE) SSE manages encryption on the storage layer and is
handled by the Azure Storage service. It provides encryption-at-rest and during write
operations to the underlying storage, thereby ensuring that disks stored in Azure are
not readable in the event of data theft. SSE is enabled by default for all managed disks,
snapshots, and images across all Azure regions. SSE supports two types of key manage-
ment: Azure platform-managed keys or customer-managed keys. You can choose which
type of key management you want to use for each managed disk you create.
■■ Azure Disk Encryption (ADE) ADE refers to encryption within the system. It applies
to the OS and data disks in an Azure IaaS VM. ADE encryption is performed using
BitLocker technology in Windows and DM-Crypt technology in Linux. In both scenarios,
the keys are integrated and stored in Azure Key Vault to make it easier for you to man-
age them.
The first time you take a snapshot of a managed disk, it will be a full snapshot. Subsequent
snapshots, however, can be incremental. An incremental snapshot captures all changes to the
managed disk since the last snapshot of the disk. This reduces your storage footprint. If you
need to restore from a single incremental snapshot, Azure automatically identifies all the incre-
mental and full snapshots preceding the current one to reconstruct the entire disk. This makes
incremental snapshots extremely cost-effective, making them the preferred option for regular
snapshot management.
NOTE If the zone in which the incremental snapshot is created provides ZRS redun-
dancy capabilities, then the incremental snapshot will automatically be saved with ZRS,
too, unless specified otherwise.
NOTE If you are using full snapshots on premium storage to scale up VM deployments,
we recommend you use custom images on standard storage in the Shared Image Gallery.
This will help you achieve a more massive scale with a lower cost. For more on this, see
Chapter 2, “Virtual Machine Scale Sets,” in Microsoft Azure Compute: The Definitive Guide.
Incremental snapshots can also be useful for disaster recovery between Azure regions—
that is, you can identify changes between two snapshots of the same disk, and then transfer
only the differential changes to the secondary region instead of the entire snapshot. Then,
when you restore/rebuild in the secondary region, you can use the snapshot of the base blob
of the managed disk in combination with these differential changes. (See Figure 3-20.) This
strategy can reduce time, costs, and network requirements for disaster recovery for
managed disks.
NOTE Microsoft provides sample .NET code online to help you test this capability if
you are interested in exploring it.
GetPageRanges + PutPage
Incremental Snapshot 2 Page Blob Snapshot 2
GetPageRanges + PutPage
Incremental Snapshot 3 Page Blob Snapshot 3
Base Page Blob
Managed Disk
GetPageRanges + PutPage
Incremental Snapshot 4 Page Blob Snapshot 4
IMPORTANT If you are following along, select resources and resource names based
on your environment.
IMPORTANT If you are following along, be sure to delete any unwanted resources
after you have completed testing to reduce charges levied by Microsoft.
2. In the Basics tab of the Create Snapshot wizard (see Figure 3-22), enter the following
information and click Next:
■■ Subscription Select the subscription in which you want to create the snapshot.
■■ Resource Group Select an existing resource group in which to create the snapshot
or create a new one.
■■ Name Enter a unique name for the snapshot.
■■ Snapshot Type Leave this set to the default value of Full.
NOTE Figure 3-22 shows a Full button and an Incremental button. Your screen might
not reflect that because this is the first time you’re creating a snapshot of this managed
disk. The next time you create a snapshot, you’ll want to choose the Incremental button.
■■ Storage Type Select Standard HDD, Standard SSD, or Premium SSD, depending
on your needs. (Remember, this is for the full snapshot; incremental snapshots always
use Standard HDD disks.)
3. In the Encryption tab of the Create Snapshot wizard (see Figure 3-23), open the Key
Management drop-down list and choose Platform-Managed Key, Customer-Man-
aged Key, or Platform-Managed and Customer-Managed Keys. Then click Next.
NOTE To use customer-managed keys, you must first generate and store the keys in
the Azure Key Vault service.
4. In the Networking tab of the Create Snapshot wizard (see Figure 3-24), in the Network
Access section, select the Enable Public Access from All Networks option button.
5. The Advanced tab of the Create Snapshot wizard (see Figure 3-25) includes an Enable
Data Access Authentication Mode check box. For this example, leave it unchecked.
Then click Next.
6. In the Tags tab (see Figure 3-26), enter any tags you want to associate with the snapshot
and click Next.
7. In the Review + Create tab (see Figure 3-27), review your settings, and click Create to
create the snapshot.
8. After the snapshot is created, click Go to Resource to access its page. (See Figure 3-28.)
#Define variables
$resourceGroup = "RG01"
$location = "EastUS2"
$vm = "SourceVM"
$snapshotName = "SourceVM-Snapshot-20230228"
#get the VM
$vminfo = Get-AzVM `
-ResourceGroupName $resourceGroup `
-Name $vm
#Verify snapshot
Get-AzSnapshot `
-ResourceGroupName $resourceGroup
#Define variables
resourceGroup="RG01"
location="EastUS2"
vm="SourceVM"
snapshotName="SourceVM-Snapshot-20230228"
#get the VM
DiskInfo=$(az vm show \
--resource-group $resourceGroup \
--name $vm \
--query "storageProfile.osDisk.managedDisk.id" \
-o tsv)
#Verify snapshot
az snapshot list \
--resource-group $resourceGroup \
-o table
Managed images
Managed images enable you to create hundreds of copies of customized VMs in Azure without
having to create multiple copies of the underlying disks associated with each VM or manage
any storage accounts to host them. You can easily create managed images out of managed
disks; the resulting managed image will contain the configuration of the source VM, includ-
ing all the managed disks associated with that source VM. This helps you to scale your VM
resources using features like VMSS or Azure Virtual Desktop Session Host Pools, where capac-
ity is added as load increases.
The primary difference between managed disks and managed images is that an image is
built from a generalized VM and includes all the associated disks, whereas a snapshot is specific
IMPORTANT If you are following along, select resources and resource names based
on your environment.
IMPORTANT If you are following along, be sure to delete any unwanted resources
after you have completed testing to reduce charges levied by Microsoft.
PREREQUISITE If you are following along, you must create a VM to use to create
the managed image. Be sure to stop that VM before starting the following procedure,
however. The wizard will generalize this VM and make it unusable after the image is
captured. (Optionally, you back up the VM and restore it after the process is complete.)
2. In the Basics tab of the Create an Image wizard (see Figure 3-31), enter the following
information and click Next:
■■ Resource Group Select an existing resource group in which to create the new
managed image or create a new one.
■■ Share Image to Azure Compute Gallery For this walkthrough, select the No,
Capture Only a Managed Image option button.
3. In the Tags tab (see Figure 3-32), enter any tags you want to associate with the
managed image and click Next.
FIGURE 3-33 The Review + Create tab of the Create an Image wizard.
The source VM will be stopped automatically if you haven’t turned it off already. (See
Figure 3-34.) Azure will then generalize the VM and create the image.
The managed image’s Overview page displays the properties of the managed image as
well as Create VM, Clone to a VM Image, Delete, and Refresh options. (See Figure 3-36.)
#Define variables
$vm = "SourceVM"
$resourcegroup = RG01
$location = "EastUS2"
$imageName = "SourceVM-Image-20221203"
#Define variables
vm="SourceVM"
resourcegroup=$RG01
location="EastUS2"
imageName="SourceVM-Image-20221203"
Performance tiering
When you create a managed disk, Azure automatically assigns a default performance target
for that disk. This is based on predefined targets associated with the disk provisioned for the
managed disk. This determines the IOPS and throughput available for that managed disk. This
A
ABAC (Attribute-Based Access Control), Azure AD, 25 RBAC, 26
access resource scope, 26
Azure Files, 118–122 Azure Backup integration, 65–70
Azure Queue Storage, 220–221 Azure Blob Storage
Azure AD, 221 archived blobs, rehydrating, 50
SAS, 222–223 Azure Backup integration, 65–70
storage account access keys, 221 best practices, 75–77
data access authorization, 24–25 blobs, 2
Azure AD, 25–26 append blobs, 4
SAS, 29–33 block blobs, 4
shared key authorization, 26–28 change feeds, 60
storage access tiers, Azure Blob Storage, 49–50 lifecycle management, 54–58
accounts point-in-time restores, 61
Azure Queue Storage, 195–202 premium block blobs, 3
storage accounts, 1 premium page blobs, 3
Azure Files, 82–90 rehydrating, 50
costs, 3 snapshots, 70–73
failover, 74 soft-deleting, 59
firewalls, 112–116 versioning, 59
names, 2 components, overview, 1–2
premium block blobs, 3 containers, 1, 4
premium page blobs, 3 names, 4
standard general purpose v2 storage accounts, 3 soft-deleting, 59
types of, 3 CRC, 12
ACL (Access Control Lists), Azure Data Box, 237 data access authorization, 24–25
ADE (Azure Disk Encryption), 158 Azure AD, 25–26
append blobs, 4 SAS, 29–33
archive tier, storage access, 50 shared key authorization, 26–28
archived blobs, rehydrating, 50 data protection, 59–65
at-rest data encryption, Azure Blob Storage, 10–11 data redundancy, 5
authorization, data access, 24–25 GRS, 8
Azure AD, 25–26 GZRS, 9
SAS, 29–33 LRS, 6
shared key authorization, 26–28 RA-GRS, 10–11
availability, Azure Data Box, 236 RA-GZRS, 10–11
Azure AD (Active Directory), 25 ZRS, 6–7
ABAC, 25 disaster recovery, 73–75
Azure Queue Storage, 221 encryption, 10–11
273
Azure Blob Storage
274
Azure portal
275
Azure portal
276
disk redundancy, Azure Managed Disks
277
early deletion fees, storage access tiers
G
GRS (Geo-Redundant Storage) M
Azure Blob Storage, 8 managing
Azure Files, 123 blobs, lifecycle management, 54–58
Azure Queue Storage, 224 discs. See Azure Managed Disks
images, Azure Managed Disks, 167–172
278
public endpoints
279
queues, Azure Queue Storage
Q security
data protection, Azure Blob Storage, 59–65
queues, Azure Queue Storage, 202–208 data security, Azure Data Box, 234–235
encryption
ADE, 158
R
Azure Blob Storage, 10–11
Azure Files, 111–112, 124
RA-GRS (Read Only Geo-Redundant Storage) Azure Managed Disks, 158
Azure Blob Storage, 10–11 SSE, 158
Azure Queue Storage, 224 firewalls, Azure Queue Storage, 209–213
RA-GZRS (Read Only Geo-Zone Redundant Storage) storage account firewalls
Azure Blob Storage, 10–11 Azure Blob Storage, 36
Azure Queue Storage, 224 Azure Files, 112–116
RBAC (Role-Based Access Control), Azure AD, 26 TLS, Azure Queue Storage, 220
receiving data, Azure portal, 265–271 service-level encryption, Azure Queue Storage, 228
redundancy setting up
Azure Blob Storage, 5 storage access tiers, 51–54
GRS, 8 storage accounts
GZRS, 9 Azure CLI, 23–24
LRS, 6 Azure portal, 12–24
RA-GRS, 10–11 Azure PowerShell, 22–23
RA-GZRS, 10–11 share snapshots, Azure Files, 124–127
ZRS, 6–7 shared disks, Azure Managed Disks, 177–180
Azure Files, 122 shared key authorization, 26–27
GRS, 123 sharing data, Azure Data Share, 257–265
GZRS, 123 sharing models, Azure Data Share, 253
LRS, 122 SMB (Server Message Blocks), Azure Files, 101–102
ZRS, 122–123 SMB MultiChannel, Azure Files, 116–118
Azure Managed Disks, 176–177 snapshots
Azure Queue Storage, 223–225 Azure Managed Disks, 158–167
rehydrating archived blobs, 50 blobs, 70–73
reservations, storage, 58 sharing, Azure Data Share, 253, 255
resiliency, Azure Data Box, 236–237 soft-deleting
resource scope, Azure AD, 26 Azure Files, 124
restores, blobs, 61 blobs/containers, 59
routing, network SQL-based sources, Azure Data Share, 255
Azure Blob Storage, 33–35 SSD disks
Azure Files, 110–111 premium SSD disks, 142
standard SSD disks, 142
SSE (Server-Side Encryption), 158
SSH File Transfer protocol, Azure Blob Storage, 36
S standard general purpose v2 storage accounts, 3
standard HDD disks, 142
SAS (Shared Access Signature), 29
standard SSD disks, 142
Azure CLI, 32–33
static website hosting, Azure Blob Storage, 58
Azure portal, 29–32
storage access tiers
Azure PowerShell, 32
Azure Blob Storage, 49–50
Azure Queue Storage, 222–223
configuring, 51–54
walkthrough, 29–33
early deletion fees, 51
secure transfers, Azure Queue Storage, 220
rehydrating archived blobs, 50
280
ZRS (Zone-Redundant Storage)
281