az configure --defaults group=rg-name
az configure --defaults location=westeurope
List & remove resources in a resource group
$resources = az resource list --resource-group $myRG | ConvertFrom-Json
$resources | Select name, type, id
az resource delete --resource-group $myRG --ids $resources[<resourceIndex>].id --verbose
Implement containerized solutions
Manage container images in Azure Container Registry
az acr create --resource-group $myRG --name "acrname" --sku "Basic"
az acr build --image "sample/hello-world:v1" --registry "acrname" --file "Dockerfile" .
az acr repository list --name "acrname" --output "table"
az acr repository show-tags --name "acrname" --repository "sample/hello-world" --output "table"
az acr run --registry "acrname" --cmd "$Registry/sample/hello-world:v1" "/dev/null"
az acr delete --resource-group $myRG --name "acrname"
Run container images in Azure Container Instances
$DNS_NAME_LABEL="aci-example-$(Get-Random)"
az container create --resource-group $myRG --name "mycontainer" --image "mcr.microsoft.com/azuredocs/aci-helloworld" --ports 80 --dns-name-label $DNS_NAME_LABEL --location $myLocation
az container show --resource-group $myRG --name "mycontainer" --query "{FQDN:ipAddress.fqdn,ProvisioningState:provisioningState}" --out "table"
az container delete --resource-group $myRG --name "mycontainer"
Implement Azure Container Apps
$myAppContEnv="az204-env-$(Get-Random)"
az containerapp env create `
--name $myAppContEnv `
--resource-group $myRG `
--location $myLocation
az containerapp create `
--name my-container-app `
--resource-group $myRG `
--environment $myAppContEnv `
--image mcr.microsoft.com/azuredocs/containerapps-helloworld:latest `
--target-port 80 `
--ingress 'external' `
--query properties.configuration.ingress.fqdn