Check the status of the ACI provider
az provider list --query "[?contains(namespace,'Microsoft.ContainerInstance')]" -o table
If the provider shows as NotRegistered, register the provider as shown in the following example:
az provider register --namespace Microsoft.ContainerInstance
First create resource group for this lab. Please note that region
needs to be the following ACI available regions:
westus,eastus,westeurope,westus2,northeurope,southeastasia,eastus2,centralus,australiaeast,southcentralus,centralindia,canadacentral
RESOURCE_GROUP="RG-apim"
REGION="southeastasia"
az group create -n $RESOURCE_GROUP -l $REGION
Then, create API in Azure Container Instance
PREFIX="yoichika"
az container create --name "${PREFIX}-api" \
--resource-group $RESOURCE_GROUP \
--image "danielscholl/demoapi" \
--dns-name-label "${PREFIX}-api" \
--ports 80
open "http://${PREFIX}-api.${REGION}.azurecontainer.io/index.html"