Q: How can I see a list of all virtual machine extensions available in Azure, as well as the parameters that can be used?
A: With the introduction of the virtual machine agent that's available as an optional component for Microsoft Azure IaaS virtual machines, several extensions are available to add management capabilities (e.g., resetting local passwords inside the virtual machine, resetting network configuration, using BGinfo, malware protection, automation using technologies such as Puppet, Chef, and PowerShell). Partners can add their own extensions to Azure virtual machines; for example, the Visual Studio team has an extension to enable remote debugging of a virtual machine in Azure. The extensions that are available are constantly changing. Although the Azure blog provides great information, the best method I've found is to use PowerShell:
- Get-AzureVMAvailableExtension | Out-GridView
This code outputs a graphical grid view—although you could just as easily output a list (format-list) or table (format-table)—that shows the extensions available, as well as the public configuration schema (which are attributes you can use to configure) and the private configuration schema (which includes private attributes that shouldn't be exposed, such as passwords).
As the following figure shows, the required schema configuration can be fairly complex.
Microsoft provides cmdlets to help with some of the extensions. For example, you can use
for resetting the password. You can use
- Get-Help Set-AzureVMAccessExtension
to find help. As an example, I can use the following command to reset the password of my virtual machine in Azure (note that the ReferenceName must be consistent in all future uses with the virtual machine, so you should pick a name):
- $SandboxVM = Get-AzureVM -ServiceName savtecheastus -Name sandbox
- Set-AzureVMaccessExtension -VM $SandboxVM –UserName "localadmin" –Password "P@55word!" –ReferenceName Reset-Pass1
- #Save the change to extensions
- $SandboxVM | Update-AzureVM