Azure Container Apps manages automatic horizontal scaling through a set of declarative scaling rules. As a container app scales out, new instances of the container app are created on-demand. These instances are known as replicas.
In our scenario our app is about to go live so we will change things so that the new app is receiving all of the traffic, plus we'll also setup some scaling rules. This will allow the container apps to scale up when things are busy, and scale to zero when things are quiet. We will also deploy and additional Dashboard App to monitor the orders currently in queue and store.
The following image illustrates the steps in this challenge
- Add support for scaling Container App based on load
- Deploy new version of Container App
- Run load testing tool to examine scaling behavior
- Examine scaling rules for HTTP API and Queue Reader app by reviewing existing Bicep template v4
- Deploy the updated Bicep template
- Review Queue Reader application logs in Log Analytics
- Run script to bulk add orders via HTTP API and watch revisions
- View order count in store and queue using Dashboard App
- Reviewed and understood scaling rules for HTTP API and Queue Reader Container Apps by examine existing Bicep template v4
- Deployed Bicep template v4 including scaling rules
- Run script to bulk add 10000 orders via HTTP API and watch replica scaling using tmux
- Verified logs in Log Analytics for Queue Reader application that all orders are correctly using newest revision
- Examined order count in queue and store using Dashboard App (https://dashboardapp.[your container app environment domain])
- Set scaling rules in Azure Container Apps (learn.microsoft.com)
- tmux (github.com)
- Monitor logs in Azure Container Apps with Log Analytics (learn.microsoft.com)
- View the solution here: Challenge 4 - Solution
- Challenge 1: Setup the environment
- Challenge 2: Deploy Container Apps Environment and troubleshoot Container Apps
- Challenge 3: Split traffic for controlled rollout
- Challenge 4: Scale Container Apps
- Challenge 5: Configure CI/CD for Container Apps
- Challenge 6: Protect Container App with API Management
- Challenge 7: Enable Container App authentication