Wednesday, 29 May 2024

Serverless platform with Azure Container Apps

 

Serverless platform with Azure Container Apps

Azure Container Apps

For sure, most of IT administrators love containers but don’t have time enough to manage their own Kubernetes platform. It is time consuming and for beginner it is not easy to manage. Maybe you just want to test your application on Kubernetes in order to migrate on this platform in the future, or you just don’t have the skills to manage complex container orchestrators.

Well, probably Azure Containers Apps is for you. Azure Container Apps is serverless, so just focus on your code and that’s all! Of course, Azure Containers Apps (ACA) is based on Kubernetes platform.

I know the first question is « why do I need another K8S services in Azure? ». Microsoft provides more details on the differences here: https://docs.microsoft.com/en-us/azure/container-apps/compare-options

  • AKS (Kubernetes service) is a fully managed Kubernetes service in Azure
  • ACI (Container Instances) allows you to run containers on a single pod of Hyper-V isolated containers on-demand.
  • Web Apps for containers (Azure App Service) is fully managed. Web applications may be deployed using code or containers

Below are some example scenarios for ACA (from the Microsoft Documentation)

Example scenarios for ACA

Getting started

In this guide, we will create our first Azure Container Apps using the Azure portal.

Open the Azure portal and go to « Container Apps », then click « Create »

Container Apps

You must create the first environment byu entering the name of the environment and selecting the region.

What is an environment?

An environment is a secure boundary, you can deploy many containers apps in the same environment, so they will use the same virtual network and you will be able to write logs to the same Log Analytics workspace.

Create container apps environment

Click next and select:

  • Your subscription
  • Your resource group
  • The container app name
  • And the container apps environment (previously created or create a new one)

Create container app

Click next deep dive into the app settings tab. You must create a container, in my case I will use a WordPress image located on docker hub registry.

What is a container?

It is similar to Kubernetes Pods. Each container app can contain multiple containers, and they all share the same life cycle, the same disk and can communicate directly with each other. More information here: https://docs.microsoft.com/en-gb/azure/container-apps/containers

If you just want to test ACA, with a default image, you can use the quickstart image (see screenshot below)

App settings

Else, if you want to test with your own image, uncheck the quickstart checkbox in order to enter more information

Quickstart checkbox

Then, you must configure the ingress settings. Azure Container Apps allows you to expose your container app to the public web by enabling ingress. So you don’t need a Public IP Address or a Load Balancer. Just expose the target port and click next.

Application ingress settings

Click « review + create » to deploy your ACA.

If you want to deploy ACA with the default quickstart image, you can add another container image by clicking « Add » in the container image section.

Add another container image

Enter all the required information:

Enter all the required information

Click add to confirm and then you should see two images

Container image

The quickstart image is very basic, it is just a single web HTML page:

Single web HTML page

In my case I deployed WP using a container image located on Docker Hub registry

WordPress

Set up your database connection

No comments:

Post a Comment