Everything you need to know about Azure Container Apps
Containers are becoming the most reliable way to package, deploy and manage cloud applications and resources. This is due to their flexibility in allowing developers to deploy resources across multiple environments seamlessly. Containers have attained a great following among developers as it solves several pressing issues when the application runs in different environments.
Generally, when an application runs in one environment and fails to run in another environment, it is due to the differences in the configuration of the underlying library requirements and other dependencies.
Containers solve this problem by providing a lightweight, immutable infrastructure to package the application as a whole for deployment or hosting purposes. The container packages the dependencies, microservices, and configurations needed by the application or service together into a container image.
This application (now packaged as a container) can be deployed as a container image instance on the cloud or on the host operating system. However, when it comes to hosting containerized applications, the cost might be an overwhelming factor. Many cloud hosting options for microservice and containerized resources require infrastructure management and orchestration which amounts to a huge cost, more complexity, and more time to market.
This is where Microsoft's latest addition - Azure container apps come into the picture. Let us learn everything about Azure Container Apps in this post.
Table of Contents
- What is Azure Container Apps?
- How does Azure Containers Apps work?
- Benefits of Azure Container Apps
- Declarative scaling rules in Azure container apps to manage traffic
What is Azure Container Apps?
Azure container apps is a fully managed serverless container service that is now in general availability. It allows developers to build microservice architecture packaged into containers. Azure container apps service is actually built on top of the Kubernetes architecture, a fully manageable service to run containerized workloads.
Now the question arises, why not Kubernetes? Kubernetes offers a steep learning curve and is more complex to learn. Azure container apps eliminates this and gives you the full freedom to build applications effortlessly instead of managing and configuring the underlying Kubernetes cluster architecture.
If you want to build Kubernetes-styled applications without direct access to native Kubernetes APIs and cluster management, then Azure container apps provides an end-to-end experience based on optimized practices.
How does Azure Container Apps work?
Azure container apps facilitate an environment that is nothing but an instance of ACA like a Kubernetes cluster or a namespace. You can deploy multiple containers in an environment and they can communicate with each other.
Suppose you are building a microservice-based application, you would deploy all of your microservices in the same environment and then these microservices run independently calling the required functions.
Next, we have container apps. Think of container apps to be similar to Kubernetes Pods. Pods are nothing but a single instance of your running process in your Kubernetes cluster. Each container app may contain multiple containers, but they function like containers in a single pod or app. They all share the same lifecycle, same disk and can communicate directly with each other. The microservice that is a part of your application but has a different life cycle would be in a separate container app within the same environment.
Finally, we have another part called revisions. Revisions are immutable snapshots of your container application at a specific instance of time. When you update your container application from the old version, you end up creating a new revision. At this juncture, you have both of your old and new versions running simultaneously and use traffic management functionality to redirect traffic between the older and newer versions seamlessly.
Benefits of Azure Container Apps
- Provide support for different application types - microservices, HTTP APIs, event handling, long-running processes, and other miscellaneous background tasks.
- Allows writing code in your preferred language, framework, or SDK.
- Provides reliable auto-scaling features based on HTTP traffic and event triggers.
- Simple configurations for modern application lifecycle tasks.
- Powered by Kubernetes and open source technologies like DAPR and KEDA. The Distributed Application Runtime(Dapr) provides APIs for simplifying microservices connectivity and KEDA is a Kubernetes-based Event-Driven Autoscaler with which you can scale your containers based on the number of events to be processed.
Declarative scaling rules in Azure container apps to manage traffic
Azure container apps manages horizontal scaling with a set of declarative scaling rules. As a container app is scaled out, new instances of the container app are created on-demand. These instances are termed replicas. There are two scale properties that apply to all scaling rules in your container app. They are
- minReplicas - The minimum number of replicas running in your container app.
- maxReplicas - The maximum number of replicas running in your container app.
In case you want to ensure that at least one replica in your container app is always running, set minReplicas to 1 or higher. But dealing with replicas requires your attention. Replicas that are not processing, but remain in the memory are billed separately in the idle charge category. If your container scales to zero, it is not billed.
During the last few years, there have been remarkable developments in the cloud-native ecosystem. Sophisticated advancements in storage, networking, and security domains are helping Kubernetes and other cloud-native stacks to become enterprise-ready. However, on the other hand, these advancements are contributing to the increased complexity of the cloud-native stack.
Hence, Azure container apps, which was developed as an abstraction layer above Kubernetes, is the best solution for managing, deploying, and handling containerized applications and resources. Also being a fully managed serverless service, it eliminates the need for infrastructure management and costs for it.
That means that you can just write the code to deploy your microservice-based application in the same container app or different container apps with the same or different lifecycle and disk resources. You also need not worry about managing the infrastructure and other platform services.