Install the VM Agent on an existing Azure VM

The Windows Installer MSI package to install the VM Agent on an existing Azure VM is available for download at the following location:

The MSI must be run from an elevated command prompt.

After installing the VM agent, you must also use Azure PowerShell to update the ProvisionGuestAgent property so Azure knows the VM has the agent installed. This is also documented on MSDN at Manage Extensions.

$vm = Get-AzureVM –ServiceName <cloud service name> –Name <VM name>
$vm.VM.ProvisionGuestAgent = $true
Update-AzureVM –Name <VM name> –VM $vm.VM –ServiceName <cloud service name>

Now if you run Get-AzureVM again, the GuestAgentStatus property should be populated instead of blank:

Get-AzureVM –ServiceName <cloud service name> –Name <VM name>


Updating the ProvisionGuestAgent property is only necessary if the VM is already running in Azure and the agent was not provisioned when the VM was created. When creating a VM from an image (including from custom image), by default the VM agent is installed and that property is updated automatically.

Note that when creating a VM from an existing, specialized VHD (sysprep was not run generalize it), selecting Install the VM Agent in the portal only sets the property and does not install the agent. In that scenario you must install the agent after the VM is provisioned in Azure.

Comments (8)
  1. Knave says:

    Installed the tool and ran the Powershell commands as instructed, but the background hasn't shown yet (despite reboot).

    The WindowsAzureGuestAgent service is running, but the Azure Portal doesn't reflect the extension as well.

  2. Jamin says:

    The MSI install freezes at configuring services (this may take a few seconds).

    Is there a way to confirm the service started anyway from services.msc?

  3. Craig Landis says:

    Try running it from an elevated command prompt. I've updated the post to reflect an issue we've found related to elevation.

  4. EG says:

    It's annoying that there is no cmdlet to simply install the VM Agent. We are early adopters of Azure and have hundreds of machines without the agent. I cant even push it via GPO because it fails due to elevated command prompt requirements (process sits at 0 and hangs).

  5. vikash gaurav says:

    i am facing the same problem with linux vm.

    i want to know how to update/ install VM agent and extension. please add a solution ASAP.

    Thank you in advance.

  6. Ammar Rizvi says:

    Hi @Craig Landis, I installed the agent for which I need to perform the backup. what could be a possible reason that when I try to set the property above, I get a no default subscription set error. I try the

    select-azuresubscription – default – subscriptionname "mysubscriptionname"

    command but it says that it did not find any subscription with that name.

    On the other hand, another machine shows up in the discovery of the VMs. Surprisingly, I get the same errors on it as well. But it still does appear under the list of discovered VMs. What exactly am I missing on the other VM?

  7. Jose Caiazzo says:

    Greetings to all,

    I'm getting the following error after Update-AzureVM:

    Update-AzureVM : Networking.DeploymentVNetAddressAllocationFailure : Unable to allocate the required address spaces for the deployment in a new or predefined subnet that is contained within the specified virtual network.

    Is it required that the VMs are stopped for the update?

    Thanks in advance

  8. Richard Clarke says:

    Found a solution to this using the new management portal – download the agent installer from the link provided on the new Azure Management Portal – the link will appear when you try to pick an extension to install for the first time. Install the Agent on the VM (I just right clicked install on the MSI file once downloaded logged in as administrator profile).

    Then install the BGInfo extension from within the new Management Portal – this will in effect finalize the VM Agent installation rather than having to use the powershell script above. Bit of a hacky workaround but did the job.

Comments are closed.

Skip to main content