---
type: resource-type
title: VirtualMachine
description: azure resource type Microsoft.Compute/virtualMachines
name: VirtualMachine
lexicon: azure
resource_type: Microsoft.Compute/virtualMachines
---
`Microsoft.Compute/virtualMachines`, a resource type of the azure lexicon.

## Properties

- `name` (`string`, required): The name of the virtual machine.
- `properties` (`VirtualMachine_VirtualMachineProperties`, required): Describes the properties of a Virtual Machine.
- `extendedLocation` (`VirtualMachine_ExtendedLocation`, optional): The extended location of the Virtual Machine.
- `identity` (`VirtualMachine_VirtualMachineIdentity`, optional): The identity of the virtual machine, if configured.
- `location` (`string`, optional): The geo-location where the resource lives
- `placement` (`VirtualMachine_Placement`, optional): Placement section specifies the user-defined constraints for virtual machine hardware placement. This property cannot be changed once VM is provisioned. Minimum api-version: 2024-11-01.
- `plan` (`VirtualMachine_Plan`, optional): 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**.
- `resources` (`any[]`, optional)
- `tags` (`Record<string, unknown>`, optional): Resource tags.
- `zones` (`string[]`, optional): The availability zones.

## Attributes

- `id`
- `provisioningState`
- `vmId`

## Governed by

- [AZR023](/rules/AZR023.md): VM missing managed disk — use managed disks for better reliability and management
- [AZR024](/rules/AZR024.md): VM missing boot diagnostics — enable for troubleshooting startup failures
