<p>You are looking for <a href="https://azure.microsoft.com/en-us/resources/cloud-computing-dictionary/what-is-serverless-computing/#:%7E:text=What%20is%20serverless%20computing%3F,required%20to%20run%20the%20code." rel="nofollow noreferrer">Serverless</a>. The app will be auto-scaled up if there's a demand.</p>

CC BY-SA 4.0
2023-02-13T09:36:51.857Z
2023-02-13T09:36:51.857Z
rokpoto.com
<p>I have an azure webapp based on a docker image that implements an image processing API and is expensive to leave active 24/7.  I'm wondering if there's an easy-to-manage way to auto-scale from 0 to 1 instances when we need it, and auto-shutdown after some period of inactivity.  AKS seems like one option but maybe it's overkill?</p>
<p>I also considered azure functions but since we're using a custom docker image it wasn't clear to me if I can provision an on-demand instance.</p>
<p>The API app runs in the background to respond to requests from a thin Flask app, and the Flask app has a background Celery task thread, so I could take on the task of toggling API availability from the Celery thread. This seems doable but also feels a lot like I'm reinventing the wheel.</p>
<p>Is there a better approach?</p>

<azure-devops><azure-kubernetes-service><flask>
Best approach to toggle app availability in azure?
Robert Sim
# Best approach to toggle app availability in azure?

(Asked by: username_0 on 2023-02-11)

I have an azure webapp based on a docker image that implements an image processing API and is expensive to leave active 24/7. I'm wondering if there's an easy-to-manage way to auto-scale from 0 to 1 instances when we need it, and auto-shutdown after some period of inactivity. AKS seems like one option but maybe it's overkill?

I also considered azure functions but since we're using a custom docker image it wasn't clear to me if I can provision an on-demand instance.

The API app runs in the background to respond to requests from a thin Flask app, and the Flask app has a background Celery task thread, so I could take on the task of toggling API availability from the Celery thread. This seems doable but also feels a lot like I'm reinventing the wheel.

Is there a better approach?

**Tags:** azure-devops, azure-kubernetes-service, flask


---

## 1 answers

### Answer by username_1 on 2023-02-13. Score: 1

You are looking for [Serverless](https://azure.microsoft.com/en-us/resources/cloud-computing-dictionary/what-is-serverless-computing/#:%7E:text=What%20is%20serverless%20computing%3F,required%20to%20run%20the%20code.). The app will be auto-scaled up if there's a demand.


---

