As an IT professional, I have always been fascinated by the world of cloud computing and the endless possibilities it presents. Azure, in particular, stood out to me as a platform that offered a comprehensive range of services and tools for businesses of all sizes. With its ability to simplify the development, deployment, management, and scaling of applications, it has a significant potential to revolutionize the way organizations operate.

Global end-user spending on public cloud services is expected to reach $591.8 billion in 2023, up from $490.3 billion in 2022, a 20.7% growth. This creates a huge demand for cloud professionals to fill in the job market talent gap. I had the opportunity to work on a wide range of Azure solutions for businesses of all sizes in the past few years, giving me a perspective on challenges that companies can face in a cloud journey. As a Microsoft Certified Trainer (MCT), I had the privilege of sharing this perspective with thousands of IT professionals. This book aims to enable you to quickly acquire hands-on expertise with the key Azure services and concepts. I hope you use this book as a reference to solve common, yet fundamental, challenges in your Azure cloud projects.

Who Should Read This Book

This book is for cloud architects, developers, and engineers at all experience levels. Beginners will use the recipes in this book to familiarize themselves with the fundamental Azure services and gain hands-on experience with them. Expert cloud professionals will use this book to enhance their Azure projects, solve common architecture problems, and gain further perspectives. The recipes in this book showcase how multiple Azure services can be combined to deliver immediate value for you, regardless of your Azure expertise level. This book is for you, if you like to learn about a diverse set of Azure services for security, networking, big data, storage, databases, AI, containers, serverless, and web apps.

Why I Wrote This Book

Writing this book was my way of contributing to the cloud revolution by sharing my experience with other professionals and enthusiasts. I wanted to create a resource that would not only provide an overview of a wide variety of Azure platform services but also guide readers through practical, hands-on scenarios and use cases. My aim was to equip professionals with the necessary skills to leverage Azure’s capabilities and help organizations drive their digital transformation. By writing this book, I hope to inspire others to fully embrace the power of Azure and the future of cloud computing.

Navigating This Book

The hands-on recipes in this book are organized into the following chapters:

What You Will Need

Here are the resources and tools you need to get the most out of this book:

Getting Started

The recipes in this book use Azure CLI to provision and manage Azure resources. This section provides details to help you run Azure CLI commands on your workstation. Feel free to skip this section if you are already comfortable with Azure CLI.


Although many Microsoft Azure services offer free tiers, Azure is a paid cloud service and you will be charged for any services that you create in the paid pricing tiers. To avoid getting charged, clean up (delete) any provisioned resource after completing a recipe. See the recipe cleanup section in the book repository for details.

Azure Account Setup

You need a user with the subscription administrator (Owner) permissions. This user account enables you to create resources and identities as well as configure the permissions that are needed to complete the recipes in this book. Your Azure subscription comes with a default administrator account, which can be used. You can also create a Co-Administrator user if preferred.

General Workstation Setup Instructions

  1. The CLI scripts used in this book can be found in the book repository. Create a folder called AzureCookbook in any directory you prefer and set it as the current folder:

    mkdir ~/AzureCookbook
    cd ~/AzureCookbook
  2. Now, let’s clone the book repository into your current folder:

    git clone
  3. Microsoft Azure provides several regions (locations). We use “eastus” in this book, but you can choose any region you like. Run the following command to get a list of all Azure regions:

    az account list-locations --output table
  4. Store your desired region name in the following variable:

  5. Set a default location for Azure CLI commands. This location will be used if no location is passed to the CLI command:

    az config set defaults.location=eastus
  6. Log in to Azure CLI using your Azure subscription administrator username and password. Replace <username> and <password> with your admin account credentials:

    az login -u "<username>" -p "<password>"

Running az login without passing account credentials will open a browser window where you can enter your username/password.

  1. You should create your Azure resources in a parent container called a resource group. Before starting each recipe, you have to create a new resource group. Replace <resource-group-name> with the desired name. Store the resource group name in the rgName variable as shown in the following command. You will use rgName in every recipe:

    az group create \
      --location $region \
      --name $rgName

    You can alternatively run your commands in the Azure Cloud Shell, as shown in Figure P-1.

azcb 0001
Figure P-1. Azure Cloud Shell

Conventions Used in This Book

The following typographical conventions are used in this book:


Indicates new terms, URLs, email addresses, filenames, and file extensions.

Constant width

Used for program listings, as well as within paragraphs to refer to program elements such as variable or function names, databases, data types, environment variables, statements, and keywords.

Constant width italic

Shows text that should be replaced with user-supplied values or by values determined by context.


This element signifies a tip or suggestion.


This element signifies a general note.


This element indicates a warning or caution.

Using Code Examples

Supplemental material (code examples, exercises, etc.) is available for download at

If you have a technical question or a problem using the code examples, please send email to .

This book is here to help you get your job done. In general, if example code is offered with this book, you may use it in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.

We appreciate, but generally do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Azure Cookbook by Reza Salehi (O’Reilly). Copyright 2023 Reza Salehi, 978-1-098-13579-9.”

If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at .

O’Reilly Online Learning


For more than 40 years, O’Reilly Media has provided technology and business training, knowledge, and insight to help companies succeed.

Our unique network of experts and innovators share their knowledge and expertise through books, articles, and our online learning platform. O’Reilly’s online learning platform gives you on-demand access to live training courses, in-depth learning paths, interactive coding environments, and a vast collection of text and video from O’Reilly and 200+ other publishers. For more information, visit

How to Contact Us

Please address comments and questions concerning this book to the publisher:

We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at

For news and information about our books and courses, visit

Find us on LinkedIn:

Follow us on Twitter:

Watch us on YouTube:


Thank you to Jennifer Pollock for giving me the opportunity to showcase my technical writing skills and bring my book to life. I am grateful for your support.

I appreciate the O’Reilly Media team. Thank you to the development editor, Jeff Bleiel. Your guidance, suggestions, and insights enabled me to refine my work and bring this book to life. Thank you also to the production editor, Elizabeth Kelly, for getting this book in the best shape for release.

Thank you to the book reviewers for taking the time to share your thoughts and opinions on my work: Dipal Choski, George Mount, Hakan Silfvernagel, and Peter De Tender. Your feedback is greatly appreciated.

Get Azure Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.