I've had to switch from the Shared tier to Basic, to avail of SSL support and with that I knew there would be a price hike. But for me it has gone up exponentially - this is going to cost me an extra £50+/month. I have turned off the "Always On" setting and from analytics I can see that there is no traffic between 11pm and 5am most nights yet im averaging a bill of 22 hours per night service for the last 23 days...that's effectively "Always On". Anyone know if I need to tweak something else to reduce the costs? Is there a setting that determines how long before the service goes to sleep?
2 Answers
The cost that you pay for the instances in App Service runs all the time, traffic does not matter.
If you have 1 instance in the plan, you pay for that 1 instance all the time. Always On just prevents an app from idling. It won't reduce billing if you turn it off.
At minimum on Basic tier and up you pay for 1 instance + outbound data traffic.

- 54,244
- 13
- 113
- 149
As juunas stated that Always On could not help you to save the cost, it just be put to sleep and free up resources for other web apps on the same service plan.
Anyone know if I need to tweak something else to reduce the costs? Is there a setting that determines how long before the service goes to sleep?
Even if you stop your app, the App Service plan charges still apply, and the service plan could not be stopped. For a workaround, you could schedule a task and invoke Azure Management SDK to switch the App Service Plan (Shared, Basic).
Use Microsoft.WindowsAzure.Management.WebSites with the authentication using a management certificate. Here is the core code, you could refer to it:
Change pricing tier from Basic to Shared
using (WebSiteManagementClient webappClient = new WebSiteManagementClient(credential))
{
//you could leverage webappClient.WebSpaces.List() to retrieve your webspace
//the format of your web space would be: "{resource-group-name}-{location-of-your-appserviceplan}webspace"
var webSpace="{your-web-space}";
webappClient.WebHostingPlans.Update(
webSpace,
"{The name of the web hosting plan}",
new Microsoft.WindowsAzure.Management.WebSites.Models.WebHostingPlanUpdateParameters()
{
NumberOfWorkers = 1,
SKU = Microsoft.WindowsAzure.Management.WebSites.Models.SkuOptions.Shared
});
}
Note: After change the pricing tier to Shared, your configured SSL certificates would be reserved and until you change it back to Basic, you could retrieve and modify it and it could take effort. Moreover, if you scale out your app into multiple instances, you need to specify the property NumberOfWorkers when you changing pricing tier to Basic. For more detailed steps, you could refer to this similar issue.

- 1
- 1

- 18,207
- 2
- 21
- 35
-
This is quite creative and is something I hadn't thought of. I don't need all the bells and whistles of the Basic plan (other than SSL) so would be nice to scale it down. Thanks for your help – Adrian May 02 '17 at 09:44