Home > database >  Downgrading Azure Resources during weekends using PowerShell Automation
Downgrading Azure Resources during weekends using PowerShell Automation

Time:12-16

In order to save expenses in Azure DevOps, I'm trying to scale the resources, which can scale depending on the requirement. Team leads will update the resource requirements in SharePoint, and this runbook needs to be executed with the use of SharePoint data. If such resources are not required on weekends but must be operational on weekdays, they should be shut down or reduced in size. I need to use automation to do it for all of the VMs and App Services in a subscription every Friday. If there is a method to automate this procedure using PowerShell, I'm glad to receive input. Thanks in advance.

I'm looking for feedback on shutting down VMs and Scaling Azure App Services. On weekends, the same may be said for other relevant resources. How can we accomplish this with Azure PowerShell?

CodePudding user response:

The best way to do is by using 'Azure Automation Runbook' scheduled to run every specified day or date by time. To target the VM's, Azure Tags will be much helpful. Your script must check:

  1. A VM has a specific Tags (e.g., StopVM:Friday 11:00PM)
  2. Maintenance Enabled in your monitoring solution
  3. VM is stopped already or not.
  4. Backup required?
  5. Confirm the VM is Deallocated (not stopped)

Auto-Shutdown option is also available to do this activity.

CodePudding user response:

Because sometime all you need is a quick and dirty way to save money :

enter image description here

And if you wan't to build something there's an API to shutdown and start VMs

  • Related