Create Or Update Virtual Machine
The operation to create or update a virtual machine. Please note some properties can be set only during virtual machine creation.
External Documentation
To learn more, visit the Azure documentation.
Basic Parameters
Parameter | Description |
---|---|
Encryption Settings Enabled | Specifies whether disk encryption should be enabled on the virtual machine. |
Hardware Profile Vm Size | Specifies the size of the virtual machine. For more information about virtual machine sizes, see Sizes for virtual machines.The available VM sizes depend on region and availability set. For a list of available sizes use these APIs:List all available virtual machine sizes in an availability setList all available virtual machine sizes in a regionList all available virtual machine sizes for resizing. |
Location | Resource location. |
Network Profile Network Interfaces | Specifies the list of resource Ids for the network interfaces associated with the virtual machine. |
Os Disk Create Option | 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. |
Os Disk Os Type | 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:WindowsLinux. |
Os Disk Write Accelerator Enabled | Specifies whether writeAccelerator should be enabled or disabled on the disk. |
Resource Group Name | The name of the resource group. |
Subscription ID | Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. |
VM Name | The name of the virtual machine. |
Advanced Parameters
Parameter | Description |
---|---|
Additional Capabilities Ultra SSDEnabled | The flag that enables or disables a capability to have one or more managed data disks with UltraSSDLRS storage account type on the VM or VMSS. Managed disks with storage account type UltraSSDLRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. |
Availability Set ID | Resource Id. |
Billing Profile Max Price | 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:
|
Boot Diagnostics Console Screenshot Blob Uri | The console screenshot blob URI. |
Boot Diagnostics Enabled | Whether boot diagnostics should be enabled on the Virtual Machine. |
Boot Diagnostics Serial Console Log Blob Uri | The Linux serial console log blob Uri. |
Boot Diagnostics Storage Uri | Uri of the storage account to use for placing the console output and screenshot. |
Diff Disk Settings Option | Specifies the ephemeral disk option for operating system disk. |
Disk Encryption Key Secret URL | The URL referencing a secret in a Key Vault. |
Disk Encryption Key Source Vault ID | Resource Id. |
Disk Encryption Set ID | Resource Id. |
Host ID | Resource Id. |
ID | Resource Id. |
Identity Principal ID | The principal id of virtual machine identity. This property will only be provided for a system assigned identity. |
Identity Tenant ID | The tenant id associated with the virtual machine. This property will only be provided for a system assigned identity. |
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. |
Identity User Assigned Identities | 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}'. |
Image Reference Exact Version | 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'. |
Image Reference ID | Resource Id. |
Image Reference Offer | Specifies the offer of the platform image or marketplace image used to create the virtual machine. |
Image Reference Publisher | The image publisher. |
Image Reference Sku | The image SKU. |
Image Reference Version | 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. |
Image Uri | Specifies the virtual hard disk's uri. |
Instance View Computer Name | The computer name assigned to the virtual machine. |
Instance View Disks | The virtual machine disk information. |
Instance View Extensions | The extensions information. |
Instance View Hyper VGeneration | Specifies the HyperVGeneration Type associated with a resource. |
Instance View Os Name | The Operating System running on the virtual machine. |
Instance View Os Version | The version of Operating System running on the virtual machine. |
Instance View Platform Fault Domain | Specifies the fault domain of the virtual machine. |
Instance View Platform Update Domain | Specifies the update domain of the virtual machine. |
Instance View Rdp Thumb Print | The Remote desktop certificate thumbprint. |
Instance View Statuses | The resource status information. |
Key Encryption Key Key URL | The URL referencing a key encryption key in Key Vault. |
Key Encryption Key Source Vault ID | Resource Id. |
Linux Configuration Disable Password Authentication | Specifies whether password authentication should be disabled. |
Linux Configuration Provision VMAgent | 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. |
Maintenance Redeploy Status Is Customer Initiated Maintenance Allowed | True, if customer is allowed to perform Maintenance. |
Maintenance Redeploy Status Last Operation Message | Message returned for the last Maintenance Operation. |
Maintenance Redeploy Status Last Operation Result Code | The Last Maintenance Operation Result Code. |
Maintenance Redeploy Status Maintenance Window End Time | End Time for the Maintenance Window. |
Maintenance Redeploy Status Maintenance Window Start Time | Start Time for the Maintenance Window. |
Maintenance Redeploy Status Pre Maintenance Window End Time | End Time for the Pre Maintenance Window. |
Maintenance Redeploy Status Pre Maintenance Window Start Time | Start Time for the Pre Maintenance Window. |
Managed Disk Disk Encryption Set | 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. |
Managed Disk ID | Resource Id. |
Managed Disk Storage Account Type | Specifies the storage account type for the managed disk. NOTE: UltraSSDLRS can only be used with data disks. It cannot be used with OS Disk. StandardLRS uses Standard HDD. StandardSSDLRS uses Standard SSD. PremiumLRS uses Premium SSD. UltraSSD_LRS uses Ultra disk. For more information regarding disks supported for Windows Virtual Machines, refer to https://docs.microsoft.com/en-us/azure/virtual-machines/windows/disks-types and, for Linux Virtual Machines, refer to https://docs.microsoft.com/en-us/azure/virtual-machines/linux/disks-types. |
Name | Resource name. |
Os Disk Caching | Specifies the caching requirements.Possible values are:NoneReadOnlyReadWriteDefault: None for Standard storage. ReadOnly for Premium storage. |
Os Disk Disk Size GB | 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. |
Os Disk Name | The disk name. |
Os Profile Admin Password | Specifies the password of the administrator account.Minimum-length (Windows): 8 charactersMinimum-length (Linux): 6 charactersMax-length (Windows): 123 charactersMax-length (Linux): 72 charactersComplexity requirements: 3 out of 4 conditions below need to be fulfilled Has lower charactersHas 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 VMFor resetting root password, see Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension. |
Os Profile Admin Username | 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 characterMax-length (Linux): 64 charactersMax-length (Windows): 20 charactersFor 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. |
Os Profile Allow Extension Operations | 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. |
Os Profile Computer Name | Specifies the host OS name of the virtual machine.This name cannot be updated after the VM is created.Max-length (Windows): 15 charactersMax-length (Linux): 64 characters.For naming conventions and restrictions see Azure infrastructure services implementation guidelines. |
Os Profile Custom Data | 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 propertyThis 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 VMsFor using cloud-init for your Linux VM, see Using cloud-init to customize a Linux VM during creation. |
Os Profile Require Guest Provision Signal | Specifies whether the guest provision signal is required to infer provision success of the virtual machine. |
Os Profile Secrets | Specifies set of certificates that should be installed onto the virtual machine. |
Plan Name | The plan ID. |
Plan Product | Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. |
Plan Promotion Code | The promotion code. |
Plan Publisher | The publisher ID. |
Properties Eviction Policy | Specifies the eviction policy for the Azure Spot VM/VMSS. |
Properties License Type | Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system.Possible values are:Windows_ClientWindows_ServerIf this element is included in a request for an update, the value must match the initial value. This value cannot be updated.For more information, see Azure Hybrid Use Benefit for Windows ServerMinimum api-version: 2015-06-15. |
Properties Priority | Specifies the priority for a standalone virtual machine or the virtual machines in the scale set.'Low' enum will be deprecated in the future, please use 'Spot' as the enum to deploy Azure Spot VM/VMSS. |
Properties Provisioning State | The provisioning state, which only appears in the response. |
Proximity Placement Group ID | Resource Id. |
Resources | The virtual machine child extension resources. |
Ssh Public Keys | The list of SSH public keys used to authenticate with linux based VMs. |
Status Code | The status code. |
Status Display Status | The short localizable label for the status. |
Status Level | The level code. |
Status Message | The detailed status message, including for alerts and error messages. |
Status Time | The time of the status. |
Storage Profile Data Disks | 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. |
Tags | Resource tags. |
Type | Resource type. |
VM ID | 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. |
Vhd Uri | Specifies the virtual hard disk's uri. |
Virtual Machine Scale Set ID | Resource Id. |
Vm Agent Extension Handlers | The virtual machine extension handler instance view. |
Vm Agent Statuses | The resource status information. |
Vm Agent Vm Agent Version | The VM Agent full version. |
Win RM Listeners | The list of Windows Remote Management listeners. |
Windows Configuration Additional Unattend Content | Specifies additional base-64 encoded XML formatted information that can be included in the Unattend.xml file, which is used by Windows Setup. |
Windows Configuration Enable Automatic Updates | 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. |
Windows Configuration Provision VMAgent | 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. |
Windows Configuration Time Zone | 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. |
Zones | The virtual machine zones. |
Example Output
{
"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"
}
Workflow Library Example
Create or Update Virtual Machine with Azure and Send Results Via Email
Preview this Workflow on desktop