I have created a new Azure RM VM in a new resource group.This resource group also contains a new storage account, into which I have copied a VHD for the new VM. This VHD is a copy of one that works well on a different VM in a different resource group and location.
If I go to Boot diagnostics from the portal, I can see the VM sat at the login screen (Windows Server 2012).
I can click connect for the VM and download the RDP connection. My problems start when I try to login. Even though I try the same username and password that gets me into the VM from which the VHD was copied, I get access denied on the new VM.
At this point, I thought that wasn't going to be a big problem because I knew a "Reset Password" option was available from the Azure portal. However, when I browse to this option I see the following message:
The VM agent is either unavailable, or not installed, which may prevent VMAccess from running.
If I enter details for the new password and submit then I get a dialog informing that password is being reset. This appears on screen for approx 20 minutes.
After such a failure I turned to PowerShell.
I ran the following script (with the variables set appropriately):
Set-AzureRmVMAccessExtension -ResourceGroupName $rgName -VMName $vmName -Name $vmName `
-Location $location -UserName $cred.GetNetworkCredential().Username `
-Password $cred.GetNetworkCredential().Password -typeHandlerVersion "2.0"
This came back with the error:
Set-AzureRmVMAccessExtension : Multiple VMExtensions per handler not supported for OS type 'Windows'. VMExtension 'UPWORK1-VM' with handler
'Microsoft.Compute.VMAccessAgent' already added or specified in input.
Can anyone please suggest how I could possibly login to the VM?