Microsoft.Compute virtualMachines/extensions 2018-10-01

Template format

To create a Microsoft.Compute/virtualMachines/extensions resource, add the following JSON to the resources section of your template.

{
  "name": "string",
  "type": "Microsoft.Compute/virtualMachines/extensions",
  "apiVersion": "2018-10-01",
  "location": "string",
  "tags": {},
  "properties": {
    "publisher": "string",
    "type": "string",
    "typeHandlerVersion": "string",
    "autoUpgradeMinorVersion": "boolean",
    "settings": {},
    "protectedSettings": {},
    "instanceView": {
      "name": "string",
      "type": "string",
      "typeHandlerVersion": "string",
      "substatuses": [
        {
          "code": "string",
          "level": "string",
          "displayStatus": "string",
          "message": "string",
          "time": "string"
        }
      ],
      "statuses": [
        {
          "code": "string",
          "level": "string",
          "displayStatus": "string",
          "message": "string",
          "time": "string"
        }
      ]
    }
  }
}

Property values

The following tables describe the values you need to set in the schema.

Microsoft.Compute/virtualMachines/extensions object

Name Type Required Value
name string Yes The name of the virtual machine extension.
type enum Yes extensions
-or-
Microsoft.Compute/virtualMachines/extensions

See Set name and type for child resources.
apiVersion enum Yes 2018-10-01
location string Yes Resource location
tags object No Resource tags
properties object Yes VirtualMachineExtensionProperties object

VirtualMachineExtensionProperties object

Name Type Required Value
publisher string No The name of the extension handler publisher.
type string No Specifies the type of the extension; an example is "CustomScriptExtension".
typeHandlerVersion string No Specifies the version of the script handler.
autoUpgradeMinorVersion boolean No Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true.
settings object No Json formatted public settings for the extension.
protectedSettings object No The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.
instanceView object No The virtual machine extension instance view. - VirtualMachineExtensionInstanceView object

VirtualMachineExtensionInstanceView object

Name Type Required Value
name string No The virtual machine extension name.
type string No Specifies the type of the extension; an example is "CustomScriptExtension".
typeHandlerVersion string No Specifies the version of the script handler.
substatuses array No The resource status information. - InstanceViewStatus object
statuses array No The resource status information. - InstanceViewStatus object

InstanceViewStatus object

Name Type Required Value
code string No The status code.
level enum No The level code. - Info, Warning, Error
displayStatus string No The short localizable label for the status.
message string No The detailed status message, including for alerts and error messages.
time string No The time of the status.

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
Custom Script extension on a Ubuntu VM

Deploy to Azure
This template creates a Ubuntu VM and installs the CustomScript extension
Use script extensions to install Mongo DB on Ubuntu VM

Deploy to Azure
This template deploys Configures and Installs Mongo DB on a Ubuntu Virtual Machine in two separate scripts. This template is a good example that showcases how to express dependencies between two scripts running on the same virtual machine. This template also deploys a Storage Account, Virtual Network, Public IP addresses and a Network Interface.
Deploy a Ubuntu VM with the OMS extension

Deploy to Azure
This template allows you to deploy a Ubuntu VM with the OMS extension installed and onboarded to a specified workspace
Deploy a Windows VM with the OMS extension

Deploy to Azure
This template allows you to deploy a Windows VM with the OMS extension installed and onboarded to a specified workspace
OS Patching extension on a Ubuntu VM

Deploy to Azure
This template creates a Ubuntu VM and installs the OSPathing extension
Deploy a Premium Windows VM

Deploy to Azure
This template allows you to deploy a Premium Windows VM using a few different options for the Windows version, using the latest patched version.
Deploy a simple Windows VM with monitoring and diagnostics

Deploy to Azure
This template allows you to deploy a simple Windows VM along with the diagnostics extension which enables monitoring and diagnostics for the VM
Create a Windows VM with Anti-Malware extension enabled

Deploy to Azure
This template creates a Windows VM and sets up the Anti-Malware protection
Configure a VM via DSC extension and Azure Automation DSC

Deploy to Azure
This template configures an existing Virtual Machine Local Configuration Manager (LCM) via the DSC extension, registering it to an existing Azure Automation Account and Azure Automation DSC Pull Server. NOTE: The DSC configuration module requires three specific Azure Automation DSC parameters: Registration Key, Registration URL, and Configuration Function. These prerequisites are available only after successful creation and configuration of an Azure Automation Account for Azure Automation DSC.
IIS Server using DSC extension on a Windows VM

Deploy to Azure
This template creates a Windows VM and sets up an IIS server using the DSC extension. NOTE: The DSC configuration module needs a SAS token to be passed in if you're using Azure Storage. For DSC module link from Github (default in this template), this is not needed.
ESET VM Extension

Deploy to Azure
Creates a VM with ESET extension
McAfee Endpoint Security (trial license) on Windows VM

Deploy to Azure
This template creates a Windows VM and sets up a trial version of McAfee Endpoint Security
Symantec Endpoint Protection extension trial on Windows VM

Deploy to Azure
This template creates a Windows VM and sets up a trial version of Symantec Endpoint Protection