As developers, we love the benefits of containers, but they're not always easy to deploy. It can be a cumbersome process to build a container image, push it to a registry, and then set up infrastructure and deploy the container.
Azure Container Apps is a modern, fully-managed, serverless platform for running containers. While we don't have to manage infrastructure, it's still up to us to figure out how to build our container image and deploy it.
Today, we're introducing a preview feature in the Azure CLI that streamlines the process of deploying to Azure Container Apps in a single command. Whether your source code is on your local machine or in GitHub, "az containerapp up" is the only command you need to get your app running in Azure Container Apps.
"az containerapp up" is the newest in the rich set of Azure CLI commands for managing and deploying Azure Container Apps. It will:
If you want to, you can deploy to existing resources like Container Apps environments or use existing container registries. And you can update your app by running the same "az containerapp up" command again.
"az containerapp up" is available in version 0.3.2 or above of the Container Apps Azure CLI extension. To make sure you have the latest version, run:
az extension add --name containerapp --upgrade
"az containerapp up" can deploy from a local source. It needs a Dockerfile in your source directory.
Run the "az containerapp up" command, providing a name for the container app and the location of your source code.
az containerapp up --name my-app --source ./my-app
That's it! The command does everything needed to build and deploy the app:
When you make updates to the app, simply run the same "az containerapp up --name my-app --source ." command again to build and deploy it.
If you have an app in GitHub that you want to deploy, run the following command to set up all the resources and a GitHub Actions workflow to build and deploy the app:
az containerapp up --name my-app --repo https://github.com/my-name/my-app
You'll be prompted to log in to GitHub and, like with local source, the command does the rest.
To make updates to the app, push your changes to GitHub and the workflow will automatically build and deploy the app.
By default, "az containerapp up" will use intelligent defaults to create your resources. You can override the defaults and even deploy to existing resources by providing the appropriate parameters.
To learn more, run "az containerapp up --help".
The "az containerapp up" command is in preview. Use it to deploy to Azure Container Apps and let us know what you think!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.