Since we launched the early public preview of Azure Container Apps on Arc enabled Kubernetes clusters last December, we have been working to continue to bring new features and capabilities to the preview (Container Apps on Azure Arc Overview | Microsoft Learn). One area we have been keen to improve is the onboarding process and steps required to deploy your first Azure Container App on an Arc enabled Kubernetes cluster.
The number of steps and number of CLI extensions required to get to the point of having an app up and running is quite extensive:
Quite a few steps and many resources to create! How would you respond if I was able to show you a way in which you could do all of this in two steps or one if you have already connected the Kubernetes cluster to Azure Arc?
To use this new functionality, you must
az extension remove --name containerap
az extension add --source https://aka.ms/acaarccli/containerapp-latest-py2.py3-none-any.whl --yes
You can deploy a container app that uses an existing image in a public or private container registry. The example below deploys an existing image from a private container registry and you can see the required registry-server, registry-username and registry-password values in the example command.
In this example the command performs the following actions:
`
az containerapp up --name <CONTAINER_APP_NAME> --image <REGISTRY_SERVER>/<IMAGE_NAME>:<TAG> --registry-username <REGISTRY_USER> --registry-password <REGISTRY_PASSWORD> --registry-server <REGISTRY_SERVER> --ingress external --target-port <PORT_NUMBER> --connected-cluster-id <CONNECTED_CLUSTER_ID>
This command can build the image with or without a Dockerfile. If building without a Dockerfile the following languages are supported:
In this example the command performs the following actions:
az containerapp up --name <CONTAINER_APP_NAME> --source <SOURCE_DIRECTORY> --connected-cluster-id <CONNECTED_CLUSTER_ID>
This command deploys from a GitHub repository. A Dockerfile is required to build the image.
In this example the command performs the following actions:
az containerapp up --name <CONTAINER_APP_NAME> --source <SOURCE_DIRECTORY> --connected-cluster-id <CONNECTED_CLUSTER_ID> --repo <GitHub Repository Url> --ingress <external or internal> --target-port <PORT_NUMBER> --context-path <optional to be set if Dockerfile is not in root of repository>
Because the up command creates a GitHub Actions workflow, rerunning this command to deploy changes to your application’s image will create multiple workflows. To avoid this happening simply push your changes to your GitHub repository, and the GitHub Action workflow will automatically build and deploy your app.
In this post we have shared three examples of how, after connecting your cluster to Azure Arc, you can drastically cut down the number of steps required to setup and deploy your first Azure Container App to your Azure Arc enabled Kubernetes cluster. We hope this helps with onboarding to Azure Container Apps on Arc enabled Kubernetes, and this accelerates your time to deployment. We look forward to listening to and addressing any feedback you have with this functionality and the preview so far!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.