azuredemoenvironment / ade

Azure Demo Environment
MIT License
34 stars 11 forks source link

Schedule an Azure Runbook to Scale Down Services in Off Hours #217

Open brandonmartinez opened 2 years ago

brandonmartinez commented 2 years ago

To help reduce cost, create a runbook that scales down any possible services in off hours (this would be similar to the deallocate command, but automated).

Standard Performance Windows:

Services to Scale Down or Stop:

Bicep reference for runbooks: https://docs.microsoft.com/en-us/azure/templates/microsoft.automation/automationaccounts/runbooks

This should be scheduled to run in the Standard Performance Windows outlined above.

brandonmartinez commented 2 years ago

@joshuawaddell this is an idea that popped up during a call; might be a nice, atomic story for the hackathon.

sjkaursb93 commented 2 years ago

The bicep were modified to include automation under governance. For app services: we'd want to scale down from P to B1. To do so we have to disable 2 kind of diagnostics which are only available in P sku (Report Antivirus Audit Logs & Site Content Change Audit Logs/ AppServiceFileAuditLogs - old name). I have tested and disabled those diagnostics

sjkaursb93 commented 2 years ago

Also had to add the automation resource group to the remove script