vscode-azurefunctions icon indicating copy to clipboard operation
vscode-azurefunctions copied to clipboard

Azure function created with always on = off

Open ihorbond opened this issue 2 years ago • 6 comments

  • VS Code Version: latest
  • Azure Account Extension Version:
  • OS Version: win 10

Steps to Reproduce:

  1. Create an azure function via VS Code extension.
  2. Deploy.
  3. Login into Azure Portal and find the created function.
  4. Go to Configuration -> General Settings.

Result: Always on = off image

ihorbond avatar Jan 16 '22 03:01 ihorbond

Hi @ihorbond, thanks for filing an issue.

Please elaborate as to what problem you're running into and provide steps to reproduce it.

wwlorey avatar Jan 18 '22 15:01 wwlorey

@wwlorey just added the steps. sorry was in a rush. maybe this bug is purely presentational but I noticed when you crate an Azure function via Azure Portal UI always on defaults to On vs function created via vscode ext it defaults to Off

ihorbond avatar Jan 20 '22 19:01 ihorbond

Thanks for providing these details @ihorbond. Transferring this to the Azure Functions Extension repo to better address the issue.

wwlorey avatar Jan 20 '22 19:01 wwlorey

More context on this:

From https://docs.microsoft.com/en-us/azure/app-service/configure-common?tabs=portal#configure-general-settings:

Always On: Keeps the app loaded even when there's no traffic. When Always On is not turned on (default), the app is unloaded after 20 minutes without any incoming requests. The unloaded app can cause high latency for new requests because of its warm-up time. When Always On is turned on, the front-end load balancer sends a GET request to the application root every five minutes. The continuous ping prevents the app from being unloaded. Always On is required for continuous WebJobs or for WebJobs that are triggered using a CRON expression.

wwlorey avatar Jan 20 '22 23:01 wwlorey

Fyi @wwlorey I think this is only for app service plans (not consumption or premium) https://docs.microsoft.com/en-us/azure/azure-functions/dedicated-plan#always-on

@ihorbond can you confirm you chose a dedicated app service plan?

ejizba avatar Jan 21 '22 00:01 ejizba

Yes, I did have an app service selected and it is HTTP triggered. so that means it should be off by default then and will wake on HTTP request and will take a some time to warm up correct ?

ihorbond avatar Jan 21 '22 16:01 ihorbond