In this article, Azure Cloud Shell (Azure CLI) is used to deploy containerized application to Azure Container Apps. Azure Container Apps service allows to run microservices and containerized applications on the serverless platform. Container Apps main benefit is to run the containers with ought concerns to manually configuring the cloud infrastructure and complex container coordinators. After this exercise one will be able to create container app environment, deploy a container, and verify running application in Azure.
Following tasks are performed:
Create resource
Create container apps environment
Deploy container app
Verify running container app
Clean up resources
Create Resource Group and Prepare Azure Environment
First step is to create resources in Azure and prepare the Azure environment using Azure CLI .Azure CLI is a free Bash shell which can be run directly within the Azure portal. It is preinstalled and configured within an account.
Create Resource Group
Click Cloud Shell button on the menu bar at the top right side of the Azure portal.

It will launch an interactive shell which can be used to run the steps outlined in this article. Select a Bash environment. To use code editor go to Settings menu in cloud shell toolbar and than select Go to Classic version.
Create Resource Group - Resource group is a logical container used to hold related resources. It includes all resources which are required to manage as a group. az group create command creates a resource group. If a resource group is already created and exists then this step can be omitted and it can be use in next steps.
Syntax
az group create \
--name <resource-group> \
--location <location>Example
az group create \
--name myResourceGroup1 \
--location eastus2 eastus2 is location code instead of it one can use their nearest region location.
az account list-locations command gives complete list of available locations.
az account list-locations
az account list-locations --query "[*].name"
az account list-locations --query "[*].name" --out tsv | sortPrepare Azure Environment
Let’s upgrade latest version of Azure Container Apps extension for the installed CLI and then register required two namespaces one by one as following.
Upgrade Azure Container Apps extension - az extension add command is used to upgrade latest version of Azure Container Apps extension for the installed CLI.
az extension add \
--name containerapp
--upgradeRegister namespaces - Microsoft.App and Microsoft.OperationalInsights are two namespaces which needs to be registered for the Azure Container Apps. az provider register command is used to register namespaces as like below.
az provider register --namespace Microsoft.App
az provider register --namespace Microsoft.OperationalInsightsBoth registration commands will take few minutes to complete the registration process.
Create Container Apps Environment
In Azure Container Apps an environment is used to create secure boundary around group of container apps. az containerapp env create command is used to create an environment.
az containerapp env create \
--name myContainerEnv1 \
--resource-group myResourceGroup1 \
--location eastus2 

Join the conversation! Your thoughts help the community grow.