Share via


VirtualMachine Class

Definition

VirtualMachine.

public class VirtualMachine : Azure.Provisioning.Primitives.ProvisionableResource
type VirtualMachine = class
    inherit ProvisionableResource
Public Class VirtualMachine
Inherits ProvisionableResource
Inheritance

Constructors

Name Description
VirtualMachine(String, String)

Creates a new VirtualMachine.

Properties

Name Description
AdditionalCapabilities

Specifies additional capabilities enabled or disabled on the virtual machine.

AvailabilitySetId

Gets or sets Id.

BicepIdentifier

Gets or sets the the Bicep identifier name of the resource. This can be used to refer to the resource in expressions, but is not the Azure name of the resource. This value can contain letters, numbers, and underscores.

(Inherited from NamedProvisionableConstruct)
BicepMetadata

Gets the Bicep metadata for this resource, including decorators and conditions.

(Inherited from ProvisionableResource)
BillingMaxPrice

Specifies the maximum price you are willing to pay for a Azure Spot VM/VMSS. This price is in US Dollars. <br><br> 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. <br><br> 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. <br><br> Possible values are: <br><br> - Any decimal value greater than zero. Example: 0.01538 <br><br> -1 – indicates default price to be up-to on-demand. <br><br> 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. <br><br>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. NOTE: If storageUri is being specified then ensure that the storage account is in the same region and subscription as the VM. You can easily view the output of your console log. Azure also enables you to see a screenshot of the VM from the hypervisor.

CapacityReservationGroupId

Gets or sets Id.

DependsOn

Declares explicit dependencies on other resources.

(Inherited from ProvisionableResource)
ETag

Etag is property returned in Create/Update/Get response of the VM, so that customer can supply it in the header to ensure optimistic updates.

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.

ExtendedLocation

The extended location of the Virtual Machine.

ExtensionsTimeBudget

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.

GalleryApplications

Specifies the gallery applications that should be made available to the VM/VMSS.

HardwareProfile

Specifies the hardware settings for the virtual machine.

HostGroupId

Gets or sets Id.

HostId

Gets or sets Id.

Id

Gets the Id.

Identity

The identity of the virtual machine, if configured.

InstanceView

The virtual machine instance view.

IsExistingResource

Gets whether this is referencing an existing resource or we're defining a new resource.

(Inherited from ProvisionableResource)
LicenseType

Specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see Azure Hybrid Use Benefit for Windows Server <br><br> Azure Hybrid Use Benefit for Linux Server <br><br> Minimum api-version: 2015-06-15.

Location

Gets or sets the Location.

ManagedBy

ManagedBy is set to Virtual Machine Scale Set(VMSS) flex ARM resourceID, if the VM is part of the VMSS. This property is used by platform for internal resource group delete optimization.

Name

The name of the virtual machine.

NetworkProfile

Specifies the network interfaces of the virtual machine.

OSProfile

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

Placement

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

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.

PlatformFaultDomain

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' greater than 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.

Priority

Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01.

ProvisioningState

The provisioning state, which only appears in the response.

ProximityPlacementGroupId

Gets or sets Id.

Resources

The virtual machine child extension resources.

ResourceType

Gets the type of the resource.

(Inherited from ProvisionableResource)
ResourceVersion

Gets or sets the version of the resource.

(Inherited from ProvisionableResource)
ScheduledEventsPolicy

Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the virtual machine.

ScheduledEventsProfile

Specifies Scheduled Event related configurations.

SecurityProfile

Specifies the Security related profile settings for the virtual machine.

StorageProfile

Specifies the storage settings for the virtual machine disks.

SystemData

Gets the SystemData.

Tags

Gets or sets the Tags.

TimeCreated

Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01.

UserData

UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01.

VirtualMachineScaleSetId

Gets or sets Id.

VmId

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.

Zones

The availability zones.

Methods

Name Description
AssignOrReplace<T>(T, T) (Inherited from ProvisionableConstruct)
Build(ProvisioningBuildOptions)

Compose the resource into a provisioning plan that can be saved as Bicep or deployed directly.

(Inherited from ProvisionableResource)
Compile()

Compile the resource into a set of Bicep statements.

(Inherited from ProvisionableResource)
DefineDictionaryProperty<T>(String, String[], Boolean, Boolean) (Inherited from ProvisionableConstruct)
DefineListProperty<T>(String, String[], Boolean, Boolean) (Inherited from ProvisionableConstruct)
DefineModelProperty<T>(String, String[], Boolean, Boolean, Boolean, String) (Inherited from ProvisionableConstruct)
DefineModelProperty<T>(String, String[], T, Boolean, Boolean, Boolean, String) (Inherited from ProvisionableConstruct)
DefineProperty<T>(String, String[], Boolean, Boolean, Boolean, BicepValue<T>, String) (Inherited from ProvisionableConstruct)
DefineProvisionableProperties()

Define all the provisionable properties of VirtualMachine.

DefineResource<T>(String, String[], Boolean, Boolean, T) (Inherited from ProvisionableResource)
FromExisting(String, String)

Creates a reference to an existing VirtualMachine.

GetProvisionableResources()

Get any resources represented by this object. This will typically only be the object itself for everything but Infrastructure.

(Inherited from Provisionable)
Initialize()

Initialize this construct.

(Inherited from ProvisionableConstruct)
OverrideWithExpression(BicepExpression) (Inherited from ProvisionableConstruct)
Resolve(ProvisioningBuildOptions)

Resolve any resources or properties that were not explicitly specified.

(Inherited from ProvisionableConstruct)
Validate(ProvisioningBuildOptions)

Validate the presence of any required members.

(Inherited from ProvisionableResource)

Explicit Interface Implementations

Name Description
IBicepValue.Assign(IBicepValue)

Assign a value to this property.

(Inherited from ProvisionableConstruct)
IBicepValue.Compile()

Compile this value to a Bicep expression.

(Inherited from ProvisionableConstruct)
IBicepValue.Expression

Gets the expression for this value if it's not a literal.

(Inherited from ProvisionableConstruct)
IBicepValue.IsEmpty

Gets whether this value is unset or empty.

(Inherited from ProvisionableConstruct)
IBicepValue.IsOutput

Tracks whether this is an output only property.

(Inherited from ProvisionableConstruct)
IBicepValue.IsRequired

Tracks whether this property is required.

(Inherited from ProvisionableConstruct)
IBicepValue.IsSecure

Tracks whether this contains a secure value.

(Inherited from ProvisionableConstruct)
IBicepValue.Kind

Gets the kind of this value (a literal value, an expression, or it's unset).

(Inherited from ProvisionableConstruct)
IBicepValue.LiteralValue

Get the value of this expression, if it's literal.

(Inherited from ProvisionableConstruct)
IBicepValue.Self

Gets information about where this value was defined.

(Inherited from ProvisionableConstruct)
IBicepValue.SetReadOnly()

Make this value readonly.

(Inherited from ProvisionableConstruct)
IBicepValue.Source

Gets information about where this value was assigned from.

(Inherited from ProvisionableConstruct)

Extension Methods

Name Description
ToBicepExpression(IBicepValue)

Convert a IBicepValue into a BicepExpression by its reference to represent its hierarchy.

Applies to