简体   繁体   中英

How to start stop azure app service plan with azure functions

I came across the following statement in the official Microsoft Docs Decide when to use Azure Functions :

Micro-billing: Traditional computing bills for a block of time like paying a monthly or annual rate for website hosting. This method of billing is convenient but isn't always cost effective. Even if a customer's website gets only one hit a day, they still pay for a full day's worth of availability. With serverless computing, they pay only for the time their code runs. If no active function executions occur, they're not charged. For example, if the code runs once a day for two minutes, they're charged for one execution and two minutes of computing time.

To me, it sounds that it should be possoble to start and stop an Azure App Service Plan according to the request sent to the server to provision a webpage. My question is: is it possible to do that?, and if yes, how.

The Azure function I'm thinking of, should trigger starting my App Service Plan so that the website can work on demand.

Many thanks!

It's not possible to stop/start/pause an App Service Plan. Billing occurs for the time it exists according to the configured tier. Starting or stopping a contained app instance does not affect billing.

If you want to avoid paying for an App Service Plan, you can look into other hosting models including static web apps or hosting within Azure Functions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM