Skip to content

Latest commit

 

History

History
802 lines (611 loc) · 45.5 KB

azure_virtual_machine.md

File metadata and controls

802 lines (611 loc) · 45.5 KB

Document: "compute"

Path: "https://github.com/Azure/azure-rest-api-specs/blob/2fbb5118cd34f412a51d9bc8a274224b216763cf/specification/compute/resource-manager/Microsoft.Compute/preview/2016-04-30-preview/compute.json")

VirtualMachine

Describes a Virtual Machine.

azure_virtual_machine {
  api_version => "api_version",
  identity => $azure_virtual_machine_identity
  location => "location (optional)",
  parameters => "parameters",
  plan => $azure_plan
  properties => $azure_virtual_machine_properties
  resource_group_name => "resource_group_name",
  resources => $azure_virtual_machine_extension
  subscription_id => "subscription_id",
  tags => "tags (optional)",
}
Name Type Required Description
api_version String true Client Api Version.
identity VirtualMachineIdentity false The identity of the virtual machine, if configured.
location String false Resource location
parameters Hash true Parameters supplied to the Create Virtual Machine operation.
plan Plan false 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 VirtualMachineProperties false
resource_group_name String true The name of the resource group.
resources VirtualMachineExtension false The virtual machine child extension resources.
subscription_id String true Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
tags Hash false Resource tags

VirtualMachineIdentity

Identity for the virtual machine.

$azure_virtual_machine_identity = {
  type => "type (optional)",
}
Name Type Required Description
type String false The type of identity used for the virtual machine. Currently, the only supported type is 'SystemAssigned', which implicitly creates an identity.

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.

$azure_plan = {
  name => "name (optional)",
  product => "product (optional)",
  promotionCode => "promotionCode (optional)",
  publisher => "publisher (optional)",
}
Name Type Required Description
name String false The plan ID.
product String false Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element.
promotionCode String false The promotion code.
publisher String false The publisher ID.

VirtualMachineProperties

Describes the properties of a Virtual Machine.

$azure_virtual_machine_properties = {
  availabilitySet => $azure_sub_resource
  diagnosticsProfile => $azure_diagnostics_profile
  hardwareProfile => $azure_hardware_profile
  instanceView => $azure_virtual_machine_instance_view
  licenseType => "licenseType (optional)",
  networkProfile => $azure_network_profile
  osProfile => $azure_os_profile
  storageProfile => $azure_storage_profile
}
Name Type Required Description
availabilitySet SubResource false 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. An existing VM cannot be added to an availability set.
diagnosticsProfile DiagnosticsProfile false Specifies the boot diagnostic settings state.

Minimum api-version: 2015-06-15.
hardwareProfile HardwareProfile false Specifies the hardware settings for the virtual machine.
instanceView VirtualMachineInstanceView false The virtual machine instance view.
licenseType String false 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_Client

Windows_Server

If 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 Server

Minimum api-version: 2015-06-15
networkProfile NetworkProfile false Specifies the network interfaces of the virtual machine.
osProfile OSProfile false Specifies the operating system settings for the virtual machine.
storageProfile StorageProfile false Specifies the storage settings for the virtual machine disks.

SubResource

$azure_sub_resource = {
  id => "id (optional)",
}
Name Type Required Description
id String false Resource Id

DiagnosticsProfile

Specifies the boot diagnostic settings state.

Minimum api-version: 2015-06-15.

$azure_diagnostics_profile = {
  bootDiagnostics => $azure_boot_diagnostics
}
Name Type Required Description
bootDiagnostics BootDiagnostics false 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.

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.

$azure_boot_diagnostics = {
  enabled => "enabled (optional)",
  storageUri => "storageUri (optional)",
}
Name Type Required Description
enabled Boolean false Whether boot diagnostics should be enabled on the Virtual Machine.
storageUri String false Uri of the storage account to use for placing the console output and screenshot.

HardwareProfile

Specifies the hardware settings for the virtual machine.

$azure_hardware_profile = {
  vmSize => "vmSize (optional)",
}
Name Type Required Description
vmSize String false 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 set

List all available virtual machine sizes in a region

List all available virtual machine sizes for resizing

VirtualMachineInstanceView

The instance view of a virtual machine.

$azure_virtual_machine_instance_view = {
  bootDiagnostics => $azure_boot_diagnostics_instance_view
  disks => $azure_disk_instance_view
  extensions => $azure_virtual_machine_extension_instance_view
  platformFaultDomain => "1234 (optional)",
  platformUpdateDomain => "1234 (optional)",
  rdpThumbPrint => "rdpThumbPrint (optional)",
  statuses => $azure_instance_view_status
  vmAgent => $azure_virtual_machine_agent_instance_view
}
Name Type Required Description
bootDiagnostics BootDiagnosticsInstanceView false 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.
disks DiskInstanceView false The virtual machine disk information.
extensions VirtualMachineExtensionInstanceView false The extensions information.
platformFaultDomain Integer false Specifies the fault domain of the virtual machine.
platformUpdateDomain Integer false Specifies the update domain of the virtual machine.
rdpThumbPrint String false The Remote desktop certificate thumbprint.
statuses InstanceViewStatus false The resource status information.
vmAgent VirtualMachineAgentInstanceView false The VM Agent running on the virtual machine.

BootDiagnosticsInstanceView

The instance view of a virtual machine boot diagnostics.

$azure_boot_diagnostics_instance_view = {
}
Name Type Required Description

DiskInstanceView

The instance view of the disk.

$azure_disk_instance_view = {
  name => "name (optional)",
  statuses => $azure_instance_view_status
}
Name Type Required Description
name String false The disk name.
statuses InstanceViewStatus false The resource status information.

InstanceViewStatus

Instance view status.

$azure_instance_view_status = {
  code => "code (optional)",
  displayStatus => "displayStatus (optional)",
  level => "level (optional)",
  message => "message (optional)",
  time => "time (optional)",
}
Name Type Required Description
code String false The status code.
displayStatus String false The short localizable label for the status.
level String false The level code.
message String false The detailed status message, including for alerts and error messages.
time String false The time of the status.

VirtualMachineExtensionInstanceView

The instance view of a virtual machine extension.

$azure_virtual_machine_extension_instance_view = {
  name => "name (optional)",
  statuses => $azure_instance_view_status
  substatuses => $azure_instance_view_status
  type => "type (optional)",
  typeHandlerVersion => "typeHandlerVersion (optional)",
}
Name Type Required Description
name String false The virtual machine extension name.
statuses InstanceViewStatus false The resource status information.
substatuses InstanceViewStatus false The resource status information.
type String false Specifies the type of the extension; an example is 'CustomScriptExtension'.
typeHandlerVersion String false Specifies the version of the script handler.

VirtualMachineAgentInstanceView

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

$azure_virtual_machine_agent_instance_view = {
  extensionHandlers => $azure_virtual_machine_extension_handler_instance_view
  statuses => $azure_instance_view_status
  vmAgentVersion => "vmAgentVersion (optional)",
}
Name Type Required Description
extensionHandlers VirtualMachineExtensionHandlerInstanceView false The virtual machine extension handler instance view.
statuses InstanceViewStatus false The resource status information.
vmAgentVersion String false The VM Agent full version.

VirtualMachineExtensionHandlerInstanceView

The instance view of a virtual machine extension handler.

$azure_virtual_machine_extension_handler_instance_view = {
  status => $azure_instance_view_status
  type => "type (optional)",
  typeHandlerVersion => "typeHandlerVersion (optional)",
}
Name Type Required Description
status InstanceViewStatus false The extension handler status.
type String false Specifies the type of the extension; an example is 'CustomScriptExtension'.
typeHandlerVersion String false Specifies the version of the script handler.

NetworkProfile

Specifies the network interfaces of the virtual machine.

$azure_network_profile = {
  networkInterfaces => $azure_network_interface_reference
}
Name Type Required Description
networkInterfaces NetworkInterfaceReference false Specifies the list of resource Ids for the network interfaces associated with the virtual machine.

NetworkInterfaceReference

Describes a network interface reference.

$azure_network_interface_reference = {
  id => "id (optional)",
  properties => $azure_network_interface_reference_properties
}
Name Type Required Description
id String false Resource Id
properties NetworkInterfaceReferenceProperties false

