Hi Azure Experts
I have been testing Azure of late and getting stuck in.
I have setup Azure Automation. I have configured a Start-up Job which works a treat. I have also created a Shut-down Job as follows:
$Cred = Get-AutomationPSCredential -Name 'automation'
Add-AzureAccount -Credential $Cred
Select-AzureSubscription -SubscriptionName "Microsoft Partner Network"
$VMS = Get-AzureVM
ForEach ($VM in $VMS)
$VMName = $VM.Name
Write-Output "Attempting to shut down VM: $VMName"
Stop-AzureVM -ServiceName $VM.ServiceName -Name $VM.Name -StayProvisioned
Now, whilst the Shut-down job shuts down the VM's I have in there, I'm seeing this:
The message 'Virtual machines continue to incur compute charges if they are stopped from the guest operating system. To avoid these charges, use the management portal to stop the virtual machines or to delete them' - can anyone advise how I can get the VM to completely shutdown so that it is not incurring any Compute Charges?