In this demo, we'll do a deep dive on the autoscaling capabilities of various Azure services like ACA (Azure Container Apps) and AKS (Azure Kubernetes Service).
You'll also get an insight into how to use Azure Monitor to monitor the application's performance and health.
All these are especially crucial for an e-commerce application like Contoso Traders, which is expected to instantly handle a large, sudden spike in number of users, with low latency and no downtime.
-
There are some prerequisites for this demo mentioned in the application deployment guide. After executing all the steps mentioned in that document, the application's infrastructure will be provisioned on Azure, and the latest code will be deployed as well.
-
Prior to attempting this exercise, you should first execute the autoscaling overview exercise.
-
In the Azure portal, you can navigate to the Azure Container App in the
contoso-traders-rg
resource group. -
You can create a new revision without scaling enabled (i.e. max instances = 1).
-
Next modify the github workflow file
.github\workflows\contoso-traders-load-testing.yml
to increase thethreads_per_engine
to (say) 30. Now commit the change to themain
branch. -
Manually execute the github workflow from the portal.
-
Since ACA cannot scale out beyond 1 instance, the API will starting failing.
-
Azure Application Insights (where the API app sends its traces & telemetry) will have the fine-grained details of the failures.
-
Let's configure a
HTTP Scaling
rule that horizontally scales out to (say) 25 replicas. Also let us set a scaling rulehttp-scaling
that causes ACA to create replicas when there are more than 10 concurrent requests. -
You can now re-run steps 4 to 6 from first walkthrough above (i.e. re-run the load test).
-
This time you shouldn't encounter any failures. The API will be able to handle the load by automatically scaling out to 25 replicas. Once the load subsides, the replicas will be scaled back in.
In this demo, you got an deep dive into the autoscaling features of Azure services like ACA (Azure Container Apps). You can now head over to the other demos of this app.