Set up Azure Container Apps

Completed

In this unit, you learn how to create an Azure Container Apps environment and an Azure for PostgreSQL database by using Azure CLI. You then configure your Quarkus application so that it connects to the remote database instead of the local one.

Several targets are available for deploying a Quarkus application on Azure, ranging from IaaS to FaaS. Azure Container Apps is between PaaS and FaaS. It's more like a PaaS because it doesn't force you into a specific programming model, and you can control the rules by which to scale out and in. On the other hand, it has some serverless characteristics, like scaling to zero, event-driven scaling, and a per-second pricing model.

Screenshot that shows all Azure compute services.

Container Apps is built on Azure Kubernetes Service (AKS). It includes deep integration with KEDA (event-driven autoscaling for Kubernetes), Dapr (distributed application runtime) and Envoy (a service proxy designed for cloud-native applications). The underlying complexity is abstracted, so you don't need to configure your Kubernetes service, deployment, ingress, or volume manifests. You get a simple API and user interface to configure your containerized application. Because of this simplification, you have less control than you have with AKS.

In Container Apps, applications need to be packaged into a Docker container. Container Apps supports Docker containers built with Dockerfiles or with Jib. The container needs to be available on a container registry. Container Apps supports Azure Container Registry, Docker Hub, and GitHub Container registry. After the application image is available in a registry, Container Apps supports deploying from the Azure portal, Azure CLI, GitHub Actions, and Azure DevOps.

Container Apps provides the following features.

  • Revisions: Automatic versioning that helps you manage the application lifecycle of your container apps.
  • Traffic control: The ability to split incoming HTTP traffic across multiple revisions for blue/green deployments and A/B testing.
  • Ingress: Simple HTTPS ingress configuration. You don't need to worry about DNS or certificates.
  • Autoscaling: KEDA-supported scale triggers to scale your app based on external metrics.
  • Secrets: Secrets that are shared among containers, scale rules, and Dapr sidecars.
  • Monitoring: Standard output and error streams that are automatically written to Log Analytics.
  • Dapr: Dapr integration for your container apps. Enable this integration by using a simple flag.

In the next exercise, you'll be introduced to the following concepts.

  • Environment: An enhanced-security boundary around a group of container apps. The apps are deployed in a single virtual network, they can easily intercommunicate with each other, and they write logs to a single Log Analytics workspace. An environment can be compared with a Kubernetes namespace.
  • Container app: A group of containers (a pod) that's deployed and scales together. They share a single disk space and network.
  • Revision: An immutable snapshot of a container app. New revisions are created automatically and are valuable for HTTP traffic redirection strategies like A/B testing.

Screenshot that illustrates Container Apps concepts.

You'll now create a Container App environment to see how these elements work.