AZ-204: Developing Solutions for Microsoft Azure

All the notes on this page have been taken from Microsoft's learning portal - learn.microsoft.com. If any of this material is copyrighted, please let me know in the comments below and I will remove it. The main goal here is to learn and understand the concepts for developing solutions for Microsoft Azure. These notes may be helpful to prepare for the certification AZ-204: Developing Solutions for Microsoft Azure

Overview

Below is the collection of pages we have covering the various topics

1. Develop Azure Compute Solutions
IaaS - Part 1.1
Azure app service - Part 1.2
Azure Functions - Part 1.3

2. Develop for Azure Storage
Azure Cosmos DB - Part 2.1
Azure Blob storage - Part 2.2

3. Implement Azure Security
User Authentication and Authorization - Part 3.1
Implement secure cloud solutions - Part 3.2

4. Monitoring and Optimization in Azure solutions
Caching and content delivery - Part 4.1
Monitoring and logging - Part 4.2

5. Connect to and consume Azure services and third-party services
Implement API management - Part 5.1
Event-based solutions - Part 5.2
Message-based solutions - Part 5.3

Quicknotes

Azure Compute > IaaS > Azure VM

Azure VMs allow you to create Linux and Windows virtual machines

VM Sizes

General Purpose: Balanced CPU to memory ratio
Compute Optimized: High CPU to memory ratio
Memory Optimized: High memory to CPU ratio
Storage Optimized: High Disk throughput
GPU: Graphic rendering, model training
High Performance Compute: Fastest CPU with high-throughput network interfaces (RDMA)

VM Provisioning

Fault Domains: Think metal rack here
Availability Sets: Logical grouping of fault domains
Update Domains: Ability to update VMs at same time
Availability zones: Different data centers in the same region, with separate power, cooling and networking
Region pairs: Backup region if primary region goes down

Create a VM

Using Cloud Shell Bash

az vm create \
  --resource-group vm-rg \
  --name demovm \
  --image UbuntuLTS \
  --generate-ssh-keys \
  --admin-username azureadmin \
  --public-ip-sku Standard

Using Powershell

New-AzVm `
    -ResourceGroupName 'myResourceGroup' `
    -Name 'myVM' `
    -Image UbuntuLTS ` 
    -GenerateSshKey -SshKeyName MySshKey ` 
    -PublicIpSku Standard `

Azure compute unit (ACU)

The concept of the Azure Compute Unit (ACU) provides a way of comparing compute (CPU) performance across Azure SKUs. ACU is currently standardized on a Small (Standard_A1) VM being 100 and all other SKUs then represent approximately how much faster that SKU can run a standard benchmark

ARM Templates

ARM templates are JSON files that allow you to create and deploy Azure infrastructure declaratively.

{
"$schema": "http://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"functions": [],
"resources": [],
"outputs": {}
}

Azure Compute > IaaS > Azure Containers

Azure Container Registry (ACR)

Azure Container Registry is a managed, private Docker Registry service. It allows you to build, store, and manage container images and artifacts in a private registry for all types of container deployments.

Azure Container Registry (ACR) Tasks

Use Azure Container Registry Tasks (ACR Tasks) to streamline building, testing, pushing, and deploying images in Azure. It can automate OS and framework patching for your Docker containers. It enables automated builds triggered by source code updates, updates to a container's base image, or timers.

Dockerfile

A Dockerfile is a text file that contains the instructions we use to build and run a Docker image.

Build and run a container using ACR task

az acr create --resource-group demo-rg --name myContainerRegistry --sku Basic
az acr build --image sample/hello-world:v1 \ 
   --registry myContainerRegistry \ 
   --file Dockerfile .
az acr run --registry myContainerRegistry \
    --cmd '$Registry/sample/hello-world:v1' /dev/null