The cloud is meant to be used differently than on-premises resources. There’s no “we have it, we use it” mindset in Azure. If you want to get the most out of your cloud environment, you need to adopt the pay-as-you-go (PAYG) model. This also means shutting down services you don’t need. Make use of the flexibility Azure offers you.
Have you tried turning it off and on again? That’s not just the standard advice from The IT Crowd - it can also save you a lot of money. The pay-as-you-go model in the cloud lets you only pay for what you actually consume. This creates an opportunity to rethink how you run your IT. There’s no need to run services 24/7 if they’re only used during core working hours on weekdays.
Many organizations have services that run regularly but aren’t used every day. These services can be shut down and restarted only when needed. Some customers save significantly by embracing serverless technology like Azure Functions with a consumption plan. With this model, costs are based on how often the service runs. If it’s idle, it doesn’t cost anything - billing only starts when the function is triggered.
To efficiently turn off services during nights and weekends, automation is your best friend.
The simplest way to start is by enabling Auto-Shutdown for Azure Virtual Machines. This feature is perfect for test environments or developer machines that don’t need to run overnight. Developers can start their environments manually when they begin work the next day. The Auto-Shutdown feature in the Azure Portal simplifies managing costs for Virtual Machines.
When managing larger environments, using tags to organize and automate shutdown processes is highly recommended. Tags help you categorize resources, making it easier to identify and manage them systematically.
For example, you could add a tag:
Shutdown: 6to6
This indicates the resource should be shut down at 6 PM and restarted at 6 AM on workdays. With automation scripts, you can use these tags to systematically shut down and restart resources as needed.
Autoscaling is another effective way to manage costs, especially for services like Azure Virtual Desktop (AVD). Let’s consider this scenario:
In this case, you could purchase Reserved Instances (RIs) for session hosts for 50 Users (24/7 usage) and use PAYG for the remaining sessions. By combining RIs and PAYG with autoscaling, you could achieve up to 65% cost savings.
Turn off or scale down services you don’t need outside of core working hours and during weekends. These simple steps can quickly save you 60% or more on compute costs.
Identifying which resources to shut down requires thorough monitoring. Here are some steps to get started:
Transforming your business to a 9-to-5 model in IT can save costs, but it’s not just a technical change — it’s an organizational shift. Teams need to move away from the mindset of “we’ve always done it this way” and embrace the cloud’s flexibility. Be prepared to repeat the message often: adopt PAYG and adapt your processes to it.
After engaging with stakeholders and confirming which resources can be shut down, implement automation to manage the process efficiently.
Apply tags to the resources you want to manage. For example:
Shutdown
9pm
Tags make it easier to identify and group resources for automated processes.
Set up an Azure Automation Account to manage shutdown and restart tasks. Search for “Automation” and create an Azure Automation Account.
Within the Automation Account, create a Runbook to define the script that will handle the shutdown and restart of resources.
Here’s an example of a PowerShell script to shut down tagged resources:
$tagName = "Shutdown"
$tagValue = "9pm"
# Get all virtual machines in the subscription
$vms = Get-AzVM
# Filter virtual machines with the specified tag name and value
$vmsToShutdown = $vms | Where-Object {
$_.Tags.Keys -eq $tagName -and $_.Tags.Value -eq $tagValue
}
# Loop through the filtered virtual machines and stop them
foreach ($vm in $vmsToShutdown) {
$resourceGroup = $vm.ResourceGroupName
$vmName = $vm.Name
Write-Output "Stopping virtual machine: $vmName in resource group: $resourceGroup"
Stop-AzVM -ResourceGroupName $resourceGroup -Name $vmName -Force
}
You can schedule this script to run at specific times (e.g., every weekday at 9 PM) using Azure Automation.
The cloud offers immense flexibility, but unlocking its full potential means adapting how you manage your IT. Shutting down unused resources outside of core hours is a simple yet powerful way to optimize costs. With tools like Azure Automation, tagging, and autoscaling, you can save significant amounts on your cloud bills while maintaining an efficient IT environment.
Start small, automate where possible, and repeat the process until it becomes a habit.
Happy optimizing!