Link to home
Start Free TrialLog in
Avatar of Mark Galvin
Mark GalvinFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Azure Automation - Shutdown of VM

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:
workflow ShutDown_STMine_VM
{
$Cred = Get-AutomationPSCredential -Name 'automation'
Add-AzureAccount -Credential $Cred
InlineScript
  {
  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
    }
  }
}

Open in new window


Now, whilst the Shut-down job shuts down the VM's I have in there, I'm seeing this:
User generated imageThe 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?

Thanks
Mark
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mark Galvin

ASKER

hi

Thanks for that. I was using the '-stayprovisioned' to keep the same external IP but see the error of my ways.

If I wanted to have a static external IP as I am hosting an app server how to I go about that? The app server needs to be available to the public via port 25565. I have another question open about the fact that that port is open even though I have set it as endpoint.

Thanks
Mark
you probably don't need a full blown virtual machine for your app.
Hi

The server for the application needs a full Windows Server running.

If have a static IP via Azure is not possible I presume that using something like DYNDNS is allowed?