Learn how to use Docker, Azure Container Registry, and Azure Container Apps to deploy a Go web ap to Azure.
- An Azure account with an active subscription.
- Docker Desktop or other runtime installed.
- Go 1.18 or higher installed.
- git clone https://github.com/Azure-Samples/msdocs-go-webapp-quickstart.git
- cd msdocs-go-webapp-quickstart
- Create an Azure resource group.
az group create --name <resourceGroupName> --location eastus
- Create an Azure Container Registry.
az acr create --resource-group <resourceGroupName> --name <acrName> --sku basic --admin-enabled true
- Log into the Azure container instance.
az acr login --name <acrName>
- Build and push the docker image to ACR.
docker build -t <loginServer>/<imageName>:latest
- Push the docker image to ACR.
docker push <loginServer>/<imageName>:latest
- Verify the image was deployed to ACR.
az acr repository list --name <acrName> --output table
- Get the ARC admin password.
password=$(az acr credential show -n <acrName> --query 'passwords[0].value' --out tsv)
- Create a container app environment.
az containerapp env create \ --name <containerAppEnvName> \ --resource-group <resourceGroupName> \ --location "East US"
- Deploy the container app.
az containerapp create \ --name <containerAppName> \ --resource-group <resourceGroupName> \ --environment <goWebAppContainerAppEnv> \ --image "<loginServer>/<imageName>:latest" \ --registry-server "<loginServer>" \ --registry-username "<acrName" \ --registry-password "$password" \ --target-port 8080 \ --ingress 'external'
(Any additional resources or related projects)
- Link to supporting information
- Link to similar sample
- ...