In this post I'll show you how to resize automatically azure virtual machines.
Microsoft Azure offers some cheap low spec virtual machines. But as we all know, the prices can go up pretty quickly as the specs go up. But we need large VMs to support today’s modern day workloads. The downside is that most of these workloads are only present during business hours but you end up running and paying for these large VMs even during non-business hours and on weekends.
The solution here is to have an azure automation script that resizes the VMs to the lowest possible size during non-business hours and have another automation script to resize the VMs to their original size just before start of business.
Because Azure has two portals (for now..), I'll show you the scripts from both (since threre are many differences).
- Old Portal - Azure ASM (Azure Service Manager)
- New Portal - Azure ARM (Azure Resource Manager)
Let's see how to do it!