如何使用 azure 函数启动停止 azure app 服务计划
How to start stop azure app service plan with azure functions
我在官方 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.
对我来说,听起来应该可以根据发送到服务器以提供网页的请求来启动和停止 Azure 应用程序服务计划。
我的问题是:是否可以这样做?如果可以,怎么做。
我正在考虑的 Azure 功能应该触发启动我的应用程序服务计划,以便网站可以按需工作。
非常感谢!
无法stop/start/pause 应用服务计划。根据配置的层,计费在它存在的时间发生。启动或停止包含的应用程序实例不会影响计费。
如果您想避免为应用服务计划付费,您可以研究其他托管模型,包括静态 Web 应用或在 Azure Functions 中托管。
我在官方 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.
对我来说,听起来应该可以根据发送到服务器以提供网页的请求来启动和停止 Azure 应用程序服务计划。 我的问题是:是否可以这样做?如果可以,怎么做。
我正在考虑的 Azure 功能应该触发启动我的应用程序服务计划,以便网站可以按需工作。
非常感谢!
无法stop/start/pause 应用服务计划。根据配置的层,计费在它存在的时间发生。启动或停止包含的应用程序实例不会影响计费。
如果您想避免为应用服务计划付费,您可以研究其他托管模型,包括静态 Web 应用或在 Azure Functions 中托管。