AFAIK, this feature can be solved by the end of this year. This is a big task for the MS team to allow such an operation. Changing the availability set requires a review of the VM mobility architecture on Azure. For example, adding a virtual machine to an availability set that already contains a virtual machine means that it is placed in a different default domain. Becasue VM mobilty is an Azure issue (without live migration), it is not an easy operation.
I wrote a Powershell script that allows you to change the AS of a virtual virtual machine by updating it.
Try and enjoy:
How to use it?
1- Download the script and save it in a local location
2- Run it and specify the requested parameters
or
2-./Set-ArmVmAvailabilitySet.ps1 -VmName 'VM Name -ResourceGroup' Resource Group -AvailabilitySetName 'As Name -SubscriptionName' Subscription Name
To remove a virtual machine from AccessSet:
./Set-ArmVmAvailabilitySet.ps1 -VmName 'Virtual Machine Name -ResourceGroup' Resource Group -AvailabilitySetName 0 -SubscriptionName 'Subscription Name
Download link
Version 1.01: https://gallery.technet.microsoft.com/Set-Azure-Resource-Manager-f7509ec4
A source
source share