This repo walks you through the steps to deploy a simple hello world flask app (NoDB) to Azure Container Services (ACS) using the Azure Developer CLI.
The instructions to build this project are heavily inspired by Quickstart: Deploy your code to Azure Container Apps
If you want to deploy this project to Azure, follow these steps:
text in code blocks
are commands that you should enter into your terminal.
<Replace text in Brackets>
with your own values. Follow the casing and spacing of the example:
<ALLCAPS>
<lowercase>
<kebab-case>
follow the guidance in the comments foo # follow these notes
docker build -t <yourname:yourtag> .
docker run -p <EXTERNALPORT:INTERNALPORT YOURNAME:YOURTAG>
NOTE: # Ports are your port number 5000:5000 by default.
This ensures that your app itself is working and issues will not be caused by syntax or other issues.
Setting the variables below will make entering commands a little faster and more consistent.
RESOURCE_GROUP="<my-resource-group>"
LOCATION="<westus>"
# Change to your preferred locationENVIRONMENT="<my-environment>"
API_NAME="<my-api-name>"
UNQIUE="<my-unique-characters>"
# try to be unique to avoid conflictsACR_NAME="acaprojectname"+$UNIQUE
# must be all lowercaseREGISTRY_SERVER=$ACR_NAME".azurecr.io"
IMAGE_URI=$ACR/$API_NAME
az group create \
--name $RESOURCE_GROUP \
--location $LOCATION
az acr create \
--resource-group $RESOURCE_GROUP \
--name $ACR_NAME \
--sku Basic \
--admin-enabled true
docker build -t $REGISTRY_SERVER . --platform linux/amd64
az acr login --name $REGISTRY_SERVER
docker push $IMAGE_URL
az containerapp env create --resource-group $RESOURCE_GROUP --name $ENVIRONMENT --location $LOCATION
az containerapp create \
--resource-group $RESOURCE_GROUP \
--name $API_NAME \
--environment $ENVIRONMENT \
--image $IMAGE_URI \
--target-port <INTERNALPORT> \
--ingress 'external' \
--registry-server $REGISTRY_SERVER \