如何暂停 Azure 应用服务计划? [英] How do I pause an Azure App Service Plan?

查看:31
本文介绍了如何暂停 Azure 应用服务计划?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我认为 Azure 的优势之一是我可以根据需要打开和关闭服务.

I thought one of the advantages of Azure was that I could turn services on and off depending on when I want them to be available.

但是我看不到如何暂停我的应用服务计划.可能吗?

However I cant see how to pause my App Service Plan. Is it possible?

我想使用 S1 层,以便我可以使用它提供的功能.但是,我希望能够在不使用时暂停成本累积.

I want to use the S1 tier so that I can play with what it offers. However I want to be able to pause the cost accumulation when I am not using it.

我从应用服务定价帮助中了解到,应用仍将是即使它处于停止状态也要收费.

I see from the app service pricing help that an app will still be billed for even though it is in the stopped state.

然而,该链接还明确指出,我只为我使用的东西付费.那么它是如何工作的?

Yet the link also clearly states that I only pay for what I use. So how does that work?

推荐答案

如果您将托管计划加入免费套餐,您将不再为此付费.但是,如果您有部署槽和证书等内容,这些内容将被删除.

If you put your hosting plan onto the free tier, you will stop being charged for it. However if you have things like deployment slots and certificates these will be deleted.

打开和关闭服务的能力更多地与能够扩展服务有关,因此如果您需要 50 台服务器一个小时,您可以轻松地做到这一点.

The ability to turn services on and off, is more to do with being able to scale services, so if you need 50 servers for an hour you can easily do that.

使解决方案临时化的方法是使用 Powershell 或 资源管理器模板 然后您可以在需要时部署解决方案,然后在不需要时再次删除它.从这个意义上说,您可以随心所欲地打开和关闭您的服务.

What you can do to make your solution temporary is to create a deployment script, using Powershell or Resource manager Templates then you can deploy your solution for exactly as long as you need it and then delete it again when you don't. In this sense you can turn your services on and off at a whim.

Azure 为您提供构建块来创建您需要的解决方案,您可以自行决定如何最好地使用这些构建块来创建您寻求的解决方案.

Azure provides building blocks for you to create the solution you need, it is up to you to figure out how to best use those building blocks to create the solution you seek.

如果您想使用 S1 定价计划,并且在不使用时不收取费用,那么实现这一目标的唯一方法就是使用自动化.幸运的是,这是相当容易实现的.

If you want to use the S1 pricing plan, and not have it charge when you are not using it, the only way of achieving that is by using automation. Fortunately, this is reasonably trivial to achieve.

如果你看看这个 模板几乎全部配置为按需将网站从 Github 部署到 Azure.如果您对其进行编辑以根据您的需要对其进行配置,则只需运行 2 分钟的脚本即可在线创建一个新的 Azure 网站.

If you look at this template it is pretty much all configured to deploy a website from Github to Azure on demand. If you edit that to configure it to your needs you can have a new Azure website online with 2 minutes of running the script.

然后你会有另一个脚本,一旦你完成它就会删除它.

Then you would have another script that deleted it once you had finished.

这样做不会丢失任何功能,并且可能会在此过程中学到很多关于 Azure 的可能性.

Doing it this way you would loose no functionality, and probably learn quite a bit about what is possible with Azure along the way.

应用服务计划是运行网络应用的硬件.在免费和共享层中,您的 Web 应用程序与其他 Web 应用程序共享一个实例.在其他层中,您有一个专用的虚拟机.您支付的正是这台虚拟机.在这种情况下,您的应用服务上是否运行网络应用无关紧要,您仍然有一个虚拟机在运行,您需要为此付费.

An app service plan is the hardware that a web app runs on. In the free and shared tier your web apps share an instance with other web apps. In the other tiers you have a dedicated virtual machine. It is this virtual machine that you pay for. In that case it is irrelevant whether or not you have web apps running on your app service or not, you still have a virtual machine running and you will be charged for that.

要通过 PowerShell 更改应用服务计划,您可以运行以下命令

To change the App Service Plan via PowerShell, you can run the following command

Set-AzureRmAppServicePlan -ResourceGroupName $rg -Name $AppServicePlan -Tier Free

这篇关于如何暂停 Azure 应用服务计划?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