Why?

A ContainerApp Environment is a logical grouping for a set of applications (or microservices). Once you have an environment env1, you can create multiple apps on it like app1, app2, etc. When you create an app you can choose if the app is exposed externally to the environment, or just internally to other apps on the environment.

External apps are accessible from the internet, unless you create them in a VNET connected environment in which case they will be available to whatever the VNET is configured for.

How?

First pick few values for our deployment

# azure stuff
export RESOURCE_GROUP="my-container-apps"
export LOCATION="eastus"

# container apps env stuff
export CONTAINERAPPS_ENVIRONMENT="my-environment"

Then:

  1. Create the resourceGroup
az group create --name $RESOURCE_GROUP --location $LOCATION
  1. Create the environment
az containerapp env create \
  --name $CONTAINERAPPS_ENVIRONMENT \
  --resource-group $RESOURCE_GROUP \
  --location "$LOCATION"