Hello Jasmin Hobden
Welcome to Microsoft Q&A Platform, thanks for posting your query here.
Unfortunately, the autoshutdownschedule tag only supports specific dates and times, and there is no built-in way to quickly postpone a VM from turning on for up to a month.
However, you can achieve this by using Azure Automation and a PowerShell script.
Here are the high-level steps to achieve this:
- Create an Azure Automation account and configure it to manage your VM's.
- Create a PowerShell script that will disable the auto-shutdown schedule for your VM.
- Schedule the PowerShell script to run at the desired time to disable the auto-shutdown schedule.
- Schedule another PowerShell script to run at the desired time to re-enable the auto-shutdown schedule.
Here is an example PowerShell script that you can use to disable the auto-shutdown schedule for a VM:
$resourceGroupName = "myResourceGroup"
$vmName = "myVM"
$vm = Get-AzVM -ResourceGroupName $resourceGroupName -Name $vmName
$vm.EnableAutoShutdown = $false
Update-AzVM -ResourceGroupName $resourceGroupName -VM $vm
You can modify this script to include the desired time period for disabling the auto-shutdown schedule. Similarly, you can create another PowerShell script to re-enable the auto-shutdown schedule at the desired time.
I hope this helps!