Preface
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:
-
Chapter 1, “Security”, provides methods to improve the security of Azure resources through RBAC, role-based access control, and network firewalls.
-
Chapter 2, “Networking”, reviews Azure Virtual Network (VNet) security, routing, and monitoring.
-
Chapter 3, “Storage”, provides recipes for Azure storage accounts, enabling you to optimize cost, secure your data, and protect it against accidental deletion.
-
Chapter 4, “Persisting Data”, provides guidelines to configure and protect the main Azure relational and NoSQL databases, Azure SQL and Azure Cosmos DB.
-
Chapter 5, “Messaging and Events”, enables you to set up reliable messaging between your services and solutions using Azure’s messaging suite of services.
-
Chapter 6, “Big Data”, introduces Azure services, including Azure Stream Analytics, Azure Synapse Analytics, Azure Databricks, and Azure Data Factory, designed to mine insights from your big data.
-
Chapter 7, “Azure Functions and Serverless Services”, provides recipes to implement microservices using Azure Function Apps.
-
Chapter 8, “Azure App Service”, provides recipes to configure autoscaling, secure network access, and deploy App Services using several methods.
-
Chapter 9, “Containers”, introduces Azure services designed to host and run containerized applications in Azure.
-
Chapter 10, “Azure Cognitive Services”, helps you develop smart applications by using Azure Cognitive Services. Recipes in this chapter enable you to gain insights from images, audio, and text content using AI-backed services.
-
Chapter 11, “Management and Monitoring”, introduces tools to monitor and control Azure service costs and then reviews Azure Monitor platform logs.
What You Will Need
Here are the resources and tools you need to get the most out of this book:
-
Azure account (subscription):
-
See the Azure documentation for setup instructions. You’ll need a user with Owner (administrative) access over your subscription.
-
-
Personal computer with Windows, macOS, or Linux OS
-
Software:
-
A supported web browser (e.g., Microsoft Edge or Google Chrome).
-
Terminal with Bash or Z shell (Zsh).
-
Git (see the installation instructions).
-
A code editor (e.g., VS Code, VSCodium). You can access the bash terminal from VS Code.
-
Azure CLI version 2.42 or later (see the installation instructions).
-
-
The book repository:
-
Clone it to a local folder on your machine.
-
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.
Warning
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
-
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
-
Now, let’s clone the book repository into your current folder:
git clone https://github.com/zaalion/AzureCookbook.git
-
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
-
Store your desired region name in the following variable:
region="eastus"
-
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
-
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>"
Tip
Running az login
without passing account credentials will open a browser window where you can enter your username/password.
-
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 thergName
variable as shown in the following command. You will usergName
in every recipe:rgName="<resource-group-name>" az group create \ --location $region \ --name $rgName
You can alternatively run your commands in the Azure Cloud Shell, as shown in Figure P-1.
Conventions Used in This Book
The following typographical conventions are used in this book:
- Italic
-
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.
Tip
This element signifies a tip or suggestion.
Note
This element signifies a general note.
Warning
This element indicates a warning or caution.
Using Code Examples
Supplemental material (code examples, exercises, etc.) is available for download at https://github.com/zaalion/AzureCookbook.
If you have a technical question or a problem using the code examples, please send email to support@oreilly.com.
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 permissions@oreilly.com.
O’Reilly Online Learning
Note
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 https://oreilly.com.
How to Contact Us
Please address comments and questions concerning this book to the publisher:
- O’Reilly Media, Inc.
- 1005 Gravenstein Highway North
- Sebastopol, CA 95472
- 800-889-8969 (in the United States or Canada)
- 707-829-7019 (international or local)
- 707-829-0104 (fax)
- support@oreilly.com
- https://www.oreilly.com/about/contact.html
We have a web page for this book, where we list errata, examples, and any additional information. You can access this page at https://oreil.ly/azure-cookbook.
For news and information about our books and courses, visit https://oreilly.com.
Find us on LinkedIn: https://linkedin.com/company/oreilly-media
Follow us on Twitter: https://twitter.com/oreillymedia
Watch us on YouTube: https://youtube.com/oreillymedia
Acknowledgments
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.