Hi there Kommineni SomaShekhar
Thanks fir using QandA platform
You can't directly attach an existing standalone VM to a VMSS Flex in Azure. Instead, follow these steps:
Create an Image of the VM, Deallocate the VM in the Azure Portal and Capture an image of the VM.
Now Create VMSS Flex, Create a new VMSS Flex using the captured image
Set up VM sizes, instance count, and other configurations. Deploy the VMSS Flex.
For more info follow the doc below
https://video2.skills-academy.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-attach-detach-vm?tabs=portal-1%2Cportal-2%2Cportal-3
If this helps kindly accept the answer thanks much.