Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
305 views
in Technique[技术] by (71.8m points)

How do I pause an Azure App Service Plan?

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?

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

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.

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 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.

Edited to answer extended question.

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.

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.

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

App Service Plan

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.

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

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...