If you want to make end to end automation in Azure. You need to attach some sort of script after the vm finished provisioning.
There are different status while you creating vm. You dont want to send a script when the server is provisioning.
You can use the following PowerShell script to detect the vm is finished provisioning, and start you script afterwards.
1 |
$vmname='' |