question

Kman-9406 avatar image
0 Votes"
Kman-9406 asked azure-cxp-api edited

Running Flask app in Azure

What is the best way to run flask app in Azure.

I wanted to create a Azure Function and have the flask library within the Azure Function but the problem is trying to avoid cold starts.

Is there a way to have flask App on Azure without worrying about cold starts. I would like it to run on demand when its triggered.

Premium plan would not work because of pre-warmed instances times duration.

The Azure Functions would be implemented as an APIs that are called from web-pages, then a cold start potentially would be an issue.

azure-functions
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ryanchill avatar image
0 Votes"
ryanchill answered ryanchill commented

You can host your Azure Function on a premium app service plan to avoid cold starts. See https://docs.microsoft.com/en-us/azure/azure-functions/functions-premium-plan?tabs=portal for more details.

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ryanchill Premium app service plan doesn't eliminate the cold start because of inactivity the pre-warmed instance time wont work as we will need this for a Web Interface.

The Azure Functions would be implemented as an APIs that are called from web-pages, then a cold start potentially would be an issue.

https://stackoverflow.com/questions/59820442/azure-functions-premium-plan-still-has-cold-start-after-inactivity-or-deployment

0 Votes 0 ·

Always ready instances under the elastic scale out blade set is set to 1 by default. Pre-warmed instances should remain in the buffer ready to go once the always on instance(s) has started processing requests. Are you seeing latency or instances starting up @Kman-9406?

0 Votes 0 ·

@ryanchill On a different project our developers used Azure Function app with premium plan and they mention there is a latency in starting up when there is inactivity. They mentioned there needs to be some sort of trigger on the Azure Function to keep it awake in order eliminate cold start. We will use the API for the Azure Function on a Web Interface.

0 Votes 0 ·
Show more comments