NetworkInterfaceReferenceProperties

Describes a network interface reference properties.

$azure_network_interface_reference_properties = {
  primary => "primary (optional)",
}
Name Type Required Description
primary Boolean false Specifies the primary network interface in case the virtual machine has more than 1 network interface.

OSProfile

Specifies the operating system settings for the virtual machine.

$azure_os_profile = {
  adminPassword => "adminPassword (optional)",
  adminUsername => "adminUsername (optional)",
  computerName => "computerName (optional)",
  customData => "customData (optional)",
  linuxConfiguration => $azure_linux_configuration
  secrets => $azure_vault_secret_group
  windowsConfiguration => $azure_windows_configuration
}
Name Type Required Description
adminPassword String false 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 false Specifies the name of the administrator account.

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
  • computerName String false 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 false 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.

    For using cloud-init for your VM, see Using cloud-init to customize a Linux VM during creation
    linuxConfiguration LinuxConfiguration false 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.
    secrets VaultSecretGroup false Specifies set of certificates that should be installed onto the virtual machine.
    windowsConfiguration WindowsConfiguration false Specifies Windows operating system settings on the virtual machine.

    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.

    $azure_linux_configuration = {
      disablePasswordAuthentication => "disablePasswordAuthentication (optional)",
      ssh => $azure_ssh_configuration
    }
    Name Type Required Description
    disablePasswordAuthentication Boolean false Specifies whether password authentication should be disabled.
    ssh SshConfiguration false Specifies the ssh key configuration for a Linux OS.

    SshConfiguration

    SSH configuration for Linux based VMs running on Azure

    $azure_ssh_configuration = {
      publicKeys => $azure_ssh_public_key
    }
    Name Type Required Description
    publicKeys SshPublicKey false 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.

    $azure_ssh_public_key = {
      keyData => "keyData (optional)",
      path => "path (optional)",
    }
    Name Type Required Description
    keyData String false 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 false 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

    VaultSecretGroup

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

    $azure_vault_secret_group = {
      sourceVault => $azure_sub_resource
      vaultCertificates => $azure_vault_certificate
    }
    Name Type Required Description
    sourceVault SubResource false The relative URL of the Key Vault containing all of the certificates in VaultCertificates.
    vaultCertificates VaultCertificate false The list of key vault references in SourceVault which contain certificates.

    VaultCertificate

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

    $azure_vault_certificate = {
      certificateStore => "certificateStore (optional)",
      certificateUrl => "certificateUrl (optional)",
    }
    Name Type Required Description
    certificateStore String false 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 .crt for the X509 certificate file and .prv for private key. Both of these files are .pem formatted.
    certificateUrl String false 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':''
    }

    WindowsConfiguration

    Specifies Windows operating system settings on the virtual machine.

    $azure_windows_configuration = {
      additionalUnattendContent => $azure_additional_unattend_content
      enableAutomaticUpdates => "enableAutomaticUpdates (optional)",
      provisionVMAgent => "provisionVMAgent (optional)",
      timeZone => "timeZone (optional)",
      winRM => $azure_win_rm_configuration
    }
    Name Type Required Description
    additionalUnattendContent AdditionalUnattendContent false 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 false Indicates whether virtual machine is enabled for automatic updates.
    provisionVMAgent Boolean false 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 false Specifies the time zone of the virtual machine. e.g. 'Pacific Standard Time'
    winRM WinRMConfiguration false Specifies the Windows Remote Management listeners. This enables remote Windows PowerShell.

    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.

    $azure_additional_unattend_content = {
      componentName => "componentName (optional)",
      content => "content (optional)",
      passName => "passName (optional)",
      settingName => "settingName (optional)",
    }
    Name Type Required Description
    componentName String false The component name. Currently, the only allowable value is Microsoft-Windows-Shell-Setup.
    content String false 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 String false The pass name. Currently, the only allowable value is OobeSystem.
    settingName String false Specifies the name of the setting to which the content applies. Possible values are: FirstLogonCommands and AutoLogon.

    WinRMConfiguration

    Describes Windows Remote Management configuration of the VM

    $azure_win_rm_configuration = {
      listeners => $azure_win_rm_listener
    }
    Name Type Required Description
    listeners WinRMListener false The list of Windows Remote Management listeners

    WinRMListener

    Describes Protocol and thumbprint of Windows Remote Management listener

    $azure_win_rm_listener = {
      certificateUrl => "certificateUrl (optional)",
      protocol => "protocol (optional)",
    }
    Name Type Required Description
    certificateUrl String false 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 String false Specifies the protocol of listener.

    Possible values are:
    http

    https

    StorageProfile

    Specifies the storage settings for the virtual machine disks.

    $azure_storage_profile = {
      dataDisks => $azure_data_disk
      imageReference => $azure_image_reference
      osDisk => $azure_os_disk
    }
    Name Type Required Description
    dataDisks DataDisk false 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 ImageReference false 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 OSDisk false 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.

    DataDisk

    Describes a data disk.

    $azure_data_disk = {
      caching => $azure_caching
      createOption => $azure_create_option
      diskSizeGB => "1234 (optional)",
      image => $azure_virtual_hard_disk
      lun => "1234",
      managedDisk => $azure_managed_disk_parameters
      name => "name (optional)",
      vhd => $azure_virtual_hard_disk
    }
    Name Type Required Description
    caching Caching false Specifies the caching requirements.

    Possible values are:

    None

    ReadOnly

    ReadWrite

    Default: None for Standard storage. ReadOnly for Premium storage
    createOption CreateOption true 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.
    diskSizeGB Integer false 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 VirtualHardDisk false 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 true 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 ManagedDiskParameters false The managed disk parameters.
    name String false The disk name.
    vhd VirtualHardDisk false The virtual hard disk.

    Caching

    Specifies the caching requirements.

    Possible values are:

    None

    ReadOnly

    ReadWrite

    Default: None for Standard storage. ReadOnly for Premium storage

    $azure_caching = {
    }
    Name Type Required Description

    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.

    $azure_create_option = {
    }
    Name Type Required Description

    VirtualHardDisk

    Describes the uri of a disk.

    $azure_virtual_hard_disk = {
      uri => "uri (optional)",
    }
    Name Type Required Description
    uri String false Specifies the virtual hard disk's uri.

    ManagedDiskParameters

    The parameters of a managed disk.

    $azure_managed_disk_parameters = {
      id => "id (optional)",
      storageAccountType => $azure_storage_account_type
    }
    Name Type Required Description
    id String false Resource Id
    storageAccountType StorageAccountType false Specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS.

    StorageAccountType

    Specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS.

    $azure_storage_account_type = {
    }
    Name Type Required Description

    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.

    $azure_image_reference = {
      id => "id (optional)",
      offer => "offer (optional)",
      publisher => "publisher (optional)",
      sku => "sku (optional)",
      version => "version (optional)",
    }
    Name Type Required Description
    id String false Resource Id
    offer String false Specifies the offer of the platform image or marketplace image used to create the virtual machine.
    publisher String false The image publisher.
    sku String false The image SKU.
    version String false 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.

    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.

    $azure_os_disk = {
      caching => $azure_caching
      createOption => $azure_create_option
      diskSizeGB => "1234 (optional)",
      encryptionSettings => $azure_disk_encryption_settings
      image => $azure_virtual_hard_disk
      managedDisk => $azure_managed_disk_parameters
      name => "name (optional)",
      osType => "osType (optional)",
      vhd => $azure_virtual_hard_disk
    }
    Name Type Required Description
    caching Caching false Specifies the caching requirements.

    Possible values are:

    None

    ReadOnly

    ReadWrite

    Default: None for Standard storage. ReadOnly for Premium storage
    createOption CreateOption true 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.
    diskSizeGB Integer false 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 DiskEncryptionSettings false Specifies the encryption settings for the OS Disk.

    Minimum api-version: 2015-06-15
    image VirtualHardDisk false 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 ManagedDiskParameters false The managed disk parameters.
    name String false The disk name.
    osType String false 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 VirtualHardDisk false The virtual hard disk.

    DiskEncryptionSettings

    Describes a Encryption Settings for a Disk

    $azure_disk_encryption_settings = {
      diskEncryptionKey => $azure_key_vault_secret_reference
      enabled => "enabled (optional)",
      keyEncryptionKey => $azure_key_vault_key_reference
    }
    Name Type Required Description
    diskEncryptionKey KeyVaultSecretReference false Specifies the location of the disk encryption key, which is a Key Vault Secret.
    enabled Boolean false Specifies whether disk encryption should be enabled on the virtual machine.
    keyEncryptionKey KeyVaultKeyReference false Specifies the location of the key encryption key in Key Vault.

    KeyVaultSecretReference

    Describes a reference to Key Vault Secret

    $azure_key_vault_secret_reference = {
      secretUrl => "secretUrl",
      sourceVault => $azure_sub_resource
    }
    Name Type Required Description
    secretUrl String true The URL referencing a secret in a Key Vault.
    sourceVault SubResource true The relative URL of the Key Vault containing the secret.

    KeyVaultKeyReference

    Describes a reference to Key Vault Key

    $azure_key_vault_key_reference = {
      keyUrl => "keyUrl",
      sourceVault => $azure_sub_resource
    }
    Name Type Required Description
    keyUrl String true The URL referencing a key encryption key in Key Vault.
    sourceVault SubResource true The relative URL of the Key Vault containing the key.

    VirtualMachineExtension

    Describes a Virtual Machine Extension.

    $azure_virtual_machine_extension = {
      location => "location (optional)",
      properties => $azure_virtual_machine_extension_properties
      tags => "tags (optional)",
    }
    Name Type Required Description
    location String false Resource location
    properties VirtualMachineExtensionProperties false
    tags Hash false Resource tags

    VirtualMachineExtensionProperties

    Describes the properties of a Virtual Machine Extension.

    $azure_virtual_machine_extension_properties = {
      autoUpgradeMinorVersion => "autoUpgradeMinorVersion (optional)",
      forceUpdateTag => "forceUpdateTag (optional)",
      instanceView => $azure_virtual_machine_extension_instance_view
      protectedSettings => "protectedSettings (optional)",
      publisher => "publisher (optional)",
      settings => "settings (optional)",
      type => "type (optional)",
      typeHandlerVersion => "typeHandlerVersion (optional)",
    }
    Name Type Required Description
    autoUpgradeMinorVersion Boolean false 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.
    forceUpdateTag String false How the extension handler should be forced to update even if the extension configuration has not changed.
    instanceView VirtualMachineExtensionInstanceView false The virtual machine extension instance view.
    protectedSettings Hash false The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all.
    publisher String false The name of the extension handler publisher.
    settings Hash false Json formatted public settings for the extension.
    type String false Specifies the type of the extension; an example is 'CustomScriptExtension'.
    typeHandlerVersion String false Specifies the version of the script handler.

    CRUD operations

    Here is a list of endpoints that we use to create, read, update and delete the VirtualMachine

    Operation Path Verb Description OperationID
    Create /subscriptions/%{subscription_id}/resourceGroups/%{resource_group_name}/providers/Microsoft.Compute/virtualMachines/%{vm_name} Put The operation to create or update a virtual machine. VirtualMachines_CreateOrUpdate
    List - list all /subscriptions/%{subscription_id}/providers/Microsoft.Compute/virtualMachines Get Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. VirtualMachines_ListAll
    List - get one /subscriptions/%{subscription_id}/resourceGroups/%{resource_group_name}/providers/Microsoft.Compute/virtualMachines/%{vm_name} Get Retrieves information about the model view or the instance view of a virtual machine. VirtualMachines_Get
    List - get list using params /subscriptions/%{subscription_id}/providers/Microsoft.Compute/virtualMachines Get Lists all of the virtual machines in the specified subscription. Use the nextLink property in the response to get the next page of virtual machines. VirtualMachines_ListAll
    Update /subscriptions/%{subscription_id}/resourceGroups/%{resource_group_name}/providers/Microsoft.Compute/virtualMachines/%{vm_name} Put The operation to create or update a virtual machine. VirtualMachines_CreateOrUpdate
    Delete /subscriptions/%{subscription_id}/resourceGroups/%{resource_group_name}/providers/Microsoft.Compute/virtualMachines/%{vm_name} Delete The operation to delete a virtual machine. VirtualMachines_Delete