1. Prerequisites
Set up your machine and Azure account before you start.
What you need
| Requirement | Notes |
|---|---|
| Azure subscription | A free account works. You need permission to create resources and role assignments (Owner, or Contributor plus User Access Administrator). |
| Azure CLI | Version 2.60 or later is recommended. Check with az version. |
| Docker | Docker Desktop (or another OCI-compatible engine). Optional if you use az acr build to build in the cloud. |
| .NET SDK | .NET 10 SDK (installed with Visual Studio 2026). |
| Visual Studio 2026 (optional) | Includes container tools and the Azure publish wizard. |
Sign in and choose a subscription
az login
az account list --output table
az account set --subscription "YOUR_SUBSCRIPTION_NAME_OR_ID"
Register resource providers
New subscriptions may need these providers registered once:
az provider register --namespace Microsoft.ContainerRegistry
az provider register --namespace Microsoft.Web
az provider register --namespace Microsoft.App
az provider register --namespace Microsoft.OperationalInsights
Set variables used throughout this guide
Resource names such as the registry and web app must be globally unique. Replace the placeholder values.
RG=rg-containerdemo
LOCATION=australiaeast
ACR_NAME=acrcontainerdemo12345 # 5-50 lowercase letters/numbers, globally unique
APP_NAME=app-containerdemo-12345 # globally unique for App Service
IMAGE=azure-container-guide
TAG=v1
az group create --name $RG --location $LOCATION
These examples use a bash shell (Git Bash, WSL, Azure Cloud Shell). In PowerShell, set variables with
$RG = "rg-containerdemo" and replace \ line continuations with a backtick.