I am new to Azure docker container
I am building a docker image in VS code with the help of extensions, I have now published to ACR and I can see my container has been deployed.
I can hit the url and I can see logs as well but after few minutes container is automatically scaled down to 0 and stopped logging anything.
I could not see any scale setting in VSCode when building/deploying the image, so I am not sure where and how can I set it to always running.
I can share dockerFile but I am not typing any command and using VS code UI instead. I have also removed everything form my code and just log "hello world" so there is not exception or anything.
This container runs async which means a service bus queue receives a messages and then a function in a function app is triggered.
and this is what I see in system logs
When you first create a container app in Azure, the scale rule is set to Zero because Azure Container app is fully Server-less as given in this Microsoft Document.
Practical 1: Quick Start - Hello World Container
I have created the Azure Container App with the Quick Hello-World Image with the default “Http Scaling” rule and browsed the Azure Container App Site after deployment:
As it is in running state, the replica is 1.
I can hit the url and I can see logs as well but after few minutes container is automatically scaled down to 0 and stopped logging anything.
Note: If any requests or traffic is not sent to the application URL within the cooling period of 5 minutes, then it automatically scales down to 0 replicas as mentioned in above MS document.
Practical 2: Docker Container Image
Following this tutorial of CoachDevOps, I uploaded the docker image to ACR that contains python application and this ACR Image to the Azure Container app.
If you see the scaling part, by default it is taken as 0 to 10 while provisioning the Azure Container App where you can edit the scale rule and method of scaling.
Here my application is not sending any traffic to the container so it is scaled down to 0.
so I am not sure where and how can I set it to always running.