I find Azure Container Instances (ACI) very confusing. In Azure Container Apps, if there are no requests, the service scales down to zero and stops billing. However, does ACI also have such a feature?
For example, if I deploy a container that is called once a month, and each call takes 5 seconds to complete, will I be charged for the 5 seconds or for every second in the month for which it was deployed/available?
How can I stop/pause ACI to only bill for the 5 seconds used?
I know that is not a strictly programming question, so I appreciate that this may not be the best forum to ask, but I am unsure where else to post this.
Thank you in advance!
CodePudding user response:
I realized that ACI is not the solution that should be used for such a workload. ACI is meant to run tasks like compiling apps, not for servers that wait for a client to request something.
CodePudding user response:
You can use Azure Automation or logic app to stop/start containers in ACI but that's extra work on your part to implement that. In your scenario if you want to only pay for what you use and then the best options are
- Azure Function (Basic App Service plan required, so there will be a minimum charge and won't quite scale to zero)
- Azure Container Apps (scale rule to 0 when no traffic)
Your best bet (apart from going to the full-blown AKS) here is to run this workload in Azure Container Apps and scale to 0 when there is no traffic and pay for only when you have traffic.