Azure Cookbook

Book description

How do you deal with the problems you face when using Azure? This practical guide provides over 75 recipes to help you to work with common Azure issues in everyday scenarios. That includes key tasks like setting up permissions for a storage account, working with Cosmos DB APIs, managing Azure role-based access control, governing your Azure subscriptions using Azure Policy, and much more.

Author Reza Salehi has assembled real-world recipes that enable you to grasp key Azure services and concepts quickly. Each recipe includes CLI scripts that you can execute in your own Azure account. Recipes also explain the approach and provide meaningful context. The solutions in this cookbook will take you beyond theory and help you understand Azure services in practice.

You'll find recipes that let you:

  • Store data in an Azure storage account or in a data lake
  • Work with relational and nonrelational databases in Azure
  • Manage role-based access control (RBAC) for Azure resources
  • Safeguard secrets in Azure Key Vault
  • Govern your Azure subscription using Azure Policy
  • Use CLI code to construct your application or fix a particular problem

Publisher resources

View/Submit Errata

Table of contents

  1. Preface
    1. Who Should Read This Book
    2. Why I Wrote This Book
    3. Navigating This Book
    4. What You Will Need
    5. Getting Started
      1. Azure Account Setup
      2. General Workstation Setup Instructions
    6. Conventions Used in This Book
    7. Using Code Examples
    8. O’Reilly Online Learning
    9. How to Contact Us
    10. Acknowledgments
  2. 1. Security
    1. Workstation Configuration
    2. Creating a New User in Your Azure Account
      1. Problem
      2. Solution
      3. Discussion
    3. Creating a New Custom Role for Our User
      1. Problem
      2. Solution
      3. Discussion
    4. Assigning Allowed Azure Resource Types in a Subscription
      1. Problem
      2. Solution
      3. Discussion
    5. Assigning Allowed Locations for Azure Resources
      1. Problem
      2. Solution
      3. Discussion
    6. Connecting to a Private Azure Virtual Machine Using Azure Bastion
      1. Problem
      2. Solution
      3. Discussion
    7. Protecting Azure VM Disks Using Azure Disk Encryption
      1. Problem
      2. Solution
      3. Discussion
    8. Blocking Anonymous Access to Azure Storage Blobs
      1. Problem
      2. Solution
      3. Discussion
    9. Configuring an Azure Storage Account to Exclusively Use Azure AD Authorization
      1. Problem
      2. Solution
      3. Discussion
    10. Storing and Retrieving Secrets from Azure Key Vault
      1. Problem
      2. Solution
      3. Discussion
    11. Enabling Web Application Firewall (WAF) with Azure Application Gateway
      1. Problem
      2. Solution
      3. Discussion
  3. 2. Networking
    1. Workstation Configuration
    2. Creating an Isolated Private Network by Provisioning an Azure Virtual Network
      1. Problem
      2. Solution
      3. Discussion
    3. Creating a Network Layout in Azure Virtual Networks Using Subnets
      1. Problem
      2. Solution
      3. Discussion
    4. Routing Network Traffic Using User-Defined Routes
      1. Problem
      2. Solution
      3. Discussion
    5. Securing Azure Virtual Networks with Azure Firewall
      1. Problem
      2. Solution
      3. Discussion
    6. Securing Azure Virtual Networks with Network Security Groups
      1. Problem
      2. Solution
      3. Discussion
    7. Connecting Two Azure VNets Using Azure Network Peering
      1. Problem
      2. Solution
      3. Discussion
    8. Verifying Azure VNet Connectivity Using Azure Network Watcher
      1. Problem
      2. Solution
      3. Discussion
  4. 3. Storage
    1. Workstation Configuration
    2. Using Azure Key Vault Keys to Configure Azure Storage Encryption at Rest
      1. Problem
      2. Solution
      3. Discussion
    3. Controlling Azure Storage Network Access
      1. Problem
      2. Solution
      3. Discussion
    4. Granting Limited Access to Azure Storage Using SAS Tokens
      1. Problem
      2. Solution
      3. Discussion
    5. Granting Azure Function Apps Access to Azure Storage Using Managed Identity and RBAC
      1. Problem
      2. Solution
      3. Discussion
    6. Creating and Storing Snapshots of Blob Objects
      1. Problem
      2. Solution
      3. Discussion
    7. Creating and Accessing New File Versions
      1. Problem
      2. Solution
      3. Discussion
    8. Using a Lifecycle Management Policy to Save Storage Account Costs
      1. Problem
      2. Solution
      3. Discussion
    9. Using AzCopy to Upload Multiple Files to Azure Storage Blobs
      1. Problem
      2. Solution
      3. Discussion
    10. Using AzCopy to Upload Multiple Files to Azure Storage File Shares
      1. Problem
      2. Solution
      3. Discussion
    11. Protecting Azure Storage Blobs from Accidental Deletion
      1. Problem
      2. Solution
      3. Discussion
    12. Protecting an Azure Storage Account from Deletion Using Azure Locks
      1. Problem
      2. Solution
      3. Discussion
  5. 4. Persisting Data
    1. Workstation Configuration
    2. Creating a Cosmos DB NoSQL API Account
      1. Problem
      2. Solution
      3. Discussion
    3. Creating a Cosmos DB Apache Gremlin (Graph) API Account
      1. Problem
      2. Solution
      3. Discussion
    4. Configuring Azure Cosmos DB Firewall
      1. Problem
      2. Solution
      3. Discussion
    5. Configuring Azure Cosmos DB Private Access
      1. Problem
      2. Solution
      3. Discussion
    6. Granting Function Apps Access to Cosmos DB Using RBAC
      1. Problem
      2. Solution
      3. Discussion
    7. Storing Tabular Data in Azure Storage Tables
      1. Problem
      2. Solution
      3. Discussion
    8. Configuring Autoscale for an Azure Cosmos DB NoSQL API Container
      1. Problem
      2. Solution
      3. Discussion
    9. Saving Costs on Multiple Azure SQL Single Databases with Varying and Unpredictable Usage Demands
      1. Problem
      2. Solution
      3. Discussion
    10. Configuring Serverless Compute Tier for Azure SQL Single Databases
      1. Problem
      2. Solution
      3. Discussion
    11. Configuring Azure SQL Firewall IP Rules
      1. Problem
      2. Solution
      3. Discussion
    12. Configuring Azure SQL Firewall VNet Rules
      1. Problem
      2. Solution
      3. Discussion
    13. Backing Up Azure SQL Single Databases into Azure Storage Blobs
      1. Problem
      2. Solution
      3. Discussion
  6. 5. Messaging and Events
    1. Workstation Configuration
    2. Ingesting Streaming Data at Scale Using Event Hubs
      1. Problem
      2. Solution
      3. Discussion
    3. Ingesting Telemetry Data from IoT Devices Using Azure IoT Hub
      1. Problem
      2. Solution
      3. Discussion
    4. Implementing Communication Between Services Using Azure Storage Queues
      1. Problem
      2. Solution
      3. Discussion
    5. Implementing Communication Between Services Using Azure Service Bus Queues
      1. Problem
      2. Solution
      3. Discussion
    6. Implementing a Publish-Subscribe Pattern Using Azure Service Bus Topics
      1. Problem
      2. Solution
      3. Discussion
    7. Queuing Newly Uploaded Blobs for Further Processing Using Azure Event Grid
      1. Problem
      2. Solution
      3. Discussion
  7. 6. Big Data
    1. Workstation Configuration
    2. Processing Live Data Streams Using Azure Stream Analytics
      1. Problem
      2. Solution
      3. Discussion
    3. Querying CSV File Content Using Azure Synapse Analytics Serverless Pool
      1. Problem
      2. Solution
      3. Discussion
    4. Saving Costs on Idle Azure Synapse Dedicated SQL and Spark Pools
      1. Problem
      2. Solution
      3. Discussion
    5. Processing Datafiles Using Azure Databricks
      1. Problem
      2. Solution
      3. Discussion
    6. Performing ETL/ELT Operations on Big Data Using Azure Data Factory (ADF)
      1. Problem
      2. Solution
      3. Discussion
  8. 7. Azure Functions and Serverless Services
    1. Workstation Configuration
    2. Implementing a Web API Using Azure Functions
      1. Problem
      2. Solution
      3. Discussion
    3. Invoking an Azure Function on a Schedule Using the Timer Trigger
      1. Problem
      2. Solution
      3. Discussion
    4. Invoking an Azure Function on Blob Upload Using the Blob Trigger
      1. Problem
      2. Solution
      3. Discussion
    5. Inserting Function App Output into Azure Cosmos DB
      1. Problem
      2. Solution
      3. Discussion
    6. Establishing Communication Between Azure Functions Using the Service Bus Queue Trigger
      1. Problem
      2. Solution
      3. Discussion
    7. Restricting Network Access to Azure Function Apps
      1. Problem
      2. Solution
      3. Discussion
  9. 8. Azure App Service
    1. Workstation Configuration
    2. Deploying a Web Application to Azure App Services Using ZipDeploy
      1. Problem
      2. Solution
      3. Discussion
    3. Deploying a Web Application to Azure App Service Using FTP
      1. Problem
      2. Solution
      3. Discussion
    4. Deploying a Web Application from a Public GitHub Repository to Azure App Service
      1. Problem
      2. Solution
      3. Discussion
    5. Configuring Autoscaling for Your Azure App Service Plan
      1. Problem
      2. Solution
      3. Discussion
    6. Restricting Network Access to an Azure App Service
      1. Problem
      2. Solution
      3. Discussion
    7. Hosting Static Websites in Azure Storage
      1. Problem
      2. Solution
      3. Discussion
  10. 9. Containers
    1. Workstation Configuration
    2. Chapter Prerequisites
    3. Building and Pushing a Container Image to Azure Container Registry
      1. Problem
      2. Solution
      3. Discussion
    4. Pulling and Running a Docker Image in Azure Container Instances
      1. Problem
      2. Solution
      3. Discussion
    5. Pulling and Running a Containerized Website in Azure App Services
      1. Problem
      2. Solution
      3. Discussion
    6. Pulling and Running a Containerized Website in Azure Container Apps
      1. Problem
      2. Solution
      3. Discussion
    7. Limiting Azure Container Registry Public Network Access
      1. Problem
      2. Solution
      3. Discussion
  11. 10. Azure Cognitive Services
    1. Workstation Configuration
    2. Postman Collection
    3. Provisioning a Multi-Service Azure Cognitive Services Resource
      1. Problem
      2. Solution
      3. Discussion
    4. Converting Text to Speech
      1. Problem
      2. Solution
      3. Discussion
    5. Translating Text
      1. Problem
      2. Solution
      3. Discussion
    6. Performing Sentiment Analysis on Text
      1. Problem
      2. Solution
      3. Discussion
    7. Detecting Objects in Images
      1. Problem
      2. Solution
      3. Discussion
    8. Creating Captions for Images
      1. Problem
      2. Solution
      3. Discussion
    9. Extracting Text from Images Using OCR
      1. Problem
      2. Solution
      3. Discussion
    10. Detecting PII in Text
      1. Problem
      2. Solution
      3. Discussion
  12. 11. Management and Monitoring
    1. Workstation Configuration
    2. Managing Azure Resource Tags
      1. Problem
      2. Solution
      3. Discussion
    3. Estimating Costs for Azure Resources
      1. Problem
      2. Solution
      3. Discussion
    4. Monitoring Costs of Provisioned Azure Resources
      1. Problem
      2. Solution
      3. Discussion
    5. Collecting Platform Logs for an Azure Resource
      1. Problem
      2. Solution
      3. Discussion
    6. Analyzing Azure Monitor Platform Logs
      1. Problem
      2. Solution
      3. Discussion
  13. Index
  14. About the Author

Product information

  • Title: Azure Cookbook
  • Author(s): Reza Salehi
  • Release date: June 2023
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781098135799