简体   繁体   English

如何使用azure功能启动停止azure应用服务计划

[英]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 :我在 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.对我来说,听起来应该可以根据发送到服务器以提供网页的请求来启动和停止 Azure 应用服务计划。 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.我正在考虑的 Azure 功能应该触发启动我的应用服务计划,以便网站可以按需工作。

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.如果你想避免为应用服务计划付费,你可以研究其他托管模型,包括静态 Web 应用或 Azure Functions 中的托管。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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