Skip to content

Instantly share code, notes, and snippets.

View sasinaola's full-sized avatar

Sina Salam sasinaola

View GitHub Profile
@sasinaola
sasinaola / convert-to-spot.ps1
Last active July 21, 2024 15:57 — forked from larryclaman/convert-to-spot.ps1
Convert an Azure VM to a Spot VM type
<# Convert a VM to a Spot VM
Based on sample script at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/change-availability-set
NOTE: Extensions will not be copied to new instance!!
#>
# Set variables to your specifics
$resourceGroup = "myRG"
$vmName = "myVM"
# Get the details of the VM to be moved to the Availability Set