PowerShell command prompt

Use PowerShell to Add Virtual Machine to Availability Set

Q: How can I use PowerShell to add a virtual machine to an Availability Set in Azure?

A: Use the Set-AzureAvailabilitySet cmdlet to add a virtual machine to an availability set; for example:

Get-AzureVM -ServiceName "savilltech101" -Name "WebSrv3" |
    Set-AzureAvailabilitySet -AvailabilitySetName "IIS" |
    Update-AzureVM

To remove, simply set the AvailabilitySetName to "".

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish