Virtual Machines - Create Or Update

The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation.

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}?api-version=2020-12-01

URI Parameters

Name In Required Type Description
resourceGroupName
path True
  • string

The name of the resource group.

subscriptionId
path True
  • string

Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

vmName
path True
  • string

The name of the virtual machine.

api-version
query True
  • string

Client Api Version.

Request Body

Name Required Type Description
location True
  • string

Resource location

extendedLocation

The extended location of the Virtual Machine.

identity

The identity of the virtual machine, if configured.

plan

Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click Want to deploy programmatically, Get Started ->. Enter any required information and then click Save.

properties.additionalCapabilities

Specifies additional capabilities enabled or disabled on the virtual machine.

properties.availabilitySet

Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see Manage the availability of virtual machines.

For more information on Azure planned maintenance, see Planned maintenance for virtual machines in Azure

Currently, a VM can only be added to availability set at creation time. The availability set to which the VM is being added should be under the same resource group as the availability set resource. An existing VM cannot be added to an availability set.

This property cannot exist along with a non-null properties.virtualMachineScaleSet reference.

properties.billingProfile

Specifies the billing related details of a Azure Spot virtual machine.

Minimum api-version: 2019-03-01.

properties.diagnosticsProfile

Specifies the boot diagnostic settings state.

Minimum api-version: 2015-06-15.

properties.evictionPolicy

Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set.

For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01.

For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview.

properties.extensionsTimeBudget
  • string

Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default value is 90 minutes (PT1H30M).

Minimum api-version: 2020-06-01

properties.hardwareProfile

Specifies the hardware settings for the virtual machine.

properties.host

Specifies information about the dedicated host that the virtual machine resides in.

Minimum api-version: 2018-10-01.

properties.hostGroup

Specifies information about the dedicated host group that the virtual machine resides in.

Minimum api-version: 2020-06-01.

NOTE: User cannot specify both host and hostGroup properties.

properties.licenseType
  • string

Specifies that the image or disk that is being used was licensed on-premises.

Possible values for Windows Server operating system are:

Windows_Client

Windows_Server

Possible values for Linux Server operating system are:

RHEL_BYOS (for RHEL)

SLES_BYOS (for SUSE)

For more information, see Azure Hybrid Use Benefit for Windows Server

Azure Hybrid Use Benefit for Linux Server

Minimum api-version: 2015-06-15

properties.networkProfile

Specifies the network interfaces of the virtual machine.

properties.osProfile

Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned.

properties.platformFaultDomain
  • integer

Specifies the scale set logical fault domain into which the Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that best maintains balance across available fault domains.

  • This is applicable only if the 'virtualMachineScaleSet' property of this Virtual Machine is set.
  • The Virtual Machine Scale Set that is referenced, must have 'platformFaultDomainCount' > 1.
  • This property cannot be updated once the Virtual Machine is created.
  • Fault domain assignment can be viewed in the Virtual Machine Instance View.

    Minimum api‐version: 2020‐12‐01

  • properties.priority

    Specifies the priority for the virtual machine.

    Minimum api-version: 2019-03-01

    properties.proximityPlacementGroup

    Specifies information about the proximity placement group that the virtual machine should be assigned to.

    Minimum api-version: 2018-04-01.

    properties.securityProfile

    Specifies the Security related profile settings for the virtual machine.

    properties.storageProfile

    Specifies the storage settings for the virtual machine disks.

    properties.virtualMachineScaleSet

    Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing VM cannot be added to a virtual machine scale set.

    This property cannot exist along with a non-null properties.availabilitySet reference.

    Minimum api‐version: 2019‐03‐01

    tags
    • object

    Resource tags

    zones
    • string[]

    The virtual machine zones.

    Responses

    Name Type Description
    200 OK

    OK

    201 Created

    Created

    Security

    azure_auth

    Azure Active Directory OAuth2 Flow

    Type: oauth2
    Flow: implicit
    Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

    Scopes

    Name Description
    user_impersonation impersonate your user account

    Examples

    Create a custom-image vm from an unmanaged generalized os image.
    Create a Linux vm with a patch setting patchMode of AutomaticByPlatform.
    Create a Linux vm with a patch setting patchMode of ImageDefault.
    Create a platform-image vm with unmanaged os and data disks.
    Create a vm from a custom image.
    Create a vm in a Virtual Machine Scale Set with customer assigned platformFaultDomain.
    Create a vm in an availability set.
    Create a vm with a marketplace image plan.
    Create a vm with an extensions time budget.
    Create a vm with boot diagnostics.
    Create a vm with DiskEncryptionSet resource id in the os disk and data disk.
    Create a vm with empty data disks.
    Create a vm with ephemeral os disk provisioning in Cache disk using placement property.
    Create a vm with ephemeral os disk provisioning in Resource disk using placement property.
    Create a vm with ephemeral os disk.
    Create a vm with Host Encryption using encryptionAtHost property.
    Create a vm with managed boot diagnostics.
    Create a vm with password authentication.
    Create a vm with premium storage.
    Create a vm with ssh authentication.
    Create a VM with Uefi Settings of secureBoot and vTPM.
    Create a Windows vm with a patch setting patchMode of AutomaticByOS.
    Create a Windows vm with a patch setting patchMode of AutomaticByPlatform and enableHotpatching set to true.
    Create a Windows vm with a patch setting patchMode of AutomaticByPlatform.
    Create a Windows vm with a patch setting patchMode of Manual.

    Create a custom-image vm from an unmanaged generalized os image.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/{vm-name}?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "storageProfile": {
          "osDisk": {
            "name": "myVMosdisk",
            "image": {
              "uri": "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd"
            },
            "osType": "Windows",
            "createOption": "FromImage",
            "caching": "ReadWrite",
            "vhd": {
              "uri": "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd"
            }
          }
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}"
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "osDisk": {
            "name": "myVMosdisk",
            "image": {
              "uri": "https://{existing-storage-account-name}.blob.core.windows.net/system/Microsoft.Compute/Images/vhds/{existing-generalized-os-image-blob-name}.vhd"
            },
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "osType": "Windows",
            "vhd": {
              "uri": "http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk.vhd"
            }
          },
          "dataDisks": []
        },
        "vmId": "926cd555-a07c-4ff5-b214-4aa4dd09d79b",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "osDisk": {
            "name": "myVMosdisk",
            "image": {
              "uri": "https://{existing-storage-account-name}.blob.core.windows.net/system/Microsoft.Compute/Images/vhds/{existing-generalized-os-image-blob-name}.vhd"
            },
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "osType": "Windows",
            "vhd": {
              "uri": "http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk.vhd"
            }
          },
          "dataDisks": []
        },
        "vmId": "926cd555-a07c-4ff5-b214-4aa4dd09d79b",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Create a Linux vm with a patch setting patchMode of AutomaticByPlatform.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D2s_v3"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "16.04-LTS",
            "publisher": "Canonical",
            "version": "latest",
            "offer": "UbuntuServer"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            },
            "name": "myVMosdisk",
            "createOption": "FromImage"
          }
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}",
          "linuxConfiguration": {
            "provisionVMAgent": true,
            "patchSettings": {
              "patchMode": "AutomaticByPlatform"
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "linuxConfiguration": {
            "provisionVMAgent": true,
            "patchSettings": {
              "patchMode": "AutomaticByPlatform"
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "16.04-LTS",
            "publisher": "Canonical",
            "version": "latest",
            "offer": "UbuntuServer"
          },
          "osDisk": {
            "osType": "Linux",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
        "hardwareProfile": {
          "vmSize": "Standard_D2s_v3"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "linuxConfiguration": {
            "provisionVMAgent": true,
            "patchSettings": {
              "patchMode": "AutomaticByPlatform"
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "16.04-LTS",
            "publisher": "Canonical",
            "version": "latest",
            "offer": "UbuntuServer"
          },
          "osDisk": {
            "osType": "Linux",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
        "hardwareProfile": {
          "vmSize": "Standard_D2s_v3"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Create a Linux vm with a patch setting patchMode of ImageDefault.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D2s_v3"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "16.04-LTS",
            "publisher": "Canonical",
            "version": "latest",
            "offer": "UbuntuServer"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            },
            "name": "myVMosdisk",
            "createOption": "FromImage"
          }
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}",
          "linuxConfiguration": {
            "provisionVMAgent": true,
            "patchSettings": {
              "patchMode": "ImageDefault"
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "linuxConfiguration": {
            "provisionVMAgent": true,
            "patchSettings": {
              "patchMode": "ImageDefault"
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "16.04-LTS",
            "publisher": "Canonical",
            "version": "latest",
            "offer": "UbuntuServer"
          },
          "osDisk": {
            "osType": "Linux",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
        "hardwareProfile": {
          "vmSize": "Standard_D2s_v3"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "linuxConfiguration": {
            "provisionVMAgent": true,
            "patchSettings": {
              "patchMode": "ImageDefault"
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "16.04-LTS",
            "publisher": "Canonical",
            "version": "latest",
            "offer": "UbuntuServer"
          },
          "osDisk": {
            "osType": "Linux",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
        "hardwareProfile": {
          "vmSize": "Standard_D2s_v3"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Create a platform-image vm with unmanaged os and data disks.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/{vm-name}?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D2_v2"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "vhd": {
              "uri": "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd"
            },
            "createOption": "FromImage",
            "name": "myVMosdisk"
          },
          "dataDisks": [
            {
              "diskSizeGB": 1023,
              "createOption": "Empty",
              "lun": 0,
              "vhd": {
                "uri": "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk0.vhd"
              }
            },
            {
              "diskSizeGB": 1023,
              "createOption": "Empty",
              "lun": 1,
              "vhd": {
                "uri": "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk1.vhd"
              }
            }
          ]
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}"
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "vhd": {
              "uri": "http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk.vhd"
            },
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "caching": "ReadWrite"
          },
          "dataDisks": [
            {
              "name": "dataDisk0",
              "diskSizeGB": 1023,
              "createOption": "Empty",
              "caching": "None",
              "vhd": {
                "uri": "http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk0.vhd"
              },
              "lun": 0
            },
            {
              "name": "dataDisk1",
              "diskSizeGB": 1023,
              "createOption": "Empty",
              "caching": "None",
              "vhd": {
                "uri": "http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk1.vhd"
              },
              "lun": 1
            }
          ]
        },
        "vmId": "5230a749-2f68-4830-900b-702182d32e63",
        "hardwareProfile": {
          "vmSize": "Standard_D2_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "vhd": {
              "uri": "http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk.vhd"
            },
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "caching": "ReadWrite"
          },
          "dataDisks": [
            {
              "name": "dataDisk0",
              "diskSizeGB": 1023,
              "createOption": "Empty",
              "caching": "None",
              "vhd": {
                "uri": "http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk0.vhd"
              },
              "lun": 0
            },
            {
              "name": "dataDisk1",
              "diskSizeGB": 1023,
              "createOption": "Empty",
              "caching": "None",
              "vhd": {
                "uri": "http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk1.vhd"
              },
              "lun": 1
            }
          ]
        },
        "vmId": "5230a749-2f68-4830-900b-702182d32e63",
        "hardwareProfile": {
          "vmSize": "Standard_D2_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Create a vm from a custom image.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "storageProfile": {
          "imageReference": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "name": "myVMosdisk",
            "createOption": "FromImage"
          }
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}"
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "linuxConfiguration": {
            "disablePasswordAuthentication": false
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"
          },
          "osDisk": {
            "name": "myVMosdisk",
            "diskSizeGB": 30,
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "osType": "Linux"
          },
          "dataDisks": []
        },
        "vmId": "71aa3d5a-d73d-4970-9182-8580433b2865",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "linuxConfiguration": {
            "disablePasswordAuthentication": false
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"
          },
          "osDisk": {
            "name": "myVMosdisk",
            "diskSizeGB": 30,
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "osType": "Linux"
          },
          "dataDisks": []
        },
        "vmId": "71aa3d5a-d73d-4970-9182-8580433b2865",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Create a vm in a Virtual Machine Scale Set with customer assigned platformFaultDomain.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "name": "myVMosdisk",
            "createOption": "FromImage"
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}"
        },
        "virtualMachineScaleSet": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{existing-flex-vmss-name-with-platformFaultDomainCount-greater-than-1}"
        },
        "platformFaultDomain": 1
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "7cce54f2-ecd3-4ddd-a8d9-50984faa3918",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "virtualMachineScaleSet": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myExistingFlexVmss"
        },
        "platformFaultDomain": 1,
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "7cce54f2-ecd3-4ddd-a8d9-50984faa3918",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "virtualMachineScaleSet": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myExistingFlexVmss"
        },
        "platformFaultDomain": 1,
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Create a vm in an availability set.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "name": "myVMosdisk",
            "createOption": "FromImage"
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}"
        },
        "availabilitySet": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/{existing-availability-set-name}"
        }
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "b7a098cc-b0b8-46e8-a205-62f301a62a8f",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "availabilitySet": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/NSGEXISTINGAS"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "b7a098cc-b0b8-46e8-a205-62f301a62a8f",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "availabilitySet": {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/NSGEXISTINGAS"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Create a vm with a marketplace image plan.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "plan": {
        "publisher": "microsoft-ads",
        "product": "windows-data-science-vm",
        "name": "windows2016"
      },
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "windows2016",
            "publisher": "microsoft-ads",
            "version": "latest",
            "offer": "windows-data-science-vm"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "name": "myVMosdisk",
            "createOption": "FromImage"
          }
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}"
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "name": "myVM",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "standard-data-science-vm",
            "publisher": "microsoft-ads",
            "version": "latest",
            "offer": "standard-data-science-vm"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "provisioningState": "Creating"
      },
      "plan": {
        "publisher": "microsoft-ads",
        "product": "standard-data-science-vm",
        "name": "standard-data-science-vm"
      },
      "type": "Microsoft.Compute/virtualMachines",
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "location": "westus"
    }
    {
      "name": "myVM",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "standard-data-science-vm",
            "publisher": "microsoft-ads",
            "version": "latest",
            "offer": "standard-data-science-vm"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "provisioningState": "Creating"
      },
      "plan": {
        "publisher": "microsoft-ads",
        "product": "standard-data-science-vm",
        "name": "standard-data-science-vm"
      },
      "type": "Microsoft.Compute/virtualMachines",
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "location": "westus"
    }

    Create a vm with an extensions time budget.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "name": "myVMosdisk",
            "createOption": "FromImage"
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}"
        },
        "diagnosticsProfile": {
          "bootDiagnostics": {
            "storageUri": "http://{existing-storage-account-name}.blob.core.windows.net",
            "enabled": true
          }
        },
        "extensionsTimeBudget": "PT30M"
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          },
          "dataDisks": []
        },
        "diagnosticsProfile": {
          "bootDiagnostics": {
            "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
            "enabled": true
          }
        },
        "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "extensionsTimeBudget": "PT30M",
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          },
          "dataDisks": []
        },
        "diagnosticsProfile": {
          "bootDiagnostics": {
            "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
            "enabled": true
          }
        },
        "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "extensionsTimeBudget": "PT30M",
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Create a vm with boot diagnostics.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "name": "myVMosdisk",
            "createOption": "FromImage"
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}"
        },
        "diagnosticsProfile": {
          "bootDiagnostics": {
            "storageUri": "http://{existing-storage-account-name}.blob.core.windows.net",
            "enabled": true
          }
        }
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          },
          "dataDisks": []
        },
        "diagnosticsProfile": {
          "bootDiagnostics": {
            "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
            "enabled": true
          }
        },
        "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          },
          "dataDisks": []
        },
        "diagnosticsProfile": {
          "bootDiagnostics": {
            "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
            "enabled": true
          }
        },
        "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Create a vm with DiskEncryptionSet resource id in the os disk and data disk.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "storageProfile": {
          "imageReference": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Standard_LRS",
              "diskEncryptionSet": {
                "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
              }
            },
            "name": "myVMosdisk",
            "createOption": "FromImage"
          },
          "dataDisks": [
            {
              "caching": "ReadWrite",
              "managedDisk": {
                "storageAccountType": "Standard_LRS",
                "diskEncryptionSet": {
                  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
                }
              },
              "diskSizeGB": 1023,
              "createOption": "Empty",
              "lun": 0
            },
            {
              "caching": "ReadWrite",
              "managedDisk": {
                "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}",
                "storageAccountType": "Standard_LRS",
                "diskEncryptionSet": {
                  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
                }
              },
              "diskSizeGB": 1023,
              "createOption": "Attach",
              "lun": 1
            }
          ]
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}"
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "linuxConfiguration": {
            "disablePasswordAuthentication": false
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"
          },
          "osDisk": {
            "name": "myVMosdisk",
            "diskSizeGB": 30,
            "managedDisk": {
              "storageAccountType": "Standard_LRS",
              "diskEncryptionSet": {
                "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskencryptionset-name}"
              }
            },
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "osType": "Linux"
          },
          "dataDisks": [
            {
              "caching": "ReadWrite",
              "managedDisk": {
                "storageAccountType": "Standard_LRS",
                "diskEncryptionSet": {
                  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
                }
              },
              "diskSizeGB": 1023,
              "createOption": "Empty",
              "lun": 0
            },
            {
              "caching": "ReadWrite",
              "managedDisk": {
                "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}",
                "storageAccountType": "Standard_LRS",
                "diskEncryptionSet": {
                  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
                }
              },
              "diskSizeGB": 1023,
              "createOption": "Attach",
              "lun": 1
            }
          ]
        },
        "vmId": "71aa3d5a-d73d-4970-9182-8580433b2865",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "linuxConfiguration": {
            "disablePasswordAuthentication": false
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"
          },
          "osDisk": {
            "name": "myVMosdisk",
            "diskSizeGB": 30,
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "osType": "Linux"
          },
          "dataDisks": [
            {
              "caching": "ReadWrite",
              "managedDisk": {
                "storageAccountType": "Standard_LRS",
                "diskEncryptionSet": {
                  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
                }
              },
              "diskSizeGB": 1023,
              "createOption": "Empty",
              "lun": 0
            },
            {
              "caching": "ReadWrite",
              "managedDisk": {
                "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}",
                "storageAccountType": "Standard_LRS",
                "diskEncryptionSet": {
                  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
                }
              },
              "diskSizeGB": 1023,
              "createOption": "Attach",
              "lun": 1
            }
          ]
        },
        "vmId": "71aa3d5a-d73d-4970-9182-8580433b2865",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Create a vm with empty data disks.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D2_v2"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "name": "myVMosdisk",
            "createOption": "FromImage"
          },
          "dataDisks": [
            {
              "diskSizeGB": 1023,
              "createOption": "Empty",
              "lun": 0
            },
            {
              "diskSizeGB": 1023,
              "createOption": "Empty",
              "lun": 1
            }
          ]
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}"
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          },
          "dataDisks": [
            {
              "caching": "None",
              "managedDisk": {
                "storageAccountType": "Standard_LRS"
              },
              "createOption": "Empty",
              "lun": 0,
              "diskSizeGB": 1023
            },
            {
              "caching": "None",
              "managedDisk": {
                "storageAccountType": "Standard_LRS"
              },
              "createOption": "Empty",
              "lun": 1,
              "diskSizeGB": 1023
            }
          ]
        },
        "vmId": "3906fef9-a1e5-4b83-a8a8-540858b41df0",
        "hardwareProfile": {
          "vmSize": "Standard_D2_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          },
          "dataDisks": [
            {
              "caching": "None",
              "managedDisk": {
                "storageAccountType": "Standard_LRS"
              },
              "createOption": "Empty",
              "lun": 0,
              "diskSizeGB": 1023,
              "toBeDetached": false
            },
            {
              "caching": "None",
              "managedDisk": {
                "storageAccountType": "Standard_LRS"
              },
              "createOption": "Empty",
              "lun": 1,
              "diskSizeGB": 1023,
              "toBeDetached": false
            }
          ]
        },
        "vmId": "3906fef9-a1e5-4b83-a8a8-540858b41df0",
        "hardwareProfile": {
          "vmSize": "Standard_D2_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Create a vm with ephemeral os disk provisioning in Cache disk using placement property.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "plan": {
        "publisher": "microsoft-ads",
        "product": "windows-data-science-vm",
        "name": "windows2016"
      },
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "windows2016",
            "publisher": "microsoft-ads",
            "version": "latest",
            "offer": "windows-data-science-vm"
          },
          "osDisk": {
            "caching": "ReadOnly",
            "diffDiskSettings": {
              "option": "Local",
              "placement": "CacheDisk"
            },
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "FromImage",
            "name": "myVMosdisk"
          }
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}"
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "name": "myVM",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "standard-data-science-vm",
            "publisher": "microsoft-ads",
            "version": "latest",
            "offer": "standard-data-science-vm"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadOnly",
            "diffDiskSettings": {
              "option": "Local",
              "placement": "CacheDisk"
            },
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "FromImage",
            "name": "myVMosdisk"
          },
          "dataDisks": []
        },
        "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "provisioningState": "Creating"
      },
      "plan": {
        "publisher": "microsoft-ads",
        "product": "standard-data-science-vm",
        "name": "standard-data-science-vm"
      },
      "type": "Microsoft.Compute/virtualMachines",
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "location": "westus"
    }
    {
      "name": "myVM",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "standard-data-science-vm",
            "publisher": "microsoft-ads",
            "version": "latest",
            "offer": "standard-data-science-vm"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadOnly",
            "diffDiskSettings": {
              "option": "Local",
              "placement": "CacheDisk"
            },
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "FromImage",
            "name": "myVMosdisk"
          },
          "dataDisks": []
        },
        "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "provisioningState": "Creating"
      },
      "plan": {
        "publisher": "microsoft-ads",
        "product": "standard-data-science-vm",
        "name": "standard-data-science-vm"
      },
      "type": "Microsoft.Compute/virtualMachines",
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "location": "westus"
    }

    Create a vm with ephemeral os disk provisioning in Resource disk using placement property.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "plan": {
        "publisher": "microsoft-ads",
        "product": "windows-data-science-vm",
        "name": "windows2016"
      },
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "windows2016",
            "publisher": "microsoft-ads",
            "version": "latest",
            "offer": "windows-data-science-vm"
          },
          "osDisk": {
            "caching": "ReadOnly",
            "diffDiskSettings": {
              "option": "Local",
              "placement": "ResourceDisk"
            },
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "FromImage",
            "name": "myVMosdisk"
          }
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}"
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "name": "myVM",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "standard-data-science-vm",
            "publisher": "microsoft-ads",
            "version": "latest",
            "offer": "standard-data-science-vm"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadOnly",
            "diffDiskSettings": {
              "option": "Local",
              "placement": "ResourceDisk"
            },
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "FromImage",
            "name": "myVMosdisk"
          },
          "dataDisks": []
        },
        "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "provisioningState": "Creating"
      },
      "plan": {
        "publisher": "microsoft-ads",
        "product": "standard-data-science-vm",
        "name": "standard-data-science-vm"
      },
      "type": "Microsoft.Compute/virtualMachines",
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "location": "westus"
    }
    {
      "name": "myVM",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "standard-data-science-vm",
            "publisher": "microsoft-ads",
            "version": "latest",
            "offer": "standard-data-science-vm"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadOnly",
            "diffDiskSettings": {
              "option": "Local",
              "placement": "ResourceDisk"
            },
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "FromImage",
            "name": "myVMosdisk"
          },
          "dataDisks": []
        },
        "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "provisioningState": "Creating"
      },
      "plan": {
        "publisher": "microsoft-ads",
        "product": "standard-data-science-vm",
        "name": "standard-data-science-vm"
      },
      "type": "Microsoft.Compute/virtualMachines",
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "location": "westus"
    }

    Create a vm with ephemeral os disk.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "plan": {
        "publisher": "microsoft-ads",
        "product": "windows-data-science-vm",
        "name": "windows2016"
      },
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "windows2016",
            "publisher": "microsoft-ads",
            "version": "latest",
            "offer": "windows-data-science-vm"
          },
          "osDisk": {
            "caching": "ReadOnly",
            "diffDiskSettings": {
              "option": "Local"
            },
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "FromImage",
            "name": "myVMosdisk"
          }
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}"
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "name": "myVM",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "standard-data-science-vm",
            "publisher": "microsoft-ads",
            "version": "latest",
            "offer": "standard-data-science-vm"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadOnly",
            "diffDiskSettings": {
              "option": "Local"
            },
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "FromImage",
            "name": "myVMosdisk"
          },
          "dataDisks": []
        },
        "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "provisioningState": "Creating"
      },
      "plan": {
        "publisher": "microsoft-ads",
        "product": "standard-data-science-vm",
        "name": "standard-data-science-vm"
      },
      "type": "Microsoft.Compute/virtualMachines",
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "location": "westus"
    }
    {
      "name": "myVM",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "standard-data-science-vm",
            "publisher": "microsoft-ads",
            "version": "latest",
            "offer": "standard-data-science-vm"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadOnly",
            "diffDiskSettings": {
              "option": "Local"
            },
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "FromImage",
            "name": "myVMosdisk"
          },
          "dataDisks": []
        },
        "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "provisioningState": "Creating"
      },
      "plan": {
        "publisher": "microsoft-ads",
        "product": "standard-data-science-vm",
        "name": "standard-data-science-vm"
      },
      "type": "Microsoft.Compute/virtualMachines",
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "location": "westus"
    }

    Create a vm with Host Encryption using encryptionAtHost property.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "plan": {
        "publisher": "microsoft-ads",
        "product": "windows-data-science-vm",
        "name": "windows2016"
      },
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "securityProfile": {
          "encryptionAtHost": true
        },
        "storageProfile": {
          "imageReference": {
            "sku": "windows2016",
            "publisher": "microsoft-ads",
            "version": "latest",
            "offer": "windows-data-science-vm"
          },
          "osDisk": {
            "caching": "ReadOnly",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "FromImage",
            "name": "myVMosdisk"
          }
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}"
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "name": "myVM",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "standard-data-science-vm",
            "publisher": "microsoft-ads",
            "version": "latest",
            "offer": "standard-data-science-vm"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadOnly",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "FromImage",
            "name": "myVMosdisk"
          },
          "dataDisks": []
        },
        "securityProfile": {
          "encryptionAtHost": true
        },
        "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "provisioningState": "Creating"
      },
      "plan": {
        "publisher": "microsoft-ads",
        "product": "standard-data-science-vm",
        "name": "standard-data-science-vm"
      },
      "type": "Microsoft.Compute/virtualMachines",
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "location": "westus"
    }
    {
      "name": "myVM",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "standard-data-science-vm",
            "publisher": "microsoft-ads",
            "version": "latest",
            "offer": "standard-data-science-vm"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadOnly",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "createOption": "FromImage",
            "name": "myVMosdisk"
          },
          "dataDisks": []
        },
        "securityProfile": {
          "encryptionAtHost": true
        },
        "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "provisioningState": "Creating"
      },
      "plan": {
        "publisher": "microsoft-ads",
        "product": "standard-data-science-vm",
        "name": "standard-data-science-vm"
      },
      "type": "Microsoft.Compute/virtualMachines",
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "location": "westus"
    }

    Create a vm with managed boot diagnostics.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "name": "myVMosdisk",
            "createOption": "FromImage"
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}"
        },
        "diagnosticsProfile": {
          "bootDiagnostics": {
            "enabled": true
          }
        }
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          },
          "dataDisks": []
        },
        "diagnosticsProfile": {
          "bootDiagnostics": {
            "enabled": true
          }
        },
        "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          },
          "dataDisks": []
        },
        "diagnosticsProfile": {
          "bootDiagnostics": {
            "enabled": true
          }
        },
        "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Create a vm with password authentication.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "name": "myVMosdisk",
            "createOption": "FromImage"
          }
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}"
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "b248db33-62ba-4d2d-b791-811e075ee0f5",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "b248db33-62ba-4d2d-b791-811e075ee0f5",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Create a vm with premium storage.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            },
            "name": "myVMosdisk",
            "createOption": "FromImage"
          }
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}"
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Create a vm with ssh authentication.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "{image_sku}",
            "publisher": "{image_publisher}",
            "version": "latest",
            "offer": "{image_offer}"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            },
            "name": "myVMosdisk",
            "createOption": "FromImage"
          }
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "linuxConfiguration": {
            "ssh": {
              "publicKeys": [
                {
                  "path": "/home/{your-username}/.ssh/authorized_keys",
                  "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"
                }
              ]
            },
            "disablePasswordAuthentication": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "linuxConfiguration": {
            "ssh": {
              "publicKeys": [
                {
                  "path": "/home/{your-username}/.ssh/authorized_keys",
                  "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"
                }
              ]
            },
            "disablePasswordAuthentication": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "16.04-LTS",
            "publisher": "Canonical",
            "version": "latest",
            "offer": "UbuntuServer"
          },
          "osDisk": {
            "osType": "Linux",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "e0de9b84-a506-4b95-9623-00a425d05c90",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "linuxConfiguration": {
            "ssh": {
              "publicKeys": [
                {
                  "path": "/home/{your-username}/.ssh/authorized_keys",
                  "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"
                }
              ]
            },
            "disablePasswordAuthentication": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "16.04-LTS",
            "publisher": "Canonical",
            "version": "latest",
            "offer": "UbuntuServer"
          },
          "osDisk": {
            "osType": "Linux",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Standard_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "e0de9b84-a506-4b95-9623-00a425d05c90",
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Create a VM with Uefi Settings of secureBoot and vTPM.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D2s_v3"
        },
        "securityProfile": {
          "uefiSettings": {
            "secureBootEnabled": true,
            "vTpmEnabled": true
          },
          "securityType": "TrustedLaunch"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "windows10-tvm",
            "publisher": "MicrosoftWindowsServer",
            "version": "18363.592.2001092016",
            "offer": "windowsserver-gen2preview-preview"
          },
          "osDisk": {
            "caching": "ReadOnly",
            "managedDisk": {
              "storageAccountType": "StandardSSD_LRS"
            },
            "createOption": "FromImage",
            "name": "myVMosdisk"
          }
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}"
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "name": "myVM",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "windows10-tvm",
            "publisher": "MicrosoftWindowsServer",
            "version": "18363.592.2001092016",
            "offer": "windowsserver-gen2preview-preview"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadOnly",
            "managedDisk": {
              "storageAccountType": "StandardSSD_LRS"
            },
            "createOption": "FromImage",
            "name": "myVMosdisk"
          },
          "dataDisks": []
        },
        "securityProfile": {
          "uefiSettings": {
            "secureBootEnabled": true,
            "vTpmEnabled": true
          },
          "securityType": "TrustedLaunch"
        },
        "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
        "hardwareProfile": {
          "vmSize": "Standard_D2s_v3"
        },
        "provisioningState": "Creating"
      },
      "type": "Microsoft.Compute/virtualMachines",
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "location": "westus"
    }
    {
      "name": "myVM",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "windows10-tvm",
            "publisher": "MicrosoftWindowsServer",
            "version": "18363.592.2001092016",
            "offer": "windowsserver-gen2preview-preview"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadOnly",
            "managedDisk": {
              "storageAccountType": "StandardSSD_LRS"
            },
            "createOption": "FromImage",
            "name": "myVMosdisk"
          },
          "dataDisks": []
        },
        "securityProfile": {
          "uefiSettings": {
            "secureBootEnabled": true,
            "vTpmEnabled": true
          },
          "securityType": "TrustedLaunch"
        },
        "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
        "hardwareProfile": {
          "vmSize": "Standard_D2s_v3"
        },
        "provisioningState": "Creating"
      },
      "type": "Microsoft.Compute/virtualMachines",
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "location": "westus"
    }

    Create a Windows vm with a patch setting patchMode of AutomaticByOS.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            },
            "name": "myVMosdisk",
            "createOption": "FromImage"
          }
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true,
            "patchSettings": {
              "patchMode": "AutomaticByOS"
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true,
            "patchSettings": {
              "patchMode": "AutomaticByOS"
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true,
            "patchSettings": {
              "patchMode": "AutomaticByOS"
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Create a Windows vm with a patch setting patchMode of AutomaticByPlatform and enableHotpatching set to true.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            },
            "name": "myVMosdisk",
            "createOption": "FromImage"
          }
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true,
            "patchSettings": {
              "patchMode": "AutomaticByPlatform",
              "enableHotpatching": true
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true,
            "patchSettings": {
              "patchMode": "AutomaticByPlatform",
              "enableHotpatching": true
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true,
            "patchSettings": {
              "patchMode": "AutomaticByPlatform",
              "enableHotpatching": true
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Create a Windows vm with a patch setting patchMode of AutomaticByPlatform.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            },
            "name": "myVMosdisk",
            "createOption": "FromImage"
          }
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true,
            "patchSettings": {
              "patchMode": "AutomaticByPlatform"
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true,
            "patchSettings": {
              "patchMode": "AutomaticByPlatform"
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true,
            "patchSettings": {
              "patchMode": "AutomaticByPlatform"
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Create a Windows vm with a patch setting patchMode of Manual.

    Sample Request

    PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2020-12-01
    {
      "location": "westus",
      "properties": {
        "hardwareProfile": {
          "vmSize": "Standard_D1_v2"
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "caching": "ReadWrite",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            },
            "name": "myVMosdisk",
            "createOption": "FromImage"
          }
        },
        "osProfile": {
          "adminUsername": "{your-username}",
          "computerName": "myVM",
          "adminPassword": "{your-password}",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true,
            "patchSettings": {
              "patchMode": "Manual"
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
              "properties": {
                "primary": true
              }
            }
          ]
        }
      }
    }

    Sample Response

    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": true,
            "patchSettings": {
              "patchMode": "Manual"
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }
    {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
      "type": "Microsoft.Compute/virtualMachines",
      "properties": {
        "osProfile": {
          "adminUsername": "{your-username}",
          "secrets": [],
          "computerName": "myVM",
          "windowsConfiguration": {
            "provisionVMAgent": true,
            "enableAutomaticUpdates": false,
            "patchSettings": {
              "patchMode": "Manual"
            }
          }
        },
        "networkProfile": {
          "networkInterfaces": [
            {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
              "properties": {
                "primary": true
              }
            }
          ]
        },
        "storageProfile": {
          "imageReference": {
            "sku": "2016-Datacenter",
            "publisher": "MicrosoftWindowsServer",
            "version": "latest",
            "offer": "WindowsServer"
          },
          "osDisk": {
            "osType": "Windows",
            "caching": "ReadWrite",
            "createOption": "FromImage",
            "name": "myVMosdisk",
            "managedDisk": {
              "storageAccountType": "Premium_LRS"
            }
          },
          "dataDisks": []
        },
        "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
        "hardwareProfile": {
          "vmSize": "Standard_DS1_v2"
        },
        "provisioningState": "Creating"
      },
      "name": "myVM",
      "location": "westus"
    }

    Definitions

    AdditionalCapabilities

    Enables or disables a capability on the virtual machine or virtual machine scale set.

    AdditionalUnattendContent

    Specifies additional XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, and the pass in which the content is applied.

    ApiError

    Api error.

    ApiErrorBase

    Api error base.

    AvailablePatchSummary

    Describes the properties of an virtual machine instance view for available patch summary.

    BillingProfile

    Specifies the billing related details of a Azure Spot VM or VMSS.

    Minimum api-version: 2019-03-01.

    BootDiagnostics

    Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

    You can easily view the output of your console log.

    Azure also enables you to see a screenshot of the VM from the hypervisor.

    BootDiagnosticsInstanceView

    The instance view of a virtual machine boot diagnostics.

    CachingTypes

    Specifies the caching requirements.

    Possible values are:

    None

    ReadOnly

    ReadWrite

    Default: None for Standard storage. ReadOnly for Premium storage.

    ComponentNames

    The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup.

    DataDisk

    Describes a data disk.

    DiagnosticsProfile

    Specifies the boot diagnostic settings state.

    Minimum api-version: 2015-06-15.

    DiffDiskOptions

    Specifies the ephemeral disk settings for operating system disk.

    DiffDiskPlacement

    Specifies the ephemeral disk placement for operating system disk. This property can be used by user in the request to choose the location i.e, cache disk or resource disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer Ephemeral OS disk size requirements for Windows VM at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VM at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements

    DiffDiskSettings

    Describes the parameters of ephemeral disk settings that can be specified for operating system disk.

    NOTE: The ephemeral disk settings can only be specified for managed disk.

    DiskCreateOptionTypes

    Specifies how the virtual machine should be created.

    Possible values are:

    Attach \u2013 This value is used when you are using a specialized disk to create the virtual machine.

    FromImage \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described.

    DiskDetachOptionTypes

    Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: ForceDetach.

    detachOption: ForceDetach is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior.

    This feature is still in preview mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'.

    DiskEncryptionSetParameters

    Describes the parameter of customer managed disk encryption set resource id that can be specified for disk.

    NOTE: The disk encryption set resource id can only be specified for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details.

    DiskEncryptionSettings

    Describes a Encryption Settings for a Disk

    DiskInstanceView

    The instance view of the disk.

    ExtendedLocation

    The complex type of the extended location.

    ExtendedLocationTypes

    The type of the extended location.

    HardwareProfile

    Specifies the hardware settings for the virtual machine.

    HyperVGenerationType

    Specifies the HyperVGeneration Type

    ImageReference

    Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. NOTE: Image reference publisher and offer can only be set when you create the scale set.

    InnerError

    Inner error details.

    InstanceViewStatus

    Instance view status.

    KeyVaultKeyReference

    Describes a reference to Key Vault Key

    KeyVaultSecretReference

    Describes a reference to Key Vault Secret

    LastPatchInstallationSummary

    Describes the properties of the last installed patch summary.

    LinuxConfiguration

    Specifies the Linux operating system settings on the virtual machine.

    For a list of supported Linux distributions, see Linux on Azure-Endorsed Distributions

    For running non-endorsed distributions, see Information for Non-Endorsed Distributions.

    LinuxPatchSettings

    Specifies settings related to VM Guest Patching on Linux.

    LinuxVMGuestPatchMode

    Specifies the mode of VM Guest Patching to IaaS virtual machine.

    Possible values are:

    ImageDefault - The virtual machine's default patching configuration is used.

    AutomaticByPlatform - The virtual machine will be automatically updated by the platform. The property provisionVMAgent must be true

    MaintenanceOperationResultCodeTypes

    The Last Maintenance Operation Result Code.

    MaintenanceRedeployStatus

    Maintenance Operation Status.

    ManagedDiskParameters

    The parameters of a managed disk.

    NetworkInterfaceReference

    Describes a network interface reference.

    NetworkProfile

    Specifies the network interfaces of the virtual machine.

    OperatingSystemTypes

    The operating system of the osDiskImage.

    OSDisk

    Specifies information about the operating system disk used by the virtual machine.

    For more information about disks, see About disks and VHDs for Azure virtual machines.

    OSProfile

    Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once VM is provisioned.

    PassNames

    The pass name. Currently, the only allowable value is OobeSystem.

    PatchOperationStatus

    The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings."

    PatchSettings

    Specifies settings related to VM Guest Patching on Windows.

    Plan

    Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click Want to deploy programmatically, Get Started ->. Enter any required information and then click Save.

    ProtocolTypes

    Specifies the protocol of WinRM listener.

    Possible values are:
    http

    https

    ResourceIdentityType

    The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine.

    SecurityProfile

    Specifies the Security profile settings for the virtual machine or virtual machine scale set.

    SecurityTypes

    Specifies the SecurityType of the virtual machine. It is set as TrustedLaunch to enable UefiSettings.

    Default: UefiSettings will not be enabled unless this property is set as TrustedLaunch.

    SettingNames

    Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon.

    SshConfiguration

    SSH configuration for Linux based VMs running on Azure

    SshPublicKey

    Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed.

    StatusLevelTypes

    The level code.

    StorageAccountTypes

    Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk.

    StorageProfile

    Specifies the storage settings for the virtual machine disks.

    SubResource
    UefiSettings

    Specifies the security settings like secure boot and vTPM used while creating the virtual machine.

    Minimum api-version: 2020-12-01

    UserAssignedIdentities

    The list of user identities associated with the Virtual Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.

    VaultCertificate

    Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM.

    VaultSecretGroup

    Describes a set of certificates which are all in the same Key Vault.

    VirtualHardDisk

    Describes the uri of a disk.

    VirtualMachine

    Describes a Virtual Machine.

    VirtualMachineAgentInstanceView

    The instance view of the VM Agent running on the virtual machine.

    VirtualMachineEvictionPolicyTypes

    Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set.

    For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01.

    For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview.

    VirtualMachineExtension

    Describes a Virtual Machine Extension.

    VirtualMachineExtensionHandlerInstanceView

    The instance view of a virtual machine extension handler.

    VirtualMachineExtensionInstanceView

    The instance view of a virtual machine extension.

    VirtualMachineHealthStatus

    The health status of the VM.

    VirtualMachineIdentity

    Identity for the virtual machine.

    VirtualMachineInstanceView

    The instance view of a virtual machine.

    VirtualMachinePatchStatus

    The status of virtual machine patch operations.

    VirtualMachinePriorityTypes

    Specifies the priority for the virtual machine.

    Minimum api-version: 2019-03-01

    VirtualMachineSizeTypes

    Specifies the size of the virtual machine.

    The enum data type is currently deprecated and will be removed by December 23rd 2023.

    Recommended way to get the list of available sizes is using these APIs:

    List all available virtual machine sizes in an availability set

    List all available virtual machine sizes in a region

    List all available virtual machine sizes for resizing. For more information about virtual machine sizes, see Sizes for virtual machines.

    The available VM sizes depend on region and availability set.

    WindowsConfiguration

    Specifies Windows operating system settings on the virtual machine.

    WindowsVMGuestPatchMode

    Specifies the mode of VM Guest Patching to IaaS virtual machine.

    Possible values are:

    Manual - You control the application of patches to a virtual machine. You do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates must be false

    AutomaticByOS - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be true.

    AutomaticByPlatform - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true

    WinRMConfiguration

    Describes Windows Remote Management configuration of the VM

    WinRMListener

    Describes Protocol and thumbprint of Windows Remote Management listener

    AdditionalCapabilities

    Enables or disables a capability on the virtual machine or virtual machine scale set.

    Name Type Description
    ultraSSDEnabled
    • boolean

    The flag that enables or disables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the VM or VMSS. Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled.

    AdditionalUnattendContent

    Specifies additional XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name, and the pass in which the content is applied.

    Name Type Description
    componentName

    The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup.

    content
    • string

    Specifies the XML formatted content that is added to the unattend.xml file for the specified path and component. The XML must be less than 4KB and must include the root element for the setting or feature that is being inserted.

    passName

    The pass name. Currently, the only allowable value is OobeSystem.

    settingName

    Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon.

    ApiError

    Api error.

    Name Type Description
    code
    • string

    The error code.

    details

    The Api error details

    innererror

    The Api inner error

    message
    • string

    The error message.

    target
    • string

    The target of the particular error.

    ApiErrorBase

    Api error base.

    Name Type Description
    code
    • string

    The error code.

    message
    • string

    The error message.

    target
    • string

    The target of the particular error.

    AvailablePatchSummary

    Describes the properties of an virtual machine instance view for available patch summary.

    Name Type Description
    assessmentActivityId
    • string

    The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs.

    criticalAndSecurityPatchCount
    • integer

    The number of critical or security patches that have been detected as available and not yet installed.

    error

    The errors that were encountered during execution of the operation. The details array contains the list of them.

    lastModifiedTime
    • string

    The UTC timestamp when the operation began.

    otherPatchCount
    • integer

    The number of all available patches excluding critical and security.

    rebootPending
    • boolean

    The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred.

    startTime
    • string

    The UTC timestamp when the operation began.

    status

    The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings."

    BillingProfile

    Specifies the billing related details of a Azure Spot VM or VMSS.

    Minimum api-version: 2019-03-01.

    Name Type Description
    maxPrice
    • number

    Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars.

    This price will be compared with the current Azure Spot price for the VM size. Also, the prices are compared at the time of create/update of Azure Spot VM/VMSS and the operation will only succeed if the maxPrice is greater than the current Azure Spot price.

    The maxPrice will also be used for evicting a Azure Spot VM/VMSS if the current Azure Spot price goes beyond the maxPrice after creation of VM/VMSS.

    Possible values are:

    - Any decimal value greater than zero. Example: 0.01538

    -1 – indicates default price to be up-to on-demand.

    You can set the maxPrice to -1 to indicate that the Azure Spot VM/VMSS should not be evicted for price reasons. Also, the default max price is -1 if it is not provided by you.

    Minimum api-version: 2019-03-01.

    BootDiagnostics

    Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

    You can easily view the output of your console log.

    Azure also enables you to see a screenshot of the VM from the hypervisor.

    Name Type Description
    enabled
    • boolean

    Whether boot diagnostics should be enabled on the Virtual Machine.

    storageUri
    • string

    Uri of the storage account to use for placing the console output and screenshot.

    If storageUri is not specified while enabling boot diagnostics, managed storage will be used.

    BootDiagnosticsInstanceView

    The instance view of a virtual machine boot diagnostics.

    Name Type Description
    consoleScreenshotBlobUri
    • string

    The console screenshot blob URI.

    NOTE: This will not be set if boot diagnostics is currently enabled with managed storage.

    serialConsoleLogBlobUri
    • string

    The serial console log blob Uri.

    NOTE: This will not be set if boot diagnostics is currently enabled with managed storage.

    status

    The boot diagnostics status information for the VM.

    NOTE: It will be set only if there are errors encountered in enabling boot diagnostics.

    CachingTypes

    Specifies the caching requirements.

    Possible values are:

    None

    ReadOnly

    ReadWrite

    Default: None for Standard storage. ReadOnly for Premium storage.

    Name Type Description
    None
    • string
    ReadOnly
    • string
    ReadWrite
    • string

    ComponentNames

    The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup.

    Name Type Description
    Microsoft-Windows-Shell-Setup
    • string

    DataDisk

    Describes a data disk.

    Name Type Description
    caching

    Specifies the caching requirements.

    Possible values are:

    None

    ReadOnly

    ReadWrite

    Default: None for Standard storage. ReadOnly for Premium storage

    createOption

    Specifies how the virtual machine should be created.

    Possible values are:

    Attach \u2013 This value is used when you are using a specialized disk to create the virtual machine.

    FromImage \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described.

    detachOption

    Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: ForceDetach.

    detachOption: ForceDetach is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior.

    This feature is still in preview mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'.

    diskIOPSReadWrite
    • integer

    Specifies the Read-Write IOPS for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set.

    diskMBpsReadWrite
    • integer

    Specifies the bandwidth in MB per second for the managed disk when StorageAccountType is UltraSSD_LRS. Returned only for VirtualMachine ScaleSet VM disks. Can be updated only via updates to the VirtualMachine Scale Set.

    diskSizeGB
    • integer

    Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

    This value cannot be larger than 1023 GB

    image

    The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.

    lun
    • integer

    Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.

    managedDisk

    The managed disk parameters.

    name
    • string

    The disk name.

    toBeDetached
    • boolean

    Specifies whether the data disk is in process of detachment from the VirtualMachine/VirtualMachineScaleset

    vhd

    The virtual hard disk.

    writeAcceleratorEnabled
    • boolean

    Specifies whether writeAccelerator should be enabled or disabled on the disk.

    DiagnosticsProfile

    Specifies the boot diagnostic settings state.

    Minimum api-version: 2015-06-15.

    Name Type Description
    bootDiagnostics

    Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

    You can easily view the output of your console log.

    Azure also enables you to see a screenshot of the VM from the hypervisor.

    DiffDiskOptions

    Specifies the ephemeral disk settings for operating system disk.

    Name Type Description
    Local
    • string

    DiffDiskPlacement

    Specifies the ephemeral disk placement for operating system disk. This property can be used by user in the request to choose the location i.e, cache disk or resource disk space for Ephemeral OS disk provisioning. For more information on Ephemeral OS disk size requirements, please refer Ephemeral OS disk size requirements for Windows VM at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/ephemeral-os-disks#size-requirements and Linux VM at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/ephemeral-os-disks#size-requirements

    Name Type Description
    CacheDisk
    • string
    ResourceDisk
    • string

    DiffDiskSettings

    Describes the parameters of ephemeral disk settings that can be specified for operating system disk.

    NOTE: The ephemeral disk settings can only be specified for managed disk.

    Name Type Description
    option

    Specifies the ephemeral disk settings for operating system disk.

    placement

    Specifies the ephemeral disk placement for operating system disk.

    Possible values are:

    CacheDisk

    ResourceDisk

    Default: CacheDisk if one is configured for the VM size otherwise ResourceDisk is used.

    Refer to VM size documentation for Windows VM at https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sizes and Linux VM at https://docs.microsoft.com/en-us/azure/virtual-machines/linux/sizes to check which VM sizes exposes a cache disk.

    DiskCreateOptionTypes

    Specifies how the virtual machine should be created.

    Possible values are:

    Attach \u2013 This value is used when you are using a specialized disk to create the virtual machine.

    FromImage \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described.

    Name Type Description
    Attach
    • string
    Empty
    • string
    FromImage
    • string

    DiskDetachOptionTypes

    Specifies the detach behavior to be used while detaching a disk or which is already in the process of detachment from the virtual machine. Supported values: ForceDetach.

    detachOption: ForceDetach is applicable only for managed data disks. If a previous detachment attempt of the data disk did not complete due to an unexpected failure from the virtual machine and the disk is still not released then use force-detach as a last resort option to detach the disk forcibly from the VM. All writes might not have been flushed when using this detach behavior.

    This feature is still in preview mode and is not supported for VirtualMachineScaleSet. To force-detach a data disk update toBeDetached to 'true' along with setting detachOption: 'ForceDetach'.

    Name Type Description
    ForceDetach
    • string

    DiskEncryptionSetParameters

    Describes the parameter of customer managed disk encryption set resource id that can be specified for disk.

    NOTE: The disk encryption set resource id can only be specified for managed disk. Please refer https://aka.ms/mdssewithcmkoverview for more details.

    Name Type Description
    id
    • string

    Resource Id

    DiskEncryptionSettings

    Describes a Encryption Settings for a Disk

    Name Type Description
    diskEncryptionKey

    Specifies the location of the disk encryption key, which is a Key Vault Secret.

    enabled
    • boolean

    Specifies whether disk encryption should be enabled on the virtual machine.

    keyEncryptionKey

    Specifies the location of the key encryption key in Key Vault.

    DiskInstanceView

    The instance view of the disk.

    Name Type Description
    encryptionSettings

    Specifies the encryption settings for the OS Disk.

    Minimum api-version: 2015-06-15

    name
    • string

    The disk name.

    statuses

    The resource status information.

    ExtendedLocation

    The complex type of the extended location.

    Name Type Description
    name
    • string

    The name of the extended location.

    type

    The type of the extended location.

    ExtendedLocationTypes

    The type of the extended location.

    Name Type Description
    EdgeZone
    • string

    HardwareProfile

    Specifies the hardware settings for the virtual machine.

    Name Type Description
    vmSize

    Specifies the size of the virtual machine.

    The enum data type is currently deprecated and will be removed by December 23rd 2023.

    Recommended way to get the list of available sizes is using these APIs:

    List all available virtual machine sizes in an availability set

    List all available virtual machine sizes in a region

    List all available virtual machine sizes for resizing. For more information about virtual machine sizes, see Sizes for virtual machines.

    The available VM sizes depend on region and availability set.

    HyperVGenerationType

    Specifies the HyperVGeneration Type

    Name Type Description
    V1
    • string
    V2
    • string

    ImageReference

    Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. NOTE: Image reference publisher and offer can only be set when you create the scale set.

    Name Type Description
    exactVersion
    • string

    Specifies in decimal numbers, the version of platform image or marketplace image used to create the virtual machine. This readonly field differs from 'version', only if the value specified in 'version' field is 'latest'.

    id
    • string

    Resource Id

    offer
    • string

    Specifies the offer of the platform image or marketplace image used to create the virtual machine.

    publisher
    • string

    The image publisher.

    sku
    • string

    The image SKU.

    version
    • string

    Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available.

    InnerError

    Inner error details.

    Name Type Description
    errordetail
    • string

    The internal error message or exception dump.

    exceptiontype
    • string

    The exception type.

    InstanceViewStatus

    Instance view status.

    Name Type Description
    code
    • string

    The status code.

    displayStatus
    • string

    The short localizable label for the status.

    level

    The level code.

    message
    • string

    The detailed status message, including for alerts and error messages.

    time
    • string

    The time of the status.

    KeyVaultKeyReference

    Describes a reference to Key Vault Key

    Name Type Description
    keyUrl
    • string

    The URL referencing a key encryption key in Key Vault.

    sourceVault

    The relative URL of the Key Vault containing the key.

    KeyVaultSecretReference

    Describes a reference to Key Vault Secret

    Name Type Description
    secretUrl
    • string

    The URL referencing a secret in a Key Vault.

    sourceVault

    The relative URL of the Key Vault containing the secret.

    LastPatchInstallationSummary

    Describes the properties of the last installed patch summary.

    Name Type Description
    error

    The errors that were encountered during execution of the operation. The details array contains the list of them.

    excludedPatchCount
    • integer

    The number of all available patches but excluded explicitly by a customer-specified exclusion list match.

    failedPatchCount
    • integer

    The count of patches that failed installation.

    installationActivityId
    • string

    The activity ID of the operation that produced this result. It is used to correlate across CRP and extension logs.

    installedPatchCount
    • integer

    The count of patches that successfully installed.

    lastModifiedTime
    • string

    The UTC timestamp when the operation began.

    maintenanceWindowExceeded
    • boolean

    Describes whether the operation ran out of time before it completed all its intended actions

    notSelectedPatchCount
    • integer

    The number of all available patches but not going to be installed because it didn't match a classification or inclusion list entry.

    pendingPatchCount
    • integer

    The number of all available patches expected to be installed over the course of the patch installation operation.

    startTime
    • string

    The UTC timestamp when the operation began.

    status

    The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings."

    LinuxConfiguration

    Specifies the Linux operating system settings on the virtual machine.

    For a list of supported Linux distributions, see Linux on Azure-Endorsed Distributions

    For running non-endorsed distributions, see Information for Non-Endorsed Distributions.

    Name Type Description
    disablePasswordAuthentication
    • boolean

    Specifies whether password authentication should be disabled.

    patchSettings

    [Preview Feature] Specifies settings related to VM Guest Patching on Linux.

    provisionVMAgent
    • boolean

    Indicates whether virtual machine agent should be provisioned on the virtual machine.

    When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later.

    ssh

    Specifies the ssh key configuration for a Linux OS.

    LinuxPatchSettings

    Specifies settings related to VM Guest Patching on Linux.

    Name Type Description
    patchMode

    Specifies the mode of VM Guest Patching to IaaS virtual machine.

    Possible values are:

    ImageDefault - The virtual machine's default patching configuration is used.

    AutomaticByPlatform - The virtual machine will be automatically updated by the platform. The property provisionVMAgent must be true

    LinuxVMGuestPatchMode

    Specifies the mode of VM Guest Patching to IaaS virtual machine.

    Possible values are:

    ImageDefault - The virtual machine's default patching configuration is used.

    AutomaticByPlatform - The virtual machine will be automatically updated by the platform. The property provisionVMAgent must be true

    Name Type Description
    AutomaticByPlatform
    • string
    ImageDefault
    • string

    MaintenanceOperationResultCodeTypes

    The Last Maintenance Operation Result Code.

    Name Type Description
    MaintenanceAborted
    • string
    MaintenanceCompleted
    • string
    None
    • string
    RetryLater
    • string

    MaintenanceRedeployStatus

    Maintenance Operation Status.

    Name Type Description
    isCustomerInitiatedMaintenanceAllowed
    • boolean

    True, if customer is allowed to perform Maintenance.

    lastOperationMessage
    • string

    Message returned for the last Maintenance Operation.

    lastOperationResultCode

    The Last Maintenance Operation Result Code.

    maintenanceWindowEndTime
    • string

    End Time for the Maintenance Window.

    maintenanceWindowStartTime
    • string

    Start Time for the Maintenance Window.

    preMaintenanceWindowEndTime
    • string

    End Time for the Pre Maintenance Window.

    preMaintenanceWindowStartTime
    • string

    Start Time for the Pre Maintenance Window.

    ManagedDiskParameters

    The parameters of a managed disk.

    Name Type Description
    diskEncryptionSet

    Specifies the customer managed disk encryption set resource id for the managed disk.

    id
    • string

    Resource Id

    storageAccountType

    Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk.

    NetworkInterfaceReference

    Describes a network interface reference.

    Name Type Description
    id
    • string

    Resource Id

    properties.primary
    • boolean

    Specifies the primary network interface in case the virtual machine has more than 1 network interface.

    NetworkProfile

    Specifies the network interfaces of the virtual machine.

    Name Type Description
    networkInterfaces

    Specifies the list of resource Ids for the network interfaces associated with the virtual machine.

    OperatingSystemTypes

    The operating system of the osDiskImage.

    Name Type Description
    Linux
    • string
    Windows
    • string

    OSDisk

    Specifies information about the operating system disk used by the virtual machine.

    For more information about disks, see About disks and VHDs for Azure virtual machines.

    Name Type Description
    caching

    Specifies the caching requirements.

    Possible values are:

    None

    ReadOnly

    ReadWrite

    Default: None for Standard storage. ReadOnly for Premium storage.

    createOption

    Specifies how the virtual machine should be created.

    Possible values are:

    Attach \u2013 This value is used when you are using a specialized disk to create the virtual machine.

    FromImage \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described.

    diffDiskSettings

    Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine.

    diskSizeGB
    • integer

    Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

    This value cannot be larger than 1023 GB

    encryptionSettings

    Specifies the encryption settings for the OS Disk.

    Minimum api-version: 2015-06-15

    image

    The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.

    managedDisk

    The managed disk parameters.

    name
    • string

    The disk name.

    osType

    This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.

    Possible values are:

    Windows

    Linux

    vhd

    The virtual hard disk.

    writeAcceleratorEnabled
    • boolean

    Specifies whether writeAccelerator should be enabled or disabled on the disk.

    OSProfile

    Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once VM is provisioned.

    Name Type Description
    adminPassword
    • string

    Specifies the password of the administrator account.

    Minimum-length (Windows): 8 characters

    Minimum-length (Linux): 6 characters

    Max-length (Windows): 123 characters

    Max-length (Linux): 72 characters

    Complexity requirements: 3 out of 4 conditions below need to be fulfilled
    Has lower characters
    Has upper characters
    Has a digit
    Has a special character (Regex match [\W_])

    Disallowed values: "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!"

    For resetting the password, see How to reset the Remote Desktop service or its login password in a Windows VM

    For resetting root password, see Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension

    adminUsername
    • string

    Specifies the name of the administrator account.

    This property cannot be updated after the VM is created.

    Windows-only restriction: Cannot end in "."

    Disallowed values: "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".

    Minimum-length (Linux): 1 character

    Max-length (Linux): 64 characters

    Max-length (Windows): 20 characters

  • For root access to the Linux VM, see Using root privileges on Linux virtual machines in Azure
  • For a list of built-in system users on Linux that should not be used in this field, see Selecting User Names for Linux on Azure

  • allowExtensionOperations
    • boolean

    Specifies whether extension operations should be allowed on the virtual machine.

    This may only be set to False when no extensions are present on the virtual machine.

    computerName
    • string

    Specifies the host OS name of the virtual machine.

    This name cannot be updated after the VM is created.

    Max-length (Windows): 15 characters

    Max-length (Linux): 64 characters.

    For naming conventions and restrictions see Azure infrastructure services implementation guidelines.

    customData
    • string

    Specifies a base-64 encoded string of custom data. The base-64 encoded string is decoded to a binary array that is saved as a file on the Virtual Machine. The maximum length of the binary array is 65535 bytes.

    Note: Do not pass any secrets or passwords in customData property

    This property cannot be updated after the VM is created.

    customData is passed to the VM to be saved as a file, for more information see Custom Data on Azure VMs

    For using cloud-init for your Linux VM, see Using cloud-init to customize a Linux VM during creation

    linuxConfiguration

    Specifies the Linux operating system settings on the virtual machine.

    For a list of supported Linux distributions, see Linux on Azure-Endorsed Distributions

    For running non-endorsed distributions, see Information for Non-Endorsed Distributions.

    requireGuestProvisionSignal
    • boolean

    Specifies whether the guest provision signal is required to infer provision success of the virtual machine. Note: This property is for private testing only, and all customers must not set the property to false.

    secrets

    Specifies set of certificates that should be installed onto the virtual machine.

    windowsConfiguration

    Specifies Windows operating system settings on the virtual machine.

    PassNames

    The pass name. Currently, the only allowable value is OobeSystem.

    Name Type Description
    OobeSystem
    • string

    PatchOperationStatus

    The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings."

    Name Type Description
    CompletedWithWarnings
    • string
    Failed
    • string
    InProgress
    • string
    Succeeded
    • string
    Unknown
    • string

    PatchSettings

    Specifies settings related to VM Guest Patching on Windows.

    Name Type Description
    enableHotpatching
    • boolean

    Enables customers to patch their Azure VMs without requiring a reboot. For enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' must be set to 'AutomaticByPlatform'.

    patchMode

    Specifies the mode of VM Guest Patching to IaaS virtual machine.

    Possible values are:

    Manual - You control the application of patches to a virtual machine. You do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates must be false

    AutomaticByOS - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be true.

    AutomaticByPlatform - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true

    Plan

    Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click Want to deploy programmatically, Get Started ->. Enter any required information and then click Save.

    Name Type Description
    name
    • string

    The plan ID.

    product
    • string

    Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element.

    promotionCode
    • string

    The promotion code.

    publisher
    • string

    The publisher ID.

    ProtocolTypes

    Specifies the protocol of WinRM listener.

    Possible values are:
    http

    https

    Name Type Description
    Http
    • string
    Https
    • string

    ResourceIdentityType

    The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine.

    Name Type Description
    None
    • string
    SystemAssigned
    • string
    SystemAssigned, UserAssigned
    • string
    UserAssigned
    • string

    SecurityProfile

    Specifies the Security profile settings for the virtual machine or virtual machine scale set.

    Name Type Description
    encryptionAtHost
    • boolean

    This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine or virtual machine scale set. This will enable the encryption for all the disks including Resource/Temp disk at host itself.

    Default: The Encryption at host will be disabled unless this property is set to true for the resource.

    securityType

    Specifies the SecurityType of the virtual machine. It is set as TrustedLaunch to enable UefiSettings.

    Default: UefiSettings will not be enabled unless this property is set as TrustedLaunch.

    uefiSettings

    Specifies the security settings like secure boot and vTPM used while creating the virtual machine.

    Minimum api-version: 2020-12-01

    SecurityTypes

    Specifies the SecurityType of the virtual machine. It is set as TrustedLaunch to enable UefiSettings.

    Default: UefiSettings will not be enabled unless this property is set as TrustedLaunch.

    Name Type Description
    TrustedLaunch
    • string

    SettingNames

    Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon.

    Name Type Description
    AutoLogon
    • string
    FirstLogonCommands
    • string

    SshConfiguration

    SSH configuration for Linux based VMs running on Azure

    Name Type Description
    publicKeys

    The list of SSH public keys used to authenticate with linux based VMs.

    SshPublicKey

    Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed.

    Name Type Description
    keyData
    • string

    SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format.

    For creating ssh keys, see Create SSH keys on Linux and Mac for Linux VMs in Azure.

    path
    • string

    Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys

    StatusLevelTypes

    The level code.

    Name Type Description
    Error
    • string
    Info
    • string
    Warning
    • string

    StorageAccountTypes

    Specifies the storage account type for the managed disk. NOTE: UltraSSD_LRS can only be used with data disks, it cannot be used with OS Disk.

    Name Type Description
    Premium_LRS
    • string
    Premium_ZRS
    • string
    StandardSSD_LRS
    • string
    StandardSSD_ZRS
    • string
    Standard_LRS
    • string
    UltraSSD_LRS
    • string

    StorageProfile

    Specifies the storage settings for the virtual machine disks.

    Name Type Description
    dataDisks

    Specifies the parameters that are used to add a data disk to a virtual machine.

    For more information about disks, see About disks and VHDs for Azure virtual machines.

    imageReference

    Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations.

    osDisk

    Specifies information about the operating system disk used by the virtual machine.

    For more information about disks, see About disks and VHDs for Azure virtual machines.

    SubResource

    Name Type Description
    id
    • string

    Resource Id

    UefiSettings

    Specifies the security settings like secure boot and vTPM used while creating the virtual machine.

    Minimum api-version: 2020-12-01

    Name Type Description
    secureBootEnabled
    • boolean

    Specifies whether secure boot should be enabled on the virtual machine.

    Minimum api-version: 2020-12-01

    vTpmEnabled
    • boolean

    Specifies whether vTPM should be enabled on the virtual machine.

    Minimum api-version: 2020-12-01

    UserAssignedIdentities

    The list of user identities associated with the Virtual Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.

    Name Type Description

    VaultCertificate

    Describes a single certificate reference in a Key Vault, and where the certificate should reside on the VM.

    Name Type Description
    certificateStore
    • string

    For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account.

    For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of these files are .pem formatted.

    certificateUrl
    • string

    This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see Add a key or secret to the key vault. In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8:

    {
    "data":"",
    "dataType":"pfx",
    "password":""
    }

    VaultSecretGroup

    Describes a set of certificates which are all in the same Key Vault.

    Name Type Description
    sourceVault

    The relative URL of the Key Vault containing all of the certificates in VaultCertificates.

    vaultCertificates

    The list of key vault references in SourceVault which contain certificates.

    VirtualHardDisk

    Describes the uri of a disk.

    Name Type Description
    uri
    • string

    Specifies the virtual hard disk's uri.

    VirtualMachine

    Describes a Virtual Machine.

    Name Type Description
    extendedLocation

    The extended location of the Virtual Machine.

    id
    • string

    Resource Id

    identity

    The identity of the virtual machine, if configured.

    location
    • string

    Resource location

    name
    • string

    Resource name

    plan

    Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click Want to deploy programmatically, Get Started ->. Enter any required information and then click Save.

    properties.additionalCapabilities

    Specifies additional capabilities enabled or disabled on the virtual machine.

    properties.availabilitySet

    Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see Manage the availability of virtual machines.

    For more information on Azure planned maintenance, see Planned maintenance for virtual machines in Azure

    Currently, a VM can only be added to availability set at creation time. The availability set to which the VM is being added should be under the same resource group as the availability set resource. An existing VM cannot be added to an availability set.

    This property cannot exist along with a non-null properties.virtualMachineScaleSet reference.

    properties.billingProfile

    Specifies the billing related details of a Azure Spot virtual machine.

    Minimum api-version: 2019-03-01.

    properties.diagnosticsProfile

    Specifies the boot diagnostic settings state.

    Minimum api-version: 2015-06-15.

    properties.evictionPolicy

    Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set.

    For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01.

    For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview.

    properties.extensionsTimeBudget
    • string

    Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default value is 90 minutes (PT1H30M).

    Minimum api-version: 2020-06-01

    properties.hardwareProfile

    Specifies the hardware settings for the virtual machine.

    properties.host

    Specifies information about the dedicated host that the virtual machine resides in.

    Minimum api-version: 2018-10-01.

    properties.hostGroup

    Specifies information about the dedicated host group that the virtual machine resides in.

    Minimum api-version: 2020-06-01.

    NOTE: User cannot specify both host and hostGroup properties.

    properties.instanceView

    The virtual machine instance view.

    properties.licenseType
    • string

    Specifies that the image or disk that is being used was licensed on-premises.

    Possible values for Windows Server operating system are:

    Windows_Client

    Windows_Server

    Possible values for Linux Server operating system are:

    RHEL_BYOS (for RHEL)

    SLES_BYOS (for SUSE)

    For more information, see Azure Hybrid Use Benefit for Windows Server

    Azure Hybrid Use Benefit for Linux Server

    Minimum api-version: 2015-06-15

    properties.networkProfile

    Specifies the network interfaces of the virtual machine.

    properties.osProfile

    Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned.

    properties.platformFaultDomain
    • integer

    Specifies the scale set logical fault domain into which the Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that best maintains balance across available fault domains.

  • This is applicable only if the 'virtualMachineScaleSet' property of this Virtual Machine is set.
  • The Virtual Machine Scale Set that is referenced, must have 'platformFaultDomainCount' > 1.
  • This property cannot be updated once the Virtual Machine is created.
  • Fault domain assignment can be viewed in the Virtual Machine Instance View.

    Minimum api‐version: 2020‐12‐01

  • properties.priority

    Specifies the priority for the virtual machine.

    Minimum api-version: 2019-03-01

    properties.provisioningState
    • string

    The provisioning state, which only appears in the response.

    properties.proximityPlacementGroup

    Specifies information about the proximity placement group that the virtual machine should be assigned to.

    Minimum api-version: 2018-04-01.

    properties.securityProfile

    Specifies the Security related profile settings for the virtual machine.

    properties.storageProfile

    Specifies the storage settings for the virtual machine disks.

    properties.virtualMachineScaleSet

    Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing VM cannot be added to a virtual machine scale set.

    This property cannot exist along with a non-null properties.availabilitySet reference.

    Minimum api‐version: 2019‐03‐01

    properties.vmId
    • string

    Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands.

    resources

    The virtual machine child extension resources.

    tags
    • object

    Resource tags

    type
    • string

    Resource type

    zones
    • string[]

    The virtual machine zones.

    VirtualMachineAgentInstanceView

    The instance view of the VM Agent running on the virtual machine.

    Name Type Description
    extensionHandlers

    The virtual machine extension handler instance view.

    statuses

    The resource status information.

    vmAgentVersion
    • string

    The VM Agent full version.

    VirtualMachineEvictionPolicyTypes

    Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set.

    For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01.

    For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview.

    Name Type Description
    Deallocate
    • string
    Delete
    • string

    VirtualMachineExtension

    Describes a Virtual Machine Extension.

    Name Type Description
    id
    • string

    Resource Id

    location
    • string

    Resource location

    name
    • string

    Resource name

    properties.autoUpgradeMinorVersion
    • boolean

    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.

    properties.enableAutomaticUpgrade
    • boolean

    Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available.

    properties.forceUpdateTag
    • string

    How the extension handler should be forced to update even if the extension configuration has not changed.

    properties.instanceView

    The virtual machine extension instance view.

    properties.protectedSettings
    • object

    The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.

    properties.provisioningState
    • string

    The provisioning state, which only appears in the response.

    properties.publisher
    • string

    The name of the extension handler publisher.

    properties.settings
    • object

    Json formatted public settings for the extension.

    properties.type
    • string

    Specifies the type of the extension; an example is "CustomScriptExtension".

    properties.typeHandlerVersion
    • string

    Specifies the version of the script handler.

    tags
    • object

    Resource tags

    type
    • string

    Resource type

    VirtualMachineExtensionHandlerInstanceView

    The instance view of a virtual machine extension handler.

    Name Type Description
    status

    The extension handler status.

    type
    • string

    Specifies the type of the extension; an example is "CustomScriptExtension".

    typeHandlerVersion
    • string

    Specifies the version of the script handler.

    VirtualMachineExtensionInstanceView

    The instance view of a virtual machine extension.

    Name Type Description
    name
    • string

    The virtual machine extension name.

    statuses

    The resource status information.

    substatuses

    The resource status information.

    type
    • string

    Specifies the type of the extension; an example is "CustomScriptExtension".

    typeHandlerVersion
    • string

    Specifies the version of the script handler.

    VirtualMachineHealthStatus

    The health status of the VM.

    Name Type Description
    status

    The health status information for the VM.

    VirtualMachineIdentity

    Identity for the virtual machine.

    Name Type Description
    principalId
    • string

    The principal id of virtual machine identity. This property will only be provided for a system assigned identity.

    tenantId
    • string

    The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity.

    type

    The type of identity used for the virtual machine. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the virtual machine.

    userAssignedIdentities

    The list of user identities associated with the Virtual Machine. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.

    VirtualMachineInstanceView

    The instance view of a virtual machine.

    Name Type Description
    assignedHost
    • string

    Resource id of the dedicated host, on which the virtual machine is allocated through automatic placement, when the virtual machine is associated with a dedicated host group that has automatic placement enabled.

    Minimum api-version: 2020-06-01.

    bootDiagnostics

    Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

    You can easily view the output of your console log.

    Azure also enables you to see a screenshot of the VM from the hypervisor.

    computerName
    • string

    The computer name assigned to the virtual machine.

    disks

    The virtual machine disk information.

    extensions

    The extensions information.

    hyperVGeneration

    Specifies the HyperVGeneration Type associated with a resource

    maintenanceRedeployStatus

    The Maintenance Operation status on the virtual machine.

    osName
    • string

    The Operating System running on the virtual machine.

    osVersion
    • string

    The version of Operating System running on the virtual machine.

    patchStatus

    [Preview Feature] The status of virtual machine patch operations.

    platformFaultDomain
    • integer

    Specifies the fault domain of the virtual machine.

    platformUpdateDomain
    • integer

    Specifies the update domain of the virtual machine.

    rdpThumbPrint
    • string

    The Remote desktop certificate thumbprint.

    statuses

    The resource status information.

    vmAgent

    The VM Agent running on the virtual machine.

    vmHealth

    The health status for the VM.

    VirtualMachinePatchStatus

    The status of virtual machine patch operations.

    Name Type Description
    availablePatchSummary

    The available patch summary of the latest assessment operation for the virtual machine.

    configurationStatuses

    The enablement status of the specified patchMode

    lastPatchInstallationSummary

    The installation summary of the latest installation operation for the virtual machine.

    VirtualMachinePriorityTypes

    Specifies the priority for the virtual machine.

    Minimum api-version: 2019-03-01

    Name Type Description
    Low
    • string
    Regular
    • string
    Spot
    • string

    VirtualMachineSizeTypes

    Specifies the size of the virtual machine.

    The enum data type is currently deprecated and will be removed by December 23rd 2023.

    Recommended way to get the list of available sizes is using these APIs:

    List all available virtual machine sizes in an availability set

    List all available virtual machine sizes in a region

    List all available virtual machine sizes for resizing. For more information about virtual machine sizes, see Sizes for virtual machines.

    The available VM sizes depend on region and availability set.

    Name Type Description
    Basic_A0
    • string
    Basic_A1
    • string
    Basic_A2
    • string
    Basic_A3
    • string
    Basic_A4
    • string
    Standard_A0
    • string
    Standard_A1
    • string
    Standard_A10
    • string
    Standard_A11
    • string
    Standard_A1_v2
    • string
    Standard_A2
    • string
    Standard_A2_v2
    • string
    Standard_A2m_v2
    • string
    Standard_A3
    • string
    Standard_A4
    • string
    Standard_A4_v2
    • string
    Standard_A4m_v2
    • string
    Standard_A5
    • string
    Standard_A6
    • string
    Standard_A7
    • string
    Standard_A8
    • string
    Standard_A8_v2
    • string
    Standard_A8m_v2
    • string
    Standard_A9
    • string
    Standard_B1ms
    • string
    Standard_B1s
    • string
    Standard_B2ms
    • string
    Standard_B2s
    • string
    Standard_B4ms
    • string
    Standard_B8ms
    • string
    Standard_D1
    • string
    Standard_D11
    • string
    Standard_D11_v2
    • string
    Standard_D12
    • string
    Standard_D12_v2
    • string
    Standard_D13
    • string
    Standard_D13_v2
    • string
    Standard_D14
    • string
    Standard_D14_v2
    • string
    Standard_D15_v2
    • string
    Standard_D16_v3
    • string
    Standard_D16s_v3
    • string
    Standard_D1_v2
    • string
    Standard_D2
    • string
    Standard_D2_v2
    • string
    Standard_D2_v3
    • string
    Standard_D2s_v3
    • string
    Standard_D3
    • string
    Standard_D32_v3
    • string
    Standard_D32s_v3
    • string
    Standard_D3_v2
    • string
    Standard_D4
    • string
    Standard_D4_v2
    • string
    Standard_D4_v3
    • string
    Standard_D4s_v3
    • string
    Standard_D5_v2
    • string
    Standard_D64_v3
    • string
    Standard_D64s_v3
    • string
    Standard_D8_v3
    • string
    Standard_D8s_v3
    • string
    Standard_DS1
    • string
    Standard_DS11
    • string
    Standard_DS11_v2
    • string
    Standard_DS12
    • string
    Standard_DS12_v2
    • string
    Standard_DS13
    • string
    Standard_DS13-2_v2
    • string
    Standard_DS13-4_v2
    • string
    Standard_DS13_v2
    • string
    Standard_DS14
    • string
    Standard_DS14-4_v2
    • string
    Standard_DS14-8_v2
    • string
    Standard_DS14_v2
    • string
    Standard_DS15_v2
    • string
    Standard_DS1_v2
    • string
    Standard_DS2
    • string
    Standard_DS2_v2
    • string
    Standard_DS3
    • string
    Standard_DS3_v2
    • string
    Standard_DS4
    • string
    Standard_DS4_v2
    • string
    Standard_DS5_v2
    • string
    Standard_E16_v3
    • string
    Standard_E16s_v3
    • string
    Standard_E2_v3
    • string
    Standard_E2s_v3
    • string
    Standard_E32-16_v3
    • string
    Standard_E32-8s_v3
    • string
    Standard_E32_v3
    • string
    Standard_E32s_v3
    • string
    Standard_E4_v3
    • string
    Standard_E4s_v3
    • string
    Standard_E64-16s_v3
    • string
    Standard_E64-32s_v3
    • string
    Standard_E64_v3
    • string
    Standard_E64s_v3
    • string
    Standard_E8_v3
    • string
    Standard_E8s_v3
    • string
    Standard_F1
    • string
    Standard_F16
    • string
    Standard_F16s
    • string
    Standard_F16s_v2
    • string
    Standard_F1s
    • string
    Standard_F2
    • string
    Standard_F2s
    • string
    Standard_F2s_v2
    • string
    Standard_F32s_v2
    • string
    Standard_F4
    • string
    Standard_F4s
    • string
    Standard_F4s_v2
    • string
    Standard_F64s_v2
    • string
    Standard_F72s_v2
    • string
    Standard_F8
    • string
    Standard_F8s
    • string
    Standard_F8s_v2
    • string
    Standard_G1
    • string
    Standard_G2
    • string
    Standard_G3
    • string
    Standard_G4
    • string
    Standard_G5
    • string
    Standard_GS1
    • string
    Standard_GS2
    • string
    Standard_GS3
    • string
    Standard_GS4
    • string
    Standard_GS4-4
    • string
    Standard_GS4-8
    • string
    Standard_GS5
    • string
    Standard_GS5-16
    • string
    Standard_GS5-8
    • string
    Standard_H16
    • string
    Standard_H16m
    • string
    Standard_H16mr
    • string
    Standard_H16r
    • string
    Standard_H8
    • string
    Standard_H8m
    • string
    Standard_L16s
    • string
    Standard_L32s
    • string
    Standard_L4s
    • string
    Standard_L8s
    • string
    Standard_M128-32ms
    • string
    Standard_M128-64ms
    • string
    Standard_M128ms
    • string
    Standard_M128s
    • string
    Standard_M64-16ms
    • string
    Standard_M64-32ms
    • string
    Standard_M64ms
    • string
    Standard_M64s
    • string
    Standard_NC12
    • string
    Standard_NC12s_v2
    • string
    Standard_NC12s_v3
    • string
    Standard_NC24
    • string
    Standard_NC24r
    • string
    Standard_NC24rs_v2
    • string
    Standard_NC24rs_v3
    • string
    Standard_NC24s_v2
    • string
    Standard_NC24s_v3
    • string
    Standard_NC6
    • string
    Standard_NC6s_v2
    • string
    Standard_NC6s_v3
    • string
    Standard_ND12s
    • string
    Standard_ND24rs
    • string
    Standard_ND24s
    • string
    Standard_ND6s
    • string
    Standard_NV12
    • string
    Standard_NV24
    • string
    Standard_NV6
    • string

    WindowsConfiguration

    Specifies Windows operating system settings on the virtual machine.

    Name Type Description
    additionalUnattendContent

    Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup.

    enableAutomaticUpdates
    • boolean

    Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true.

    For virtual machine scale sets, this property can be updated and updates will take effect on OS reprovisioning.

    patchSettings

    [Preview Feature] Specifies settings related to VM Guest Patching on Windows.

    provisionVMAgent
    • boolean

    Indicates whether virtual machine agent should be provisioned on the virtual machine.

    When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later.

    timeZone
    • string

    Specifies the time zone of the virtual machine. e.g. "Pacific Standard Time".

    Possible values can be TimeZoneInfo.Id value from time zones returned by TimeZoneInfo.GetSystemTimeZones.

    winRM

    Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell.

    WindowsVMGuestPatchMode

    Specifies the mode of VM Guest Patching to IaaS virtual machine.

    Possible values are:

    Manual - You control the application of patches to a virtual machine. You do this by applying patches manually inside the VM. In this mode, automatic updates are disabled; the property WindowsConfiguration.enableAutomaticUpdates must be false

    AutomaticByOS - The virtual machine will automatically be updated by the OS. The property WindowsConfiguration.enableAutomaticUpdates must be true.

    AutomaticByPlatform - the virtual machine will automatically updated by the platform. The properties provisionVMAgent and WindowsConfiguration.enableAutomaticUpdates must be true

    Name Type Description
    AutomaticByOS
    • string
    AutomaticByPlatform
    • string
    Manual
    • string

    WinRMConfiguration

    Describes Windows Remote Management configuration of the VM

    Name Type Description
    listeners

    The list of Windows Remote Management listeners

    WinRMListener

    Describes Protocol and thumbprint of Windows Remote Management listener

    Name Type Description
    certificateUrl
    • string

    This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see Add a key or secret to the key vault. In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8:

    {
    "data":"",
    "dataType":"pfx",
    "password":""
    }

    protocol

    Specifies the protocol of WinRM listener.

    Possible values are:
    http

    https