1. Packages
  2. Azure Native
  3. API Docs
  4. compute
  5. VirtualMachine
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.44.1 published on Thursday, Jun 6, 2024 by Pulumi

azure-native.compute.VirtualMachine

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.44.1 published on Thursday, Jun 6, 2024 by Pulumi

    Describes a Virtual Machine. Azure REST API version: 2023-03-01. Prior API version in Azure Native 1.x: 2021-03-01.

    Other available API versions: 2023-07-01, 2023-09-01, 2024-03-01.

    Example Usage

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

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var virtualMachine = new AzureNative.Compute.VirtualMachine("virtualMachine", new()
        {
            HardwareProfile = new AzureNative.Compute.Inputs.HardwareProfileArgs
            {
                VmSize = AzureNative.Compute.VirtualMachineSizeTypes.Standard_D2s_v3,
            },
            Location = "westus",
            NetworkProfile = new AzureNative.Compute.Inputs.NetworkProfileArgs
            {
                NetworkInterfaces = new[]
                {
                    new AzureNative.Compute.Inputs.NetworkInterfaceReferenceArgs
                    {
                        Id = "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                        Primary = true,
                    },
                },
            },
            OsProfile = new AzureNative.Compute.Inputs.OSProfileArgs
            {
                AdminPassword = "{your-password}",
                AdminUsername = "{your-username}",
                ComputerName = "myVM",
                LinuxConfiguration = new AzureNative.Compute.Inputs.LinuxConfigurationArgs
                {
                    PatchSettings = new AzureNative.Compute.Inputs.LinuxPatchSettingsArgs
                    {
                        AssessmentMode = AzureNative.Compute.LinuxPatchAssessmentMode.ImageDefault,
                    },
                    ProvisionVMAgent = true,
                },
            },
            ResourceGroupName = "myResourceGroup",
            StorageProfile = new AzureNative.Compute.Inputs.StorageProfileArgs
            {
                ImageReference = new AzureNative.Compute.Inputs.ImageReferenceArgs
                {
                    Offer = "UbuntuServer",
                    Publisher = "Canonical",
                    Sku = "16.04-LTS",
                    Version = "latest",
                },
                OsDisk = new AzureNative.Compute.Inputs.OSDiskArgs
                {
                    Caching = AzureNative.Compute.CachingTypes.ReadWrite,
                    CreateOption = AzureNative.Compute.DiskCreateOptionTypes.FromImage,
                    ManagedDisk = new AzureNative.Compute.Inputs.ManagedDiskParametersArgs
                    {
                        StorageAccountType = AzureNative.Compute.StorageAccountTypes.Premium_LRS,
                    },
                    Name = "myVMosdisk",
                },
            },
            VmName = "myVM",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewVirtualMachine(ctx, "virtualMachine", &compute.VirtualMachineArgs{
    			HardwareProfile: &compute.HardwareProfileArgs{
    				VmSize: pulumi.String(compute.VirtualMachineSizeTypes_Standard_D2s_v3),
    			},
    			Location: pulumi.String("westus"),
    			NetworkProfile: &compute.NetworkProfileArgs{
    				NetworkInterfaces: compute.NetworkInterfaceReferenceArray{
    					&compute.NetworkInterfaceReferenceArgs{
    						Id:      pulumi.String("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"),
    						Primary: pulumi.Bool(true),
    					},
    				},
    			},
    			OsProfile: &compute.OSProfileArgs{
    				AdminPassword: pulumi.String("{your-password}"),
    				AdminUsername: pulumi.String("{your-username}"),
    				ComputerName:  pulumi.String("myVM"),
    				LinuxConfiguration: &compute.LinuxConfigurationArgs{
    					PatchSettings: &compute.LinuxPatchSettingsArgs{
    						AssessmentMode: pulumi.String(compute.LinuxPatchAssessmentModeImageDefault),
    					},
    					ProvisionVMAgent: pulumi.Bool(true),
    				},
    			},
    			ResourceGroupName: pulumi.String("myResourceGroup"),
    			StorageProfile: &compute.StorageProfileArgs{
    				ImageReference: &compute.ImageReferenceArgs{
    					Offer:     pulumi.String("UbuntuServer"),
    					Publisher: pulumi.String("Canonical"),
    					Sku:       pulumi.String("16.04-LTS"),
    					Version:   pulumi.String("latest"),
    				},
    				OsDisk: &compute.OSDiskArgs{
    					Caching:      compute.CachingTypesReadWrite,
    					CreateOption: pulumi.String(compute.DiskCreateOptionTypesFromImage),
    					ManagedDisk: &compute.ManagedDiskParametersArgs{
    						StorageAccountType: pulumi.String(compute.StorageAccountTypes_Premium_LRS),
    					},
    					Name: pulumi.String("myVMosdisk"),
    				},
    			},
    			VmName: pulumi.String("myVM"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.compute.VirtualMachine;
    import com.pulumi.azurenative.compute.VirtualMachineArgs;
    import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
    import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
    import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
    import com.pulumi.azurenative.compute.inputs.LinuxConfigurationArgs;
    import com.pulumi.azurenative.compute.inputs.LinuxPatchSettingsArgs;
    import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
    import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
    import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
    import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
                .hardwareProfile(HardwareProfileArgs.builder()
                    .vmSize("Standard_D2s_v3")
                    .build())
                .location("westus")
                .networkProfile(NetworkProfileArgs.builder()
                    .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
                        .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
                        .primary(true)
                        .build())
                    .build())
                .osProfile(OSProfileArgs.builder()
                    .adminPassword("{your-password}")
                    .adminUsername("{your-username}")
                    .computerName("myVM")
                    .linuxConfiguration(LinuxConfigurationArgs.builder()
                        .patchSettings(LinuxPatchSettingsArgs.builder()
                            .assessmentMode("ImageDefault")
                            .build())
                        .provisionVMAgent(true)
                        .build())
                    .build())
                .resourceGroupName("myResourceGroup")
                .storageProfile(StorageProfileArgs.builder()
                    .imageReference(ImageReferenceArgs.builder()
                        .offer("UbuntuServer")
                        .publisher("Canonical")
                        .sku("16.04-LTS")
                        .version("latest")
                        .build())
                    .osDisk(OSDiskArgs.builder()
                        .caching("ReadWrite")
                        .createOption("FromImage")
                        .managedDisk(ManagedDiskParametersArgs.builder()
                            .storageAccountType("Premium_LRS")
                            .build())
                        .name("myVMosdisk")
                        .build())
                    .build())
                .vmName("myVM")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    virtual_machine = azure_native.compute.VirtualMachine("virtualMachine",
        hardware_profile=azure_native.compute.HardwareProfileArgs(
            vm_size=azure_native.compute.VirtualMachineSizeTypes.STANDARD_D2S_V3,
        ),
        location="westus",
        network_profile=azure_native.compute.NetworkProfileArgs(
            network_interfaces=[azure_native.compute.NetworkInterfaceReferenceArgs(
                id="/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary=True,
            )],
        ),
        os_profile=azure_native.compute.OSProfileArgs(
            admin_password="{your-password}",
            admin_username="{your-username}",
            computer_name="myVM",
            linux_configuration=azure_native.compute.LinuxConfigurationArgs(
                patch_settings=azure_native.compute.LinuxPatchSettingsArgs(
                    assessment_mode=azure_native.compute.LinuxPatchAssessmentMode.IMAGE_DEFAULT,
                ),
                provision_vm_agent=True,
            ),
        ),
        resource_group_name="myResourceGroup",
        storage_profile=azure_native.compute.StorageProfileArgs(
            image_reference=azure_native.compute.ImageReferenceArgs(
                offer="UbuntuServer",
                publisher="Canonical",
                sku="16.04-LTS",
                version="latest",
            ),
            os_disk=azure_native.compute.OSDiskArgs(
                caching=azure_native.compute.CachingTypes.READ_WRITE,
                create_option=azure_native.compute.DiskCreateOptionTypes.FROM_IMAGE,
                managed_disk=azure_native.compute.ManagedDiskParametersArgs(
                    storage_account_type=azure_native.compute.StorageAccountTypes.PREMIUM_LRS,
                ),
                name="myVMosdisk",
            ),
        ),
        vm_name="myVM")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const virtualMachine = new azure_native.compute.VirtualMachine("virtualMachine", {
        hardwareProfile: {
            vmSize: azure_native.compute.VirtualMachineSizeTypes.Standard_D2s_v3,
        },
        location: "westus",
        networkProfile: {
            networkInterfaces: [{
                id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary: true,
            }],
        },
        osProfile: {
            adminPassword: "{your-password}",
            adminUsername: "{your-username}",
            computerName: "myVM",
            linuxConfiguration: {
                patchSettings: {
                    assessmentMode: azure_native.compute.LinuxPatchAssessmentMode.ImageDefault,
                },
                provisionVMAgent: true,
            },
        },
        resourceGroupName: "myResourceGroup",
        storageProfile: {
            imageReference: {
                offer: "UbuntuServer",
                publisher: "Canonical",
                sku: "16.04-LTS",
                version: "latest",
            },
            osDisk: {
                caching: azure_native.compute.CachingTypes.ReadWrite,
                createOption: azure_native.compute.DiskCreateOptionTypes.FromImage,
                managedDisk: {
                    storageAccountType: azure_native.compute.StorageAccountTypes.Premium_LRS,
                },
                name: "myVMosdisk",
            },
        },
        vmName: "myVM",
    });
    
    resources:
      virtualMachine:
        type: azure-native:compute:VirtualMachine
        properties:
          hardwareProfile:
            vmSize: Standard_D2s_v3
          location: westus
          networkProfile:
            networkInterfaces:
              - id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}
                primary: true
          osProfile:
            adminPassword: '{your-password}'
            adminUsername: '{your-username}'
            computerName: myVM
            linuxConfiguration:
              patchSettings:
                assessmentMode: ImageDefault
              provisionVMAgent: true
          resourceGroupName: myResourceGroup
          storageProfile:
            imageReference:
              offer: UbuntuServer
              publisher: Canonical
              sku: 16.04-LTS
              version: latest
            osDisk:
              caching: ReadWrite
              createOption: FromImage
              managedDisk:
                storageAccountType: Premium_LRS
              name: myVMosdisk
          vmName: myVM
    

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

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var virtualMachine = new AzureNative.Compute.VirtualMachine("virtualMachine", new()
        {
            HardwareProfile = new AzureNative.Compute.Inputs.HardwareProfileArgs
            {
                VmSize = AzureNative.Compute.VirtualMachineSizeTypes.Standard_D2s_v3,
            },
            Location = "westus",
            NetworkProfile = new AzureNative.Compute.Inputs.NetworkProfileArgs
            {
                NetworkInterfaces = new[]
                {
                    new AzureNative.Compute.Inputs.NetworkInterfaceReferenceArgs
                    {
                        Id = "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                        Primary = true,
                    },
                },
            },
            OsProfile = new AzureNative.Compute.Inputs.OSProfileArgs
            {
                AdminPassword = "{your-password}",
                AdminUsername = "{your-username}",
                ComputerName = "myVM",
                LinuxConfiguration = new AzureNative.Compute.Inputs.LinuxConfigurationArgs
                {
                    PatchSettings = new AzureNative.Compute.Inputs.LinuxPatchSettingsArgs
                    {
                        AssessmentMode = AzureNative.Compute.LinuxPatchAssessmentMode.AutomaticByPlatform,
                        AutomaticByPlatformSettings = new AzureNative.Compute.Inputs.LinuxVMGuestPatchAutomaticByPlatformSettingsArgs
                        {
                            BypassPlatformSafetyChecksOnUserSchedule = true,
                            RebootSetting = AzureNative.Compute.LinuxVMGuestPatchAutomaticByPlatformRebootSetting.Never,
                        },
                        PatchMode = AzureNative.Compute.LinuxVMGuestPatchMode.AutomaticByPlatform,
                    },
                    ProvisionVMAgent = true,
                },
            },
            ResourceGroupName = "myResourceGroup",
            StorageProfile = new AzureNative.Compute.Inputs.StorageProfileArgs
            {
                ImageReference = new AzureNative.Compute.Inputs.ImageReferenceArgs
                {
                    Offer = "UbuntuServer",
                    Publisher = "Canonical",
                    Sku = "16.04-LTS",
                    Version = "latest",
                },
                OsDisk = new AzureNative.Compute.Inputs.OSDiskArgs
                {
                    Caching = AzureNative.Compute.CachingTypes.ReadWrite,
                    CreateOption = AzureNative.Compute.DiskCreateOptionTypes.FromImage,
                    ManagedDisk = new AzureNative.Compute.Inputs.ManagedDiskParametersArgs
                    {
                        StorageAccountType = AzureNative.Compute.StorageAccountTypes.Premium_LRS,
                    },
                    Name = "myVMosdisk",
                },
            },
            VmName = "myVM",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewVirtualMachine(ctx, "virtualMachine", &compute.VirtualMachineArgs{
    			HardwareProfile: &compute.HardwareProfileArgs{
    				VmSize: pulumi.String(compute.VirtualMachineSizeTypes_Standard_D2s_v3),
    			},
    			Location: pulumi.String("westus"),
    			NetworkProfile: &compute.NetworkProfileArgs{
    				NetworkInterfaces: compute.NetworkInterfaceReferenceArray{
    					&compute.NetworkInterfaceReferenceArgs{
    						Id:      pulumi.String("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"),
    						Primary: pulumi.Bool(true),
    					},
    				},
    			},
    			OsProfile: &compute.OSProfileArgs{
    				AdminPassword: pulumi.String("{your-password}"),
    				AdminUsername: pulumi.String("{your-username}"),
    				ComputerName:  pulumi.String("myVM"),
    				LinuxConfiguration: &compute.LinuxConfigurationArgs{
    					PatchSettings: &compute.LinuxPatchSettingsArgs{
    						AssessmentMode: pulumi.String(compute.LinuxPatchAssessmentModeAutomaticByPlatform),
    						AutomaticByPlatformSettings: &compute.LinuxVMGuestPatchAutomaticByPlatformSettingsArgs{
    							BypassPlatformSafetyChecksOnUserSchedule: pulumi.Bool(true),
    							RebootSetting:                            pulumi.String(compute.LinuxVMGuestPatchAutomaticByPlatformRebootSettingNever),
    						},
    						PatchMode: pulumi.String(compute.LinuxVMGuestPatchModeAutomaticByPlatform),
    					},
    					ProvisionVMAgent: pulumi.Bool(true),
    				},
    			},
    			ResourceGroupName: pulumi.String("myResourceGroup"),
    			StorageProfile: &compute.StorageProfileArgs{
    				ImageReference: &compute.ImageReferenceArgs{
    					Offer:     pulumi.String("UbuntuServer"),
    					Publisher: pulumi.String("Canonical"),
    					Sku:       pulumi.String("16.04-LTS"),
    					Version:   pulumi.String("latest"),
    				},
    				OsDisk: &compute.OSDiskArgs{
    					Caching:      compute.CachingTypesReadWrite,
    					CreateOption: pulumi.String(compute.DiskCreateOptionTypesFromImage),
    					ManagedDisk: &compute.ManagedDiskParametersArgs{
    						StorageAccountType: pulumi.String(compute.StorageAccountTypes_Premium_LRS),
    					},
    					Name: pulumi.String("myVMosdisk"),
    				},
    			},
    			VmName: pulumi.String("myVM"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.compute.VirtualMachine;
    import com.pulumi.azurenative.compute.VirtualMachineArgs;
    import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
    import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
    import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
    import com.pulumi.azurenative.compute.inputs.LinuxConfigurationArgs;
    import com.pulumi.azurenative.compute.inputs.LinuxPatchSettingsArgs;
    import com.pulumi.azurenative.compute.inputs.LinuxVMGuestPatchAutomaticByPlatformSettingsArgs;
    import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
    import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
    import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
    import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
                .hardwareProfile(HardwareProfileArgs.builder()
                    .vmSize("Standard_D2s_v3")
                    .build())
                .location("westus")
                .networkProfile(NetworkProfileArgs.builder()
                    .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
                        .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
                        .primary(true)
                        .build())
                    .build())
                .osProfile(OSProfileArgs.builder()
                    .adminPassword("{your-password}")
                    .adminUsername("{your-username}")
                    .computerName("myVM")
                    .linuxConfiguration(LinuxConfigurationArgs.builder()
                        .patchSettings(LinuxPatchSettingsArgs.builder()
                            .assessmentMode("AutomaticByPlatform")
                            .automaticByPlatformSettings(LinuxVMGuestPatchAutomaticByPlatformSettingsArgs.builder()
                                .bypassPlatformSafetyChecksOnUserSchedule(true)
                                .rebootSetting("Never")
                                .build())
                            .patchMode("AutomaticByPlatform")
                            .build())
                        .provisionVMAgent(true)
                        .build())
                    .build())
                .resourceGroupName("myResourceGroup")
                .storageProfile(StorageProfileArgs.builder()
                    .imageReference(ImageReferenceArgs.builder()
                        .offer("UbuntuServer")
                        .publisher("Canonical")
                        .sku("16.04-LTS")
                        .version("latest")
                        .build())
                    .osDisk(OSDiskArgs.builder()
                        .caching("ReadWrite")
                        .createOption("FromImage")
                        .managedDisk(ManagedDiskParametersArgs.builder()
                            .storageAccountType("Premium_LRS")
                            .build())
                        .name("myVMosdisk")
                        .build())
                    .build())
                .vmName("myVM")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    virtual_machine = azure_native.compute.VirtualMachine("virtualMachine",
        hardware_profile=azure_native.compute.HardwareProfileArgs(
            vm_size=azure_native.compute.VirtualMachineSizeTypes.STANDARD_D2S_V3,
        ),
        location="westus",
        network_profile=azure_native.compute.NetworkProfileArgs(
            network_interfaces=[azure_native.compute.NetworkInterfaceReferenceArgs(
                id="/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary=True,
            )],
        ),
        os_profile=azure_native.compute.OSProfileArgs(
            admin_password="{your-password}",
            admin_username="{your-username}",
            computer_name="myVM",
            linux_configuration=azure_native.compute.LinuxConfigurationArgs(
                patch_settings=azure_native.compute.LinuxPatchSettingsArgs(
                    assessment_mode=azure_native.compute.LinuxPatchAssessmentMode.AUTOMATIC_BY_PLATFORM,
                    automatic_by_platform_settings=azure_native.compute.LinuxVMGuestPatchAutomaticByPlatformSettingsArgs(
                        bypass_platform_safety_checks_on_user_schedule=True,
                        reboot_setting=azure_native.compute.LinuxVMGuestPatchAutomaticByPlatformRebootSetting.NEVER,
                    ),
                    patch_mode=azure_native.compute.LinuxVMGuestPatchMode.AUTOMATIC_BY_PLATFORM,
                ),
                provision_vm_agent=True,
            ),
        ),
        resource_group_name="myResourceGroup",
        storage_profile=azure_native.compute.StorageProfileArgs(
            image_reference=azure_native.compute.ImageReferenceArgs(
                offer="UbuntuServer",
                publisher="Canonical",
                sku="16.04-LTS",
                version="latest",
            ),
            os_disk=azure_native.compute.OSDiskArgs(
                caching=azure_native.compute.CachingTypes.READ_WRITE,
                create_option=azure_native.compute.DiskCreateOptionTypes.FROM_IMAGE,
                managed_disk=azure_native.compute.ManagedDiskParametersArgs(
                    storage_account_type=azure_native.compute.StorageAccountTypes.PREMIUM_LRS,
                ),
                name="myVMosdisk",
            ),
        ),
        vm_name="myVM")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const virtualMachine = new azure_native.compute.VirtualMachine("virtualMachine", {
        hardwareProfile: {
            vmSize: azure_native.compute.VirtualMachineSizeTypes.Standard_D2s_v3,
        },
        location: "westus",
        networkProfile: {
            networkInterfaces: [{
                id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary: true,
            }],
        },
        osProfile: {
            adminPassword: "{your-password}",
            adminUsername: "{your-username}",
            computerName: "myVM",
            linuxConfiguration: {
                patchSettings: {
                    assessmentMode: azure_native.compute.LinuxPatchAssessmentMode.AutomaticByPlatform,
                    automaticByPlatformSettings: {
                        bypassPlatformSafetyChecksOnUserSchedule: true,
                        rebootSetting: azure_native.compute.LinuxVMGuestPatchAutomaticByPlatformRebootSetting.Never,
                    },
                    patchMode: azure_native.compute.LinuxVMGuestPatchMode.AutomaticByPlatform,
                },
                provisionVMAgent: true,
            },
        },
        resourceGroupName: "myResourceGroup",
        storageProfile: {
            imageReference: {
                offer: "UbuntuServer",
                publisher: "Canonical",
                sku: "16.04-LTS",
                version: "latest",
            },
            osDisk: {
                caching: azure_native.compute.CachingTypes.ReadWrite,
                createOption: azure_native.compute.DiskCreateOptionTypes.FromImage,
                managedDisk: {
                    storageAccountType: azure_native.compute.StorageAccountTypes.Premium_LRS,
                },
                name: "myVMosdisk",
            },
        },
        vmName: "myVM",
    });
    
    resources:
      virtualMachine:
        type: azure-native:compute:VirtualMachine
        properties:
          hardwareProfile:
            vmSize: Standard_D2s_v3
          location: westus
          networkProfile:
            networkInterfaces:
              - id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}
                primary: true
          osProfile:
            adminPassword: '{your-password}'
            adminUsername: '{your-username}'
            computerName: myVM
            linuxConfiguration:
              patchSettings:
                assessmentMode: AutomaticByPlatform
                automaticByPlatformSettings:
                  bypassPlatformSafetyChecksOnUserSchedule: true
                  rebootSetting: Never
                patchMode: AutomaticByPlatform
              provisionVMAgent: true
          resourceGroupName: myResourceGroup
          storageProfile:
            imageReference:
              offer: UbuntuServer
              publisher: Canonical
              sku: 16.04-LTS
              version: latest
            osDisk:
              caching: ReadWrite
              createOption: FromImage
              managedDisk:
                storageAccountType: Premium_LRS
              name: myVMosdisk
          vmName: myVM
    

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

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var virtualMachine = new AzureNative.Compute.VirtualMachine("virtualMachine", new()
        {
            HardwareProfile = new AzureNative.Compute.Inputs.HardwareProfileArgs
            {
                VmSize = AzureNative.Compute.VirtualMachineSizeTypes.Standard_D2s_v3,
            },
            Location = "westus",
            NetworkProfile = new AzureNative.Compute.Inputs.NetworkProfileArgs
            {
                NetworkInterfaces = new[]
                {
                    new AzureNative.Compute.Inputs.NetworkInterfaceReferenceArgs
                    {
                        Id = "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                        Primary = true,
                    },
                },
            },
            OsProfile = new AzureNative.Compute.Inputs.OSProfileArgs
            {
                AdminPassword = "{your-password}",
                AdminUsername = "{your-username}",
                ComputerName = "myVM",
                LinuxConfiguration = new AzureNative.Compute.Inputs.LinuxConfigurationArgs
                {
                    PatchSettings = new AzureNative.Compute.Inputs.LinuxPatchSettingsArgs
                    {
                        PatchMode = AzureNative.Compute.LinuxVMGuestPatchMode.ImageDefault,
                    },
                    ProvisionVMAgent = true,
                },
            },
            ResourceGroupName = "myResourceGroup",
            StorageProfile = new AzureNative.Compute.Inputs.StorageProfileArgs
            {
                ImageReference = new AzureNative.Compute.Inputs.ImageReferenceArgs
                {
                    Offer = "UbuntuServer",
                    Publisher = "Canonical",
                    Sku = "16.04-LTS",
                    Version = "latest",
                },
                OsDisk = new AzureNative.Compute.Inputs.OSDiskArgs
                {
                    Caching = AzureNative.Compute.CachingTypes.ReadWrite,
                    CreateOption = AzureNative.Compute.DiskCreateOptionTypes.FromImage,
                    ManagedDisk = new AzureNative.Compute.Inputs.ManagedDiskParametersArgs
                    {
                        StorageAccountType = AzureNative.Compute.StorageAccountTypes.Premium_LRS,
                    },
                    Name = "myVMosdisk",
                },
            },
            VmName = "myVM",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewVirtualMachine(ctx, "virtualMachine", &compute.VirtualMachineArgs{
    			HardwareProfile: &compute.HardwareProfileArgs{
    				VmSize: pulumi.String(compute.VirtualMachineSizeTypes_Standard_D2s_v3),
    			},
    			Location: pulumi.String("westus"),
    			NetworkProfile: &compute.NetworkProfileArgs{
    				NetworkInterfaces: compute.NetworkInterfaceReferenceArray{
    					&compute.NetworkInterfaceReferenceArgs{
    						Id:      pulumi.String("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"),
    						Primary: pulumi.Bool(true),
    					},
    				},
    			},
    			OsProfile: &compute.OSProfileArgs{
    				AdminPassword: pulumi.String("{your-password}"),
    				AdminUsername: pulumi.String("{your-username}"),
    				ComputerName:  pulumi.String("myVM"),
    				LinuxConfiguration: &compute.LinuxConfigurationArgs{
    					PatchSettings: &compute.LinuxPatchSettingsArgs{
    						PatchMode: pulumi.String(compute.LinuxVMGuestPatchModeImageDefault),
    					},
    					ProvisionVMAgent: pulumi.Bool(true),
    				},
    			},
    			ResourceGroupName: pulumi.String("myResourceGroup"),
    			StorageProfile: &compute.StorageProfileArgs{
    				ImageReference: &compute.ImageReferenceArgs{
    					Offer:     pulumi.String("UbuntuServer"),
    					Publisher: pulumi.String("Canonical"),
    					Sku:       pulumi.String("16.04-LTS"),
    					Version:   pulumi.String("latest"),
    				},
    				OsDisk: &compute.OSDiskArgs{
    					Caching:      compute.CachingTypesReadWrite,
    					CreateOption: pulumi.String(compute.DiskCreateOptionTypesFromImage),
    					ManagedDisk: &compute.ManagedDiskParametersArgs{
    						StorageAccountType: pulumi.String(compute.StorageAccountTypes_Premium_LRS),
    					},
    					Name: pulumi.String("myVMosdisk"),
    				},
    			},
    			VmName: pulumi.String("myVM"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.compute.VirtualMachine;
    import com.pulumi.azurenative.compute.VirtualMachineArgs;
    import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
    import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
    import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
    import com.pulumi.azurenative.compute.inputs.LinuxConfigurationArgs;
    import com.pulumi.azurenative.compute.inputs.LinuxPatchSettingsArgs;
    import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
    import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
    import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
    import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
                .hardwareProfile(HardwareProfileArgs.builder()
                    .vmSize("Standard_D2s_v3")
                    .build())
                .location("westus")
                .networkProfile(NetworkProfileArgs.builder()
                    .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
                        .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
                        .primary(true)
                        .build())
                    .build())
                .osProfile(OSProfileArgs.builder()
                    .adminPassword("{your-password}")
                    .adminUsername("{your-username}")
                    .computerName("myVM")
                    .linuxConfiguration(LinuxConfigurationArgs.builder()
                        .patchSettings(LinuxPatchSettingsArgs.builder()
                            .patchMode("ImageDefault")
                            .build())
                        .provisionVMAgent(true)
                        .build())
                    .build())
                .resourceGroupName("myResourceGroup")
                .storageProfile(StorageProfileArgs.builder()
                    .imageReference(ImageReferenceArgs.builder()
                        .offer("UbuntuServer")
                        .publisher("Canonical")
                        .sku("16.04-LTS")
                        .version("latest")
                        .build())
                    .osDisk(OSDiskArgs.builder()
                        .caching("ReadWrite")
                        .createOption("FromImage")
                        .managedDisk(ManagedDiskParametersArgs.builder()
                            .storageAccountType("Premium_LRS")
                            .build())
                        .name("myVMosdisk")
                        .build())
                    .build())
                .vmName("myVM")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    virtual_machine = azure_native.compute.VirtualMachine("virtualMachine",
        hardware_profile=azure_native.compute.HardwareProfileArgs(
            vm_size=azure_native.compute.VirtualMachineSizeTypes.STANDARD_D2S_V3,
        ),
        location="westus",
        network_profile=azure_native.compute.NetworkProfileArgs(
            network_interfaces=[azure_native.compute.NetworkInterfaceReferenceArgs(
                id="/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary=True,
            )],
        ),
        os_profile=azure_native.compute.OSProfileArgs(
            admin_password="{your-password}",
            admin_username="{your-username}",
            computer_name="myVM",
            linux_configuration=azure_native.compute.LinuxConfigurationArgs(
                patch_settings=azure_native.compute.LinuxPatchSettingsArgs(
                    patch_mode=azure_native.compute.LinuxVMGuestPatchMode.IMAGE_DEFAULT,
                ),
                provision_vm_agent=True,
            ),
        ),
        resource_group_name="myResourceGroup",
        storage_profile=azure_native.compute.StorageProfileArgs(
            image_reference=azure_native.compute.ImageReferenceArgs(
                offer="UbuntuServer",
                publisher="Canonical",
                sku="16.04-LTS",
                version="latest",
            ),
            os_disk=azure_native.compute.OSDiskArgs(
                caching=azure_native.compute.CachingTypes.READ_WRITE,
                create_option=azure_native.compute.DiskCreateOptionTypes.FROM_IMAGE,
                managed_disk=azure_native.compute.ManagedDiskParametersArgs(
                    storage_account_type=azure_native.compute.StorageAccountTypes.PREMIUM_LRS,
                ),
                name="myVMosdisk",
            ),
        ),
        vm_name="myVM")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const virtualMachine = new azure_native.compute.VirtualMachine("virtualMachine", {
        hardwareProfile: {
            vmSize: azure_native.compute.VirtualMachineSizeTypes.Standard_D2s_v3,
        },
        location: "westus",
        networkProfile: {
            networkInterfaces: [{
                id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary: true,
            }],
        },
        osProfile: {
            adminPassword: "{your-password}",
            adminUsername: "{your-username}",
            computerName: "myVM",
            linuxConfiguration: {
                patchSettings: {
                    patchMode: azure_native.compute.LinuxVMGuestPatchMode.ImageDefault,
                },
                provisionVMAgent: true,
            },
        },
        resourceGroupName: "myResourceGroup",
        storageProfile: {
            imageReference: {
                offer: "UbuntuServer",
                publisher: "Canonical",
                sku: "16.04-LTS",
                version: "latest",
            },
            osDisk: {
                caching: azure_native.compute.CachingTypes.ReadWrite,
                createOption: azure_native.compute.DiskCreateOptionTypes.FromImage,
                managedDisk: {
                    storageAccountType: azure_native.compute.StorageAccountTypes.Premium_LRS,
                },
                name: "myVMosdisk",
            },
        },
        vmName: "myVM",
    });
    
    resources:
      virtualMachine:
        type: azure-native:compute:VirtualMachine
        properties:
          hardwareProfile:
            vmSize: Standard_D2s_v3
          location: westus
          networkProfile:
            networkInterfaces:
              - id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}
                primary: true
          osProfile:
            adminPassword: '{your-password}'
            adminUsername: '{your-username}'
            computerName: myVM
            linuxConfiguration:
              patchSettings:
                patchMode: ImageDefault
              provisionVMAgent: true
          resourceGroupName: myResourceGroup
          storageProfile:
            imageReference:
              offer: UbuntuServer
              publisher: Canonical
              sku: 16.04-LTS
              version: latest
            osDisk:
              caching: ReadWrite
              createOption: FromImage
              managedDisk:
                storageAccountType: Premium_LRS
              name: myVMosdisk
          vmName: myVM
    

    Create a Linux vm with a patch settings patchMode and assessmentMode set to AutomaticByPlatform.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var virtualMachine = new AzureNative.Compute.VirtualMachine("virtualMachine", new()
        {
            HardwareProfile = new AzureNative.Compute.Inputs.HardwareProfileArgs
            {
                VmSize = AzureNative.Compute.VirtualMachineSizeTypes.Standard_D2s_v3,
            },
            Location = "westus",
            NetworkProfile = new AzureNative.Compute.Inputs.NetworkProfileArgs
            {
                NetworkInterfaces = new[]
                {
                    new AzureNative.Compute.Inputs.NetworkInterfaceReferenceArgs
                    {
                        Id = "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                        Primary = true,
                    },
                },
            },
            OsProfile = new AzureNative.Compute.Inputs.OSProfileArgs
            {
                AdminPassword = "{your-password}",
                AdminUsername = "{your-username}",
                ComputerName = "myVM",
                LinuxConfiguration = new AzureNative.Compute.Inputs.LinuxConfigurationArgs
                {
                    PatchSettings = new AzureNative.Compute.Inputs.LinuxPatchSettingsArgs
                    {
                        AssessmentMode = AzureNative.Compute.LinuxPatchAssessmentMode.AutomaticByPlatform,
                        PatchMode = AzureNative.Compute.LinuxVMGuestPatchMode.AutomaticByPlatform,
                    },
                    ProvisionVMAgent = true,
                },
            },
            ResourceGroupName = "myResourceGroup",
            StorageProfile = new AzureNative.Compute.Inputs.StorageProfileArgs
            {
                ImageReference = new AzureNative.Compute.Inputs.ImageReferenceArgs
                {
                    Offer = "UbuntuServer",
                    Publisher = "Canonical",
                    Sku = "16.04-LTS",
                    Version = "latest",
                },
                OsDisk = new AzureNative.Compute.Inputs.OSDiskArgs
                {
                    Caching = AzureNative.Compute.CachingTypes.ReadWrite,
                    CreateOption = AzureNative.Compute.DiskCreateOptionTypes.FromImage,
                    ManagedDisk = new AzureNative.Compute.Inputs.ManagedDiskParametersArgs
                    {
                        StorageAccountType = AzureNative.Compute.StorageAccountTypes.Premium_LRS,
                    },
                    Name = "myVMosdisk",
                },
            },
            VmName = "myVM",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewVirtualMachine(ctx, "virtualMachine", &compute.VirtualMachineArgs{
    			HardwareProfile: &compute.HardwareProfileArgs{
    				VmSize: pulumi.String(compute.VirtualMachineSizeTypes_Standard_D2s_v3),
    			},
    			Location: pulumi.String("westus"),
    			NetworkProfile: &compute.NetworkProfileArgs{
    				NetworkInterfaces: compute.NetworkInterfaceReferenceArray{
    					&compute.NetworkInterfaceReferenceArgs{
    						Id:      pulumi.String("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"),
    						Primary: pulumi.Bool(true),
    					},
    				},
    			},
    			OsProfile: &compute.OSProfileArgs{
    				AdminPassword: pulumi.String("{your-password}"),
    				AdminUsername: pulumi.String("{your-username}"),
    				ComputerName:  pulumi.String("myVM"),
    				LinuxConfiguration: &compute.LinuxConfigurationArgs{
    					PatchSettings: &compute.LinuxPatchSettingsArgs{
    						AssessmentMode: pulumi.String(compute.LinuxPatchAssessmentModeAutomaticByPlatform),
    						PatchMode:      pulumi.String(compute.LinuxVMGuestPatchModeAutomaticByPlatform),
    					},
    					ProvisionVMAgent: pulumi.Bool(true),
    				},
    			},
    			ResourceGroupName: pulumi.String("myResourceGroup"),
    			StorageProfile: &compute.StorageProfileArgs{
    				ImageReference: &compute.ImageReferenceArgs{
    					Offer:     pulumi.String("UbuntuServer"),
    					Publisher: pulumi.String("Canonical"),
    					Sku:       pulumi.String("16.04-LTS"),
    					Version:   pulumi.String("latest"),
    				},
    				OsDisk: &compute.OSDiskArgs{
    					Caching:      compute.CachingTypesReadWrite,
    					CreateOption: pulumi.String(compute.DiskCreateOptionTypesFromImage),
    					ManagedDisk: &compute.ManagedDiskParametersArgs{
    						StorageAccountType: pulumi.String(compute.StorageAccountTypes_Premium_LRS),
    					},
    					Name: pulumi.String("myVMosdisk"),
    				},
    			},
    			VmName: pulumi.String("myVM"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.compute.VirtualMachine;
    import com.pulumi.azurenative.compute.VirtualMachineArgs;
    import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
    import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
    import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
    import com.pulumi.azurenative.compute.inputs.LinuxConfigurationArgs;
    import com.pulumi.azurenative.compute.inputs.LinuxPatchSettingsArgs;
    import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
    import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
    import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
    import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
                .hardwareProfile(HardwareProfileArgs.builder()
                    .vmSize("Standard_D2s_v3")
                    .build())
                .location("westus")
                .networkProfile(NetworkProfileArgs.builder()
                    .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
                        .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
                        .primary(true)
                        .build())
                    .build())
                .osProfile(OSProfileArgs.builder()
                    .adminPassword("{your-password}")
                    .adminUsername("{your-username}")
                    .computerName("myVM")
                    .linuxConfiguration(LinuxConfigurationArgs.builder()
                        .patchSettings(LinuxPatchSettingsArgs.builder()
                            .assessmentMode("AutomaticByPlatform")
                            .patchMode("AutomaticByPlatform")
                            .build())
                        .provisionVMAgent(true)
                        .build())
                    .build())
                .resourceGroupName("myResourceGroup")
                .storageProfile(StorageProfileArgs.builder()
                    .imageReference(ImageReferenceArgs.builder()
                        .offer("UbuntuServer")
                        .publisher("Canonical")
                        .sku("16.04-LTS")
                        .version("latest")
                        .build())
                    .osDisk(OSDiskArgs.builder()
                        .caching("ReadWrite")
                        .createOption("FromImage")
                        .managedDisk(ManagedDiskParametersArgs.builder()
                            .storageAccountType("Premium_LRS")
                            .build())
                        .name("myVMosdisk")
                        .build())
                    .build())
                .vmName("myVM")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    virtual_machine = azure_native.compute.VirtualMachine("virtualMachine",
        hardware_profile=azure_native.compute.HardwareProfileArgs(
            vm_size=azure_native.compute.VirtualMachineSizeTypes.STANDARD_D2S_V3,
        ),
        location="westus",
        network_profile=azure_native.compute.NetworkProfileArgs(
            network_interfaces=[azure_native.compute.NetworkInterfaceReferenceArgs(
                id="/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary=True,
            )],
        ),
        os_profile=azure_native.compute.OSProfileArgs(
            admin_password="{your-password}",
            admin_username="{your-username}",
            computer_name="myVM",
            linux_configuration=azure_native.compute.LinuxConfigurationArgs(
                patch_settings=azure_native.compute.LinuxPatchSettingsArgs(
                    assessment_mode=azure_native.compute.LinuxPatchAssessmentMode.AUTOMATIC_BY_PLATFORM,
                    patch_mode=azure_native.compute.LinuxVMGuestPatchMode.AUTOMATIC_BY_PLATFORM,
                ),
                provision_vm_agent=True,
            ),
        ),
        resource_group_name="myResourceGroup",
        storage_profile=azure_native.compute.StorageProfileArgs(
            image_reference=azure_native.compute.ImageReferenceArgs(
                offer="UbuntuServer",
                publisher="Canonical",
                sku="16.04-LTS",
                version="latest",
            ),
            os_disk=azure_native.compute.OSDiskArgs(
                caching=azure_native.compute.CachingTypes.READ_WRITE,
                create_option=azure_native.compute.DiskCreateOptionTypes.FROM_IMAGE,
                managed_disk=azure_native.compute.ManagedDiskParametersArgs(
                    storage_account_type=azure_native.compute.StorageAccountTypes.PREMIUM_LRS,
                ),
                name="myVMosdisk",
            ),
        ),
        vm_name="myVM")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const virtualMachine = new azure_native.compute.VirtualMachine("virtualMachine", {
        hardwareProfile: {
            vmSize: azure_native.compute.VirtualMachineSizeTypes.Standard_D2s_v3,
        },
        location: "westus",
        networkProfile: {
            networkInterfaces: [{
                id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary: true,
            }],
        },
        osProfile: {
            adminPassword: "{your-password}",
            adminUsername: "{your-username}",
            computerName: "myVM",
            linuxConfiguration: {
                patchSettings: {
                    assessmentMode: azure_native.compute.LinuxPatchAssessmentMode.AutomaticByPlatform,
                    patchMode: azure_native.compute.LinuxVMGuestPatchMode.AutomaticByPlatform,
                },
                provisionVMAgent: true,
            },
        },
        resourceGroupName: "myResourceGroup",
        storageProfile: {
            imageReference: {
                offer: "UbuntuServer",
                publisher: "Canonical",
                sku: "16.04-LTS",
                version: "latest",
            },
            osDisk: {
                caching: azure_native.compute.CachingTypes.ReadWrite,
                createOption: azure_native.compute.DiskCreateOptionTypes.FromImage,
                managedDisk: {
                    storageAccountType: azure_native.compute.StorageAccountTypes.Premium_LRS,
                },
                name: "myVMosdisk",
            },
        },
        vmName: "myVM",
    });
    
    resources:
      virtualMachine:
        type: azure-native:compute:VirtualMachine
        properties:
          hardwareProfile:
            vmSize: Standard_D2s_v3
          location: westus
          networkProfile:
            networkInterfaces:
              - id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}
                primary: true
          osProfile:
            adminPassword: '{your-password}'
            adminUsername: '{your-username}'
            computerName: myVM
            linuxConfiguration:
              patchSettings:
                assessmentMode: AutomaticByPlatform
                patchMode: AutomaticByPlatform
              provisionVMAgent: true
          resourceGroupName: myResourceGroup
          storageProfile:
            imageReference:
              offer: UbuntuServer
              publisher: Canonical
              sku: 16.04-LTS
              version: latest
            osDisk:
              caching: ReadWrite
              createOption: FromImage
              managedDisk:
                storageAccountType: Premium_LRS
              name: myVMosdisk
          vmName: myVM
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var virtualMachine = new AzureNative.Compute.VirtualMachine("virtualMachine", new()
        {
            HardwareProfile = new AzureNative.Compute.Inputs.HardwareProfileArgs
            {
                VmSize = AzureNative.Compute.VirtualMachineSizeTypes.Standard_D1_v2,
            },
            Location = "westus",
            NetworkProfile = new AzureNative.Compute.Inputs.NetworkProfileArgs
            {
                NetworkInterfaces = new[]
                {
                    new AzureNative.Compute.Inputs.NetworkInterfaceReferenceArgs
                    {
                        Id = "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                        Primary = true,
                    },
                },
            },
            OsProfile = new AzureNative.Compute.Inputs.OSProfileArgs
            {
                AdminPassword = "{your-password}",
                AdminUsername = "{your-username}",
                ComputerName = "myVM",
            },
            ResourceGroupName = "myResourceGroup",
            StorageProfile = new AzureNative.Compute.Inputs.StorageProfileArgs
            {
                ImageReference = new AzureNative.Compute.Inputs.ImageReferenceArgs
                {
                    CommunityGalleryImageId = "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName",
                },
                OsDisk = new AzureNative.Compute.Inputs.OSDiskArgs
                {
                    Caching = AzureNative.Compute.CachingTypes.ReadWrite,
                    CreateOption = AzureNative.Compute.DiskCreateOptionTypes.FromImage,
                    ManagedDisk = new AzureNative.Compute.Inputs.ManagedDiskParametersArgs
                    {
                        StorageAccountType = AzureNative.Compute.StorageAccountTypes.Standard_LRS,
                    },
                    Name = "myVMosdisk",
                },
            },
            VmName = "myVM",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewVirtualMachine(ctx, "virtualMachine", &compute.VirtualMachineArgs{
    			HardwareProfile: &compute.HardwareProfileArgs{
    				VmSize: pulumi.String(compute.VirtualMachineSizeTypes_Standard_D1_v2),
    			},
    			Location: pulumi.String("westus"),
    			NetworkProfile: &compute.NetworkProfileArgs{
    				NetworkInterfaces: compute.NetworkInterfaceReferenceArray{
    					&compute.NetworkInterfaceReferenceArgs{
    						Id:      pulumi.String("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"),
    						Primary: pulumi.Bool(true),
    					},
    				},
    			},
    			OsProfile: &compute.OSProfileArgs{
    				AdminPassword: pulumi.String("{your-password}"),
    				AdminUsername: pulumi.String("{your-username}"),
    				ComputerName:  pulumi.String("myVM"),
    			},
    			ResourceGroupName: pulumi.String("myResourceGroup"),
    			StorageProfile: &compute.StorageProfileArgs{
    				ImageReference: &compute.ImageReferenceArgs{
    					CommunityGalleryImageId: pulumi.String("/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName"),
    				},
    				OsDisk: &compute.OSDiskArgs{
    					Caching:      compute.CachingTypesReadWrite,
    					CreateOption: pulumi.String(compute.DiskCreateOptionTypesFromImage),
    					ManagedDisk: &compute.ManagedDiskParametersArgs{
    						StorageAccountType: pulumi.String(compute.StorageAccountTypes_Standard_LRS),
    					},
    					Name: pulumi.String("myVMosdisk"),
    				},
    			},
    			VmName: pulumi.String("myVM"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.compute.VirtualMachine;
    import com.pulumi.azurenative.compute.VirtualMachineArgs;
    import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
    import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
    import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
    import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
    import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
    import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
    import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
                .hardwareProfile(HardwareProfileArgs.builder()
                    .vmSize("Standard_D1_v2")
                    .build())
                .location("westus")
                .networkProfile(NetworkProfileArgs.builder()
                    .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
                        .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
                        .primary(true)
                        .build())
                    .build())
                .osProfile(OSProfileArgs.builder()
                    .adminPassword("{your-password}")
                    .adminUsername("{your-username}")
                    .computerName("myVM")
                    .build())
                .resourceGroupName("myResourceGroup")
                .storageProfile(StorageProfileArgs.builder()
                    .imageReference(ImageReferenceArgs.builder()
                        .communityGalleryImageId("/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName")
                        .build())
                    .osDisk(OSDiskArgs.builder()
                        .caching("ReadWrite")
                        .createOption("FromImage")
                        .managedDisk(ManagedDiskParametersArgs.builder()
                            .storageAccountType("Standard_LRS")
                            .build())
                        .name("myVMosdisk")
                        .build())
                    .build())
                .vmName("myVM")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    virtual_machine = azure_native.compute.VirtualMachine("virtualMachine",
        hardware_profile=azure_native.compute.HardwareProfileArgs(
            vm_size=azure_native.compute.VirtualMachineSizeTypes.STANDARD_D1_V2,
        ),
        location="westus",
        network_profile=azure_native.compute.NetworkProfileArgs(
            network_interfaces=[azure_native.compute.NetworkInterfaceReferenceArgs(
                id="/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary=True,
            )],
        ),
        os_profile=azure_native.compute.OSProfileArgs(
            admin_password="{your-password}",
            admin_username="{your-username}",
            computer_name="myVM",
        ),
        resource_group_name="myResourceGroup",
        storage_profile=azure_native.compute.StorageProfileArgs(
            image_reference=azure_native.compute.ImageReferenceArgs(
                community_gallery_image_id="/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName",
            ),
            os_disk=azure_native.compute.OSDiskArgs(
                caching=azure_native.compute.CachingTypes.READ_WRITE,
                create_option=azure_native.compute.DiskCreateOptionTypes.FROM_IMAGE,
                managed_disk=azure_native.compute.ManagedDiskParametersArgs(
                    storage_account_type=azure_native.compute.StorageAccountTypes.STANDARD_LRS,
                ),
                name="myVMosdisk",
            ),
        ),
        vm_name="myVM")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const virtualMachine = new azure_native.compute.VirtualMachine("virtualMachine", {
        hardwareProfile: {
            vmSize: azure_native.compute.VirtualMachineSizeTypes.Standard_D1_v2,
        },
        location: "westus",
        networkProfile: {
            networkInterfaces: [{
                id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary: true,
            }],
        },
        osProfile: {
            adminPassword: "{your-password}",
            adminUsername: "{your-username}",
            computerName: "myVM",
        },
        resourceGroupName: "myResourceGroup",
        storageProfile: {
            imageReference: {
                communityGalleryImageId: "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName",
            },
            osDisk: {
                caching: azure_native.compute.CachingTypes.ReadWrite,
                createOption: azure_native.compute.DiskCreateOptionTypes.FromImage,
                managedDisk: {
                    storageAccountType: azure_native.compute.StorageAccountTypes.Standard_LRS,
                },
                name: "myVMosdisk",
            },
        },
        vmName: "myVM",
    });
    
    resources:
      virtualMachine:
        type: azure-native:compute:VirtualMachine
        properties:
          hardwareProfile:
            vmSize: Standard_D1_v2
          location: westus
          networkProfile:
            networkInterfaces:
              - id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}
                primary: true
          osProfile:
            adminPassword: '{your-password}'
            adminUsername: '{your-username}'
            computerName: myVM
          resourceGroupName: myResourceGroup
          storageProfile:
            imageReference:
              communityGalleryImageId: /CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName
            osDisk:
              caching: ReadWrite
              createOption: FromImage
              managedDisk:
                storageAccountType: Standard_LRS
              name: myVMosdisk
          vmName: myVM
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var virtualMachine = new AzureNative.Compute.VirtualMachine("virtualMachine", new()
        {
            HardwareProfile = new AzureNative.Compute.Inputs.HardwareProfileArgs
            {
                VmSize = AzureNative.Compute.VirtualMachineSizeTypes.Standard_D1_v2,
            },
            Location = "westus",
            NetworkProfile = new AzureNative.Compute.Inputs.NetworkProfileArgs
            {
                NetworkInterfaces = new[]
                {
                    new AzureNative.Compute.Inputs.NetworkInterfaceReferenceArgs
                    {
                        Id = "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                        Primary = true,
                    },
                },
            },
            OsProfile = new AzureNative.Compute.Inputs.OSProfileArgs
            {
                AdminPassword = "{your-password}",
                AdminUsername = "{your-username}",
                ComputerName = "myVM",
            },
            ResourceGroupName = "myResourceGroup",
            StorageProfile = new AzureNative.Compute.Inputs.StorageProfileArgs
            {
                ImageReference = new AzureNative.Compute.Inputs.ImageReferenceArgs
                {
                    SharedGalleryImageId = "/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName",
                },
                OsDisk = new AzureNative.Compute.Inputs.OSDiskArgs
                {
                    Caching = AzureNative.Compute.CachingTypes.ReadWrite,
                    CreateOption = AzureNative.Compute.DiskCreateOptionTypes.FromImage,
                    ManagedDisk = new AzureNative.Compute.Inputs.ManagedDiskParametersArgs
                    {
                        StorageAccountType = AzureNative.Compute.StorageAccountTypes.Standard_LRS,
                    },
                    Name = "myVMosdisk",
                },
            },
            VmName = "myVM",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewVirtualMachine(ctx, "virtualMachine", &compute.VirtualMachineArgs{
    			HardwareProfile: &compute.HardwareProfileArgs{
    				VmSize: pulumi.String(compute.VirtualMachineSizeTypes_Standard_D1_v2),
    			},
    			Location: pulumi.String("westus"),
    			NetworkProfile: &compute.NetworkProfileArgs{
    				NetworkInterfaces: compute.NetworkInterfaceReferenceArray{
    					&compute.NetworkInterfaceReferenceArgs{
    						Id:      pulumi.String("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"),
    						Primary: pulumi.Bool(true),
    					},
    				},
    			},
    			OsProfile: &compute.OSProfileArgs{
    				AdminPassword: pulumi.String("{your-password}"),
    				AdminUsername: pulumi.String("{your-username}"),
    				ComputerName:  pulumi.String("myVM"),
    			},
    			ResourceGroupName: pulumi.String("myResourceGroup"),
    			StorageProfile: &compute.StorageProfileArgs{
    				ImageReference: &compute.ImageReferenceArgs{
    					SharedGalleryImageId: pulumi.String("/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName"),
    				},
    				OsDisk: &compute.OSDiskArgs{
    					Caching:      compute.CachingTypesReadWrite,
    					CreateOption: pulumi.String(compute.DiskCreateOptionTypesFromImage),
    					ManagedDisk: &compute.ManagedDiskParametersArgs{
    						StorageAccountType: pulumi.String(compute.StorageAccountTypes_Standard_LRS),
    					},
    					Name: pulumi.String("myVMosdisk"),
    				},
    			},
    			VmName: pulumi.String("myVM"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.compute.VirtualMachine;
    import com.pulumi.azurenative.compute.VirtualMachineArgs;
    import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
    import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
    import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
    import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
    import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
    import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
    import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
                .hardwareProfile(HardwareProfileArgs.builder()
                    .vmSize("Standard_D1_v2")
                    .build())
                .location("westus")
                .networkProfile(NetworkProfileArgs.builder()
                    .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
                        .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
                        .primary(true)
                        .build())
                    .build())
                .osProfile(OSProfileArgs.builder()
                    .adminPassword("{your-password}")
                    .adminUsername("{your-username}")
                    .computerName("myVM")
                    .build())
                .resourceGroupName("myResourceGroup")
                .storageProfile(StorageProfileArgs.builder()
                    .imageReference(ImageReferenceArgs.builder()
                        .sharedGalleryImageId("/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName")
                        .build())
                    .osDisk(OSDiskArgs.builder()
                        .caching("ReadWrite")
                        .createOption("FromImage")
                        .managedDisk(ManagedDiskParametersArgs.builder()
                            .storageAccountType("Standard_LRS")
                            .build())
                        .name("myVMosdisk")
                        .build())
                    .build())
                .vmName("myVM")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    virtual_machine = azure_native.compute.VirtualMachine("virtualMachine",
        hardware_profile=azure_native.compute.HardwareProfileArgs(
            vm_size=azure_native.compute.VirtualMachineSizeTypes.STANDARD_D1_V2,
        ),
        location="westus",
        network_profile=azure_native.compute.NetworkProfileArgs(
            network_interfaces=[azure_native.compute.NetworkInterfaceReferenceArgs(
                id="/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary=True,
            )],
        ),
        os_profile=azure_native.compute.OSProfileArgs(
            admin_password="{your-password}",
            admin_username="{your-username}",
            computer_name="myVM",
        ),
        resource_group_name="myResourceGroup",
        storage_profile=azure_native.compute.StorageProfileArgs(
            image_reference=azure_native.compute.ImageReferenceArgs(
                shared_gallery_image_id="/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName",
            ),
            os_disk=azure_native.compute.OSDiskArgs(
                caching=azure_native.compute.CachingTypes.READ_WRITE,
                create_option=azure_native.compute.DiskCreateOptionTypes.FROM_IMAGE,
                managed_disk=azure_native.compute.ManagedDiskParametersArgs(
                    storage_account_type=azure_native.compute.StorageAccountTypes.STANDARD_LRS,
                ),
                name="myVMosdisk",
            ),
        ),
        vm_name="myVM")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const virtualMachine = new azure_native.compute.VirtualMachine("virtualMachine", {
        hardwareProfile: {
            vmSize: azure_native.compute.VirtualMachineSizeTypes.Standard_D1_v2,
        },
        location: "westus",
        networkProfile: {
            networkInterfaces: [{
                id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary: true,
            }],
        },
        osProfile: {
            adminPassword: "{your-password}",
            adminUsername: "{your-username}",
            computerName: "myVM",
        },
        resourceGroupName: "myResourceGroup",
        storageProfile: {
            imageReference: {
                sharedGalleryImageId: "/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName",
            },
            osDisk: {
                caching: azure_native.compute.CachingTypes.ReadWrite,
                createOption: azure_native.compute.DiskCreateOptionTypes.FromImage,
                managedDisk: {
                    storageAccountType: azure_native.compute.StorageAccountTypes.Standard_LRS,
                },
                name: "myVMosdisk",
            },
        },
        vmName: "myVM",
    });
    
    resources:
      virtualMachine:
        type: azure-native:compute:VirtualMachine
        properties:
          hardwareProfile:
            vmSize: Standard_D1_v2
          location: westus
          networkProfile:
            networkInterfaces:
              - id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}
                primary: true
          osProfile:
            adminPassword: '{your-password}'
            adminUsername: '{your-username}'
            computerName: myVM
          resourceGroupName: myResourceGroup
          storageProfile:
            imageReference:
              sharedGalleryImageId: /SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName
            osDisk:
              caching: ReadWrite
              createOption: FromImage
              managedDisk:
                storageAccountType: Standard_LRS
              name: myVMosdisk
          vmName: myVM
    

    Create a VM with Disk Controller Type

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var virtualMachine = new AzureNative.Compute.VirtualMachine("virtualMachine", new()
        {
            DiagnosticsProfile = new AzureNative.Compute.Inputs.DiagnosticsProfileArgs
            {
                BootDiagnostics = new AzureNative.Compute.Inputs.BootDiagnosticsArgs
                {
                    Enabled = true,
                    StorageUri = "http://{existing-storage-account-name}.blob.core.windows.net",
                },
            },
            HardwareProfile = new AzureNative.Compute.Inputs.HardwareProfileArgs
            {
                VmSize = AzureNative.Compute.VirtualMachineSizeTypes.Standard_D4_v3,
            },
            Location = "westus",
            NetworkProfile = new AzureNative.Compute.Inputs.NetworkProfileArgs
            {
                NetworkInterfaces = new[]
                {
                    new AzureNative.Compute.Inputs.NetworkInterfaceReferenceArgs
                    {
                        Id = "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                        Primary = true,
                    },
                },
            },
            OsProfile = new AzureNative.Compute.Inputs.OSProfileArgs
            {
                AdminPassword = "{your-password}",
                AdminUsername = "{your-username}",
                ComputerName = "myVM",
            },
            ResourceGroupName = "myResourceGroup",
            StorageProfile = new AzureNative.Compute.Inputs.StorageProfileArgs
            {
                DiskControllerType = AzureNative.Compute.DiskControllerTypes.NVMe,
                ImageReference = new AzureNative.Compute.Inputs.ImageReferenceArgs
                {
                    Offer = "WindowsServer",
                    Publisher = "MicrosoftWindowsServer",
                    Sku = "2016-Datacenter",
                    Version = "latest",
                },
                OsDisk = new AzureNative.Compute.Inputs.OSDiskArgs
                {
                    Caching = AzureNative.Compute.CachingTypes.ReadWrite,
                    CreateOption = AzureNative.Compute.DiskCreateOptionTypes.FromImage,
                    ManagedDisk = new AzureNative.Compute.Inputs.ManagedDiskParametersArgs
                    {
                        StorageAccountType = AzureNative.Compute.StorageAccountTypes.Standard_LRS,
                    },
                    Name = "myVMosdisk",
                },
            },
            UserData = "U29tZSBDdXN0b20gRGF0YQ==",
            VmName = "myVM",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewVirtualMachine(ctx, "virtualMachine", &compute.VirtualMachineArgs{
    			DiagnosticsProfile: &compute.DiagnosticsProfileArgs{
    				BootDiagnostics: &compute.BootDiagnosticsArgs{
    					Enabled:    pulumi.Bool(true),
    					StorageUri: pulumi.String("http://{existing-storage-account-name}.blob.core.windows.net"),
    				},
    			},
    			HardwareProfile: &compute.HardwareProfileArgs{
    				VmSize: pulumi.String(compute.VirtualMachineSizeTypes_Standard_D4_v3),
    			},
    			Location: pulumi.String("westus"),
    			NetworkProfile: &compute.NetworkProfileArgs{
    				NetworkInterfaces: compute.NetworkInterfaceReferenceArray{
    					&compute.NetworkInterfaceReferenceArgs{
    						Id:      pulumi.String("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"),
    						Primary: pulumi.Bool(true),
    					},
    				},
    			},
    			OsProfile: &compute.OSProfileArgs{
    				AdminPassword: pulumi.String("{your-password}"),
    				AdminUsername: pulumi.String("{your-username}"),
    				ComputerName:  pulumi.String("myVM"),
    			},
    			ResourceGroupName: pulumi.String("myResourceGroup"),
    			StorageProfile: &compute.StorageProfileArgs{
    				DiskControllerType: pulumi.String(compute.DiskControllerTypesNVMe),
    				ImageReference: &compute.ImageReferenceArgs{
    					Offer:     pulumi.String("WindowsServer"),
    					Publisher: pulumi.String("MicrosoftWindowsServer"),
    					Sku:       pulumi.String("2016-Datacenter"),
    					Version:   pulumi.String("latest"),
    				},
    				OsDisk: &compute.OSDiskArgs{
    					Caching:      compute.CachingTypesReadWrite,
    					CreateOption: pulumi.String(compute.DiskCreateOptionTypesFromImage),
    					ManagedDisk: &compute.ManagedDiskParametersArgs{
    						StorageAccountType: pulumi.String(compute.StorageAccountTypes_Standard_LRS),
    					},
    					Name: pulumi.String("myVMosdisk"),
    				},
    			},
    			UserData: pulumi.String("U29tZSBDdXN0b20gRGF0YQ=="),
    			VmName:   pulumi.String("myVM"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.compute.VirtualMachine;
    import com.pulumi.azurenative.compute.VirtualMachineArgs;
    import com.pulumi.azurenative.compute.inputs.DiagnosticsProfileArgs;
    import com.pulumi.azurenative.compute.inputs.BootDiagnosticsArgs;
    import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
    import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
    import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
    import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
    import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
    import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
    import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
                .diagnosticsProfile(DiagnosticsProfileArgs.builder()
                    .bootDiagnostics(BootDiagnosticsArgs.builder()
                        .enabled(true)
                        .storageUri("http://{existing-storage-account-name}.blob.core.windows.net")
                        .build())
                    .build())
                .hardwareProfile(HardwareProfileArgs.builder()
                    .vmSize("Standard_D4_v3")
                    .build())
                .location("westus")
                .networkProfile(NetworkProfileArgs.builder()
                    .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
                        .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
                        .primary(true)
                        .build())
                    .build())
                .osProfile(OSProfileArgs.builder()
                    .adminPassword("{your-password}")
                    .adminUsername("{your-username}")
                    .computerName("myVM")
                    .build())
                .resourceGroupName("myResourceGroup")
                .storageProfile(StorageProfileArgs.builder()
                    .diskControllerType("NVMe")
                    .imageReference(ImageReferenceArgs.builder()
                        .offer("WindowsServer")
                        .publisher("MicrosoftWindowsServer")
                        .sku("2016-Datacenter")
                        .version("latest")
                        .build())
                    .osDisk(OSDiskArgs.builder()
                        .caching("ReadWrite")
                        .createOption("FromImage")
                        .managedDisk(ManagedDiskParametersArgs.builder()
                            .storageAccountType("Standard_LRS")
                            .build())
                        .name("myVMosdisk")
                        .build())
                    .build())
                .userData("U29tZSBDdXN0b20gRGF0YQ==")
                .vmName("myVM")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    virtual_machine = azure_native.compute.VirtualMachine("virtualMachine",
        diagnostics_profile=azure_native.compute.DiagnosticsProfileArgs(
            boot_diagnostics=azure_native.compute.BootDiagnosticsArgs(
                enabled=True,
                storage_uri="http://{existing-storage-account-name}.blob.core.windows.net",
            ),
        ),
        hardware_profile=azure_native.compute.HardwareProfileArgs(
            vm_size=azure_native.compute.VirtualMachineSizeTypes.STANDARD_D4_V3,
        ),
        location="westus",
        network_profile=azure_native.compute.NetworkProfileArgs(
            network_interfaces=[azure_native.compute.NetworkInterfaceReferenceArgs(
                id="/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary=True,
            )],
        ),
        os_profile=azure_native.compute.OSProfileArgs(
            admin_password="{your-password}",
            admin_username="{your-username}",
            computer_name="myVM",
        ),
        resource_group_name="myResourceGroup",
        storage_profile=azure_native.compute.StorageProfileArgs(
            disk_controller_type=azure_native.compute.DiskControllerTypes.NV_ME,
            image_reference=azure_native.compute.ImageReferenceArgs(
                offer="WindowsServer",
                publisher="MicrosoftWindowsServer",
                sku="2016-Datacenter",
                version="latest",
            ),
            os_disk=azure_native.compute.OSDiskArgs(
                caching=azure_native.compute.CachingTypes.READ_WRITE,
                create_option=azure_native.compute.DiskCreateOptionTypes.FROM_IMAGE,
                managed_disk=azure_native.compute.ManagedDiskParametersArgs(
                    storage_account_type=azure_native.compute.StorageAccountTypes.STANDARD_LRS,
                ),
                name="myVMosdisk",
            ),
        ),
        user_data="U29tZSBDdXN0b20gRGF0YQ==",
        vm_name="myVM")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const virtualMachine = new azure_native.compute.VirtualMachine("virtualMachine", {
        diagnosticsProfile: {
            bootDiagnostics: {
                enabled: true,
                storageUri: "http://{existing-storage-account-name}.blob.core.windows.net",
            },
        },
        hardwareProfile: {
            vmSize: azure_native.compute.VirtualMachineSizeTypes.Standard_D4_v3,
        },
        location: "westus",
        networkProfile: {
            networkInterfaces: [{
                id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary: true,
            }],
        },
        osProfile: {
            adminPassword: "{your-password}",
            adminUsername: "{your-username}",
            computerName: "myVM",
        },
        resourceGroupName: "myResourceGroup",
        storageProfile: {
            diskControllerType: azure_native.compute.DiskControllerTypes.NVMe,
            imageReference: {
                offer: "WindowsServer",
                publisher: "MicrosoftWindowsServer",
                sku: "2016-Datacenter",
                version: "latest",
            },
            osDisk: {
                caching: azure_native.compute.CachingTypes.ReadWrite,
                createOption: azure_native.compute.DiskCreateOptionTypes.FromImage,
                managedDisk: {
                    storageAccountType: azure_native.compute.StorageAccountTypes.Standard_LRS,
                },
                name: "myVMosdisk",
            },
        },
        userData: "U29tZSBDdXN0b20gRGF0YQ==",
        vmName: "myVM",
    });
    
    resources:
      virtualMachine:
        type: azure-native:compute:VirtualMachine
        properties:
          diagnosticsProfile:
            bootDiagnostics:
              enabled: true
              storageUri: http://{existing-storage-account-name}.blob.core.windows.net
          hardwareProfile:
            vmSize: Standard_D4_v3
          location: westus
          networkProfile:
            networkInterfaces:
              - id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}
                primary: true
          osProfile:
            adminPassword: '{your-password}'
            adminUsername: '{your-username}'
            computerName: myVM
          resourceGroupName: myResourceGroup
          storageProfile:
            diskControllerType: NVMe
            imageReference:
              offer: WindowsServer
              publisher: MicrosoftWindowsServer
              sku: 2016-Datacenter
              version: latest
            osDisk:
              caching: ReadWrite
              createOption: FromImage
              managedDisk:
                storageAccountType: Standard_LRS
              name: myVMosdisk
          userData: U29tZSBDdXN0b20gRGF0YQ==
          vmName: myVM
    

    Create a VM with HibernationEnabled

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var virtualMachine = new AzureNative.Compute.VirtualMachine("virtualMachine", new()
        {
            AdditionalCapabilities = new AzureNative.Compute.Inputs.AdditionalCapabilitiesArgs
            {
                HibernationEnabled = true,
            },
            DiagnosticsProfile = new AzureNative.Compute.Inputs.DiagnosticsProfileArgs
            {
                BootDiagnostics = new AzureNative.Compute.Inputs.BootDiagnosticsArgs
                {
                    Enabled = true,
                    StorageUri = "http://{existing-storage-account-name}.blob.core.windows.net",
                },
            },
            HardwareProfile = new AzureNative.Compute.Inputs.HardwareProfileArgs
            {
                VmSize = AzureNative.Compute.VirtualMachineSizeTypes.Standard_D2s_v3,
            },
            Location = "eastus2euap",
            NetworkProfile = new AzureNative.Compute.Inputs.NetworkProfileArgs
            {
                NetworkInterfaces = new[]
                {
                    new AzureNative.Compute.Inputs.NetworkInterfaceReferenceArgs
                    {
                        Id = "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                        Primary = true,
                    },
                },
            },
            OsProfile = new AzureNative.Compute.Inputs.OSProfileArgs
            {
                AdminPassword = "{your-password}",
                AdminUsername = "{your-username}",
                ComputerName = "{vm-name}",
            },
            ResourceGroupName = "myResourceGroup",
            StorageProfile = new AzureNative.Compute.Inputs.StorageProfileArgs
            {
                ImageReference = new AzureNative.Compute.Inputs.ImageReferenceArgs
                {
                    Offer = "WindowsServer",
                    Publisher = "MicrosoftWindowsServer",
                    Sku = "2019-Datacenter",
                    Version = "latest",
                },
                OsDisk = new AzureNative.Compute.Inputs.OSDiskArgs
                {
                    Caching = AzureNative.Compute.CachingTypes.ReadWrite,
                    CreateOption = AzureNative.Compute.DiskCreateOptionTypes.FromImage,
                    ManagedDisk = new AzureNative.Compute.Inputs.ManagedDiskParametersArgs
                    {
                        StorageAccountType = AzureNative.Compute.StorageAccountTypes.Standard_LRS,
                    },
                    Name = "vmOSdisk",
                },
            },
            VmName = "{vm-name}",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewVirtualMachine(ctx, "virtualMachine", &compute.VirtualMachineArgs{
    			AdditionalCapabilities: &compute.AdditionalCapabilitiesArgs{
    				HibernationEnabled: pulumi.Bool(true),
    			},
    			DiagnosticsProfile: &compute.DiagnosticsProfileArgs{
    				BootDiagnostics: &compute.BootDiagnosticsArgs{
    					Enabled:    pulumi.Bool(true),
    					StorageUri: pulumi.String("http://{existing-storage-account-name}.blob.core.windows.net"),
    				},
    			},
    			HardwareProfile: &compute.HardwareProfileArgs{
    				VmSize: pulumi.String(compute.VirtualMachineSizeTypes_Standard_D2s_v3),
    			},
    			Location: pulumi.String("eastus2euap"),
    			NetworkProfile: &compute.NetworkProfileArgs{
    				NetworkInterfaces: compute.NetworkInterfaceReferenceArray{
    					&compute.NetworkInterfaceReferenceArgs{
    						Id:      pulumi.String("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"),
    						Primary: pulumi.Bool(true),
    					},
    				},
    			},
    			OsProfile: &compute.OSProfileArgs{
    				AdminPassword: pulumi.String("{your-password}"),
    				AdminUsername: pulumi.String("{your-username}"),
    				ComputerName:  pulumi.String("{vm-name}"),
    			},
    			ResourceGroupName: pulumi.String("myResourceGroup"),
    			StorageProfile: &compute.StorageProfileArgs{
    				ImageReference: &compute.ImageReferenceArgs{
    					Offer:     pulumi.String("WindowsServer"),
    					Publisher: pulumi.String("MicrosoftWindowsServer"),
    					Sku:       pulumi.String("2019-Datacenter"),
    					Version:   pulumi.String("latest"),
    				},
    				OsDisk: &compute.OSDiskArgs{
    					Caching:      compute.CachingTypesReadWrite,
    					CreateOption: pulumi.String(compute.DiskCreateOptionTypesFromImage),
    					ManagedDisk: &compute.ManagedDiskParametersArgs{
    						StorageAccountType: pulumi.String(compute.StorageAccountTypes_Standard_LRS),
    					},
    					Name: pulumi.String("vmOSdisk"),
    				},
    			},
    			VmName: pulumi.String("{vm-name}"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.compute.VirtualMachine;
    import com.pulumi.azurenative.compute.VirtualMachineArgs;
    import com.pulumi.azurenative.compute.inputs.AdditionalCapabilitiesArgs;
    import com.pulumi.azurenative.compute.inputs.DiagnosticsProfileArgs;
    import com.pulumi.azurenative.compute.inputs.BootDiagnosticsArgs;
    import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
    import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
    import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
    import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
    import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
    import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
    import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
                .additionalCapabilities(AdditionalCapabilitiesArgs.builder()
                    .hibernationEnabled(true)
                    .build())
                .diagnosticsProfile(DiagnosticsProfileArgs.builder()
                    .bootDiagnostics(BootDiagnosticsArgs.builder()
                        .enabled(true)
                        .storageUri("http://{existing-storage-account-name}.blob.core.windows.net")
                        .build())
                    .build())
                .hardwareProfile(HardwareProfileArgs.builder()
                    .vmSize("Standard_D2s_v3")
                    .build())
                .location("eastus2euap")
                .networkProfile(NetworkProfileArgs.builder()
                    .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
                        .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
                        .primary(true)
                        .build())
                    .build())
                .osProfile(OSProfileArgs.builder()
                    .adminPassword("{your-password}")
                    .adminUsername("{your-username}")
                    .computerName("{vm-name}")
                    .build())
                .resourceGroupName("myResourceGroup")
                .storageProfile(StorageProfileArgs.builder()
                    .imageReference(ImageReferenceArgs.builder()
                        .offer("WindowsServer")
                        .publisher("MicrosoftWindowsServer")
                        .sku("2019-Datacenter")
                        .version("latest")
                        .build())
                    .osDisk(OSDiskArgs.builder()
                        .caching("ReadWrite")
                        .createOption("FromImage")
                        .managedDisk(ManagedDiskParametersArgs.builder()
                            .storageAccountType("Standard_LRS")
                            .build())
                        .name("vmOSdisk")
                        .build())
                    .build())
                .vmName("{vm-name}")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    virtual_machine = azure_native.compute.VirtualMachine("virtualMachine",
        additional_capabilities=azure_native.compute.AdditionalCapabilitiesArgs(
            hibernation_enabled=True,
        ),
        diagnostics_profile=azure_native.compute.DiagnosticsProfileArgs(
            boot_diagnostics=azure_native.compute.BootDiagnosticsArgs(
                enabled=True,
                storage_uri="http://{existing-storage-account-name}.blob.core.windows.net",
            ),
        ),
        hardware_profile=azure_native.compute.HardwareProfileArgs(
            vm_size=azure_native.compute.VirtualMachineSizeTypes.STANDARD_D2S_V3,
        ),
        location="eastus2euap",
        network_profile=azure_native.compute.NetworkProfileArgs(
            network_interfaces=[azure_native.compute.NetworkInterfaceReferenceArgs(
                id="/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary=True,
            )],
        ),
        os_profile=azure_native.compute.OSProfileArgs(
            admin_password="{your-password}",
            admin_username="{your-username}",
            computer_name="{vm-name}",
        ),
        resource_group_name="myResourceGroup",
        storage_profile=azure_native.compute.StorageProfileArgs(
            image_reference=azure_native.compute.ImageReferenceArgs(
                offer="WindowsServer",
                publisher="MicrosoftWindowsServer",
                sku="2019-Datacenter",
                version="latest",
            ),
            os_disk=azure_native.compute.OSDiskArgs(
                caching=azure_native.compute.CachingTypes.READ_WRITE,
                create_option=azure_native.compute.DiskCreateOptionTypes.FROM_IMAGE,
                managed_disk=azure_native.compute.ManagedDiskParametersArgs(
                    storage_account_type=azure_native.compute.StorageAccountTypes.STANDARD_LRS,
                ),
                name="vmOSdisk",
            ),
        ),
        vm_name="{vm-name}")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const virtualMachine = new azure_native.compute.VirtualMachine("virtualMachine", {
        additionalCapabilities: {
            hibernationEnabled: true,
        },
        diagnosticsProfile: {
            bootDiagnostics: {
                enabled: true,
                storageUri: "http://{existing-storage-account-name}.blob.core.windows.net",
            },
        },
        hardwareProfile: {
            vmSize: azure_native.compute.VirtualMachineSizeTypes.Standard_D2s_v3,
        },
        location: "eastus2euap",
        networkProfile: {
            networkInterfaces: [{
                id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary: true,
            }],
        },
        osProfile: {
            adminPassword: "{your-password}",
            adminUsername: "{your-username}",
            computerName: "{vm-name}",
        },
        resourceGroupName: "myResourceGroup",
        storageProfile: {
            imageReference: {
                offer: "WindowsServer",
                publisher: "MicrosoftWindowsServer",
                sku: "2019-Datacenter",
                version: "latest",
            },
            osDisk: {
                caching: azure_native.compute.CachingTypes.ReadWrite,
                createOption: azure_native.compute.DiskCreateOptionTypes.FromImage,
                managedDisk: {
                    storageAccountType: azure_native.compute.StorageAccountTypes.Standard_LRS,
                },
                name: "vmOSdisk",
            },
        },
        vmName: "{vm-name}",
    });
    
    resources:
      virtualMachine:
        type: azure-native:compute:VirtualMachine
        properties:
          additionalCapabilities:
            hibernationEnabled: true
          diagnosticsProfile:
            bootDiagnostics:
              enabled: true
              storageUri: http://{existing-storage-account-name}.blob.core.windows.net
          hardwareProfile:
            vmSize: Standard_D2s_v3
          location: eastus2euap
          networkProfile:
            networkInterfaces:
              - id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}
                primary: true
          osProfile:
            adminPassword: '{your-password}'
            adminUsername: '{your-username}'
            computerName: '{vm-name}'
          resourceGroupName: myResourceGroup
          storageProfile:
            imageReference:
              offer: WindowsServer
              publisher: MicrosoftWindowsServer
              sku: 2019-Datacenter
              version: latest
            osDisk:
              caching: ReadWrite
              createOption: FromImage
              managedDisk:
                storageAccountType: Standard_LRS
              name: vmOSdisk
          vmName: '{vm-name}'
    

    Create a VM with Uefi Settings of secureBoot and vTPM.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var virtualMachine = new AzureNative.Compute.VirtualMachine("virtualMachine", new()
        {
            HardwareProfile = new AzureNative.Compute.Inputs.HardwareProfileArgs
            {
                VmSize = AzureNative.Compute.VirtualMachineSizeTypes.Standard_D2s_v3,
            },
            Location = "westus",
            NetworkProfile = new AzureNative.Compute.Inputs.NetworkProfileArgs
            {
                NetworkInterfaces = new[]
                {
                    new AzureNative.Compute.Inputs.NetworkInterfaceReferenceArgs
                    {
                        Id = "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                        Primary = true,
                    },
                },
            },
            OsProfile = new AzureNative.Compute.Inputs.OSProfileArgs
            {
                AdminPassword = "{your-password}",
                AdminUsername = "{your-username}",
                ComputerName = "myVM",
            },
            ResourceGroupName = "myResourceGroup",
            SecurityProfile = new AzureNative.Compute.Inputs.SecurityProfileArgs
            {
                SecurityType = AzureNative.Compute.SecurityTypes.TrustedLaunch,
                UefiSettings = new AzureNative.Compute.Inputs.UefiSettingsArgs
                {
                    SecureBootEnabled = true,
                    VTpmEnabled = true,
                },
            },
            StorageProfile = new AzureNative.Compute.Inputs.StorageProfileArgs
            {
                ImageReference = new AzureNative.Compute.Inputs.ImageReferenceArgs
                {
                    Offer = "windowsserver-gen2preview-preview",
                    Publisher = "MicrosoftWindowsServer",
                    Sku = "windows10-tvm",
                    Version = "18363.592.2001092016",
                },
                OsDisk = new AzureNative.Compute.Inputs.OSDiskArgs
                {
                    Caching = AzureNative.Compute.CachingTypes.ReadOnly,
                    CreateOption = AzureNative.Compute.DiskCreateOptionTypes.FromImage,
                    ManagedDisk = new AzureNative.Compute.Inputs.ManagedDiskParametersArgs
                    {
                        StorageAccountType = AzureNative.Compute.StorageAccountTypes.StandardSSD_LRS,
                    },
                    Name = "myVMosdisk",
                },
            },
            VmName = "myVM",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewVirtualMachine(ctx, "virtualMachine", &compute.VirtualMachineArgs{
    			HardwareProfile: &compute.HardwareProfileArgs{
    				VmSize: pulumi.String(compute.VirtualMachineSizeTypes_Standard_D2s_v3),
    			},
    			Location: pulumi.String("westus"),
    			NetworkProfile: &compute.NetworkProfileArgs{
    				NetworkInterfaces: compute.NetworkInterfaceReferenceArray{
    					&compute.NetworkInterfaceReferenceArgs{
    						Id:      pulumi.String("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"),
    						Primary: pulumi.Bool(true),
    					},
    				},
    			},
    			OsProfile: &compute.OSProfileArgs{
    				AdminPassword: pulumi.String("{your-password}"),
    				AdminUsername: pulumi.String("{your-username}"),
    				ComputerName:  pulumi.String("myVM"),
    			},
    			ResourceGroupName: pulumi.String("myResourceGroup"),
    			SecurityProfile: &compute.SecurityProfileArgs{
    				SecurityType: pulumi.String(compute.SecurityTypesTrustedLaunch),
    				UefiSettings: &compute.UefiSettingsArgs{
    					SecureBootEnabled: pulumi.Bool(true),
    					VTpmEnabled:       pulumi.Bool(true),
    				},
    			},
    			StorageProfile: &compute.StorageProfileArgs{
    				ImageReference: &compute.ImageReferenceArgs{
    					Offer:     pulumi.String("windowsserver-gen2preview-preview"),
    					Publisher: pulumi.String("MicrosoftWindowsServer"),
    					Sku:       pulumi.String("windows10-tvm"),
    					Version:   pulumi.String("18363.592.2001092016"),
    				},
    				OsDisk: &compute.OSDiskArgs{
    					Caching:      compute.CachingTypesReadOnly,
    					CreateOption: pulumi.String(compute.DiskCreateOptionTypesFromImage),
    					ManagedDisk: &compute.ManagedDiskParametersArgs{
    						StorageAccountType: pulumi.String(compute.StorageAccountTypes_StandardSSD_LRS),
    					},
    					Name: pulumi.String("myVMosdisk"),
    				},
    			},
    			VmName: pulumi.String("myVM"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.compute.VirtualMachine;
    import com.pulumi.azurenative.compute.VirtualMachineArgs;
    import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
    import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
    import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
    import com.pulumi.azurenative.compute.inputs.SecurityProfileArgs;
    import com.pulumi.azurenative.compute.inputs.UefiSettingsArgs;
    import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
    import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
    import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
    import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
                .hardwareProfile(HardwareProfileArgs.builder()
                    .vmSize("Standard_D2s_v3")
                    .build())
                .location("westus")
                .networkProfile(NetworkProfileArgs.builder()
                    .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
                        .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
                        .primary(true)
                        .build())
                    .build())
                .osProfile(OSProfileArgs.builder()
                    .adminPassword("{your-password}")
                    .adminUsername("{your-username}")
                    .computerName("myVM")
                    .build())
                .resourceGroupName("myResourceGroup")
                .securityProfile(SecurityProfileArgs.builder()
                    .securityType("TrustedLaunch")
                    .uefiSettings(UefiSettingsArgs.builder()
                        .secureBootEnabled(true)
                        .vTpmEnabled(true)
                        .build())
                    .build())
                .storageProfile(StorageProfileArgs.builder()
                    .imageReference(ImageReferenceArgs.builder()
                        .offer("windowsserver-gen2preview-preview")
                        .publisher("MicrosoftWindowsServer")
                        .sku("windows10-tvm")
                        .version("18363.592.2001092016")
                        .build())
                    .osDisk(OSDiskArgs.builder()
                        .caching("ReadOnly")
                        .createOption("FromImage")
                        .managedDisk(ManagedDiskParametersArgs.builder()
                            .storageAccountType("StandardSSD_LRS")
                            .build())
                        .name("myVMosdisk")
                        .build())
                    .build())
                .vmName("myVM")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    virtual_machine = azure_native.compute.VirtualMachine("virtualMachine",
        hardware_profile=azure_native.compute.HardwareProfileArgs(
            vm_size=azure_native.compute.VirtualMachineSizeTypes.STANDARD_D2S_V3,
        ),
        location="westus",
        network_profile=azure_native.compute.NetworkProfileArgs(
            network_interfaces=[azure_native.compute.NetworkInterfaceReferenceArgs(
                id="/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary=True,
            )],
        ),
        os_profile=azure_native.compute.OSProfileArgs(
            admin_password="{your-password}",
            admin_username="{your-username}",
            computer_name="myVM",
        ),
        resource_group_name="myResourceGroup",
        security_profile=azure_native.compute.SecurityProfileArgs(
            security_type=azure_native.compute.SecurityTypes.TRUSTED_LAUNCH,
            uefi_settings=azure_native.compute.UefiSettingsArgs(
                secure_boot_enabled=True,
                v_tpm_enabled=True,
            ),
        ),
        storage_profile=azure_native.compute.StorageProfileArgs(
            image_reference=azure_native.compute.ImageReferenceArgs(
                offer="windowsserver-gen2preview-preview",
                publisher="MicrosoftWindowsServer",
                sku="windows10-tvm",
                version="18363.592.2001092016",
            ),
            os_disk=azure_native.compute.OSDiskArgs(
                caching=azure_native.compute.CachingTypes.READ_ONLY,
                create_option=azure_native.compute.DiskCreateOptionTypes.FROM_IMAGE,
                managed_disk=azure_native.compute.ManagedDiskParametersArgs(
                    storage_account_type=azure_native.compute.StorageAccountTypes.STANDARD_SS_D_LRS,
                ),
                name="myVMosdisk",
            ),
        ),
        vm_name="myVM")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const virtualMachine = new azure_native.compute.VirtualMachine("virtualMachine", {
        hardwareProfile: {
            vmSize: azure_native.compute.VirtualMachineSizeTypes.Standard_D2s_v3,
        },
        location: "westus",
        networkProfile: {
            networkInterfaces: [{
                id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary: true,
            }],
        },
        osProfile: {
            adminPassword: "{your-password}",
            adminUsername: "{your-username}",
            computerName: "myVM",
        },
        resourceGroupName: "myResourceGroup",
        securityProfile: {
            securityType: azure_native.compute.SecurityTypes.TrustedLaunch,
            uefiSettings: {
                secureBootEnabled: true,
                vTpmEnabled: true,
            },
        },
        storageProfile: {
            imageReference: {
                offer: "windowsserver-gen2preview-preview",
                publisher: "MicrosoftWindowsServer",
                sku: "windows10-tvm",
                version: "18363.592.2001092016",
            },
            osDisk: {
                caching: azure_native.compute.CachingTypes.ReadOnly,
                createOption: azure_native.compute.DiskCreateOptionTypes.FromImage,
                managedDisk: {
                    storageAccountType: azure_native.compute.StorageAccountTypes.StandardSSD_LRS,
                },
                name: "myVMosdisk",
            },
        },
        vmName: "myVM",
    });
    
    resources:
      virtualMachine:
        type: azure-native:compute:VirtualMachine
        properties:
          hardwareProfile:
            vmSize: Standard_D2s_v3
          location: westus
          networkProfile:
            networkInterfaces:
              - id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}
                primary: true
          osProfile:
            adminPassword: '{your-password}'
            adminUsername: '{your-username}'
            computerName: myVM
          resourceGroupName: myResourceGroup
          securityProfile:
            securityType: TrustedLaunch
            uefiSettings:
              secureBootEnabled: true
              vTpmEnabled: true
          storageProfile:
            imageReference:
              offer: windowsserver-gen2preview-preview
              publisher: MicrosoftWindowsServer
              sku: windows10-tvm
              version: 18363.592.2001092016
            osDisk:
              caching: ReadOnly
              createOption: FromImage
              managedDisk:
                storageAccountType: StandardSSD_LRS
              name: myVMosdisk
          vmName: myVM
    

    Create a VM with UserData

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var virtualMachine = new AzureNative.Compute.VirtualMachine("virtualMachine", new()
        {
            DiagnosticsProfile = new AzureNative.Compute.Inputs.DiagnosticsProfileArgs
            {
                BootDiagnostics = new AzureNative.Compute.Inputs.BootDiagnosticsArgs
                {
                    Enabled = true,
                    StorageUri = "http://{existing-storage-account-name}.blob.core.windows.net",
                },
            },
            HardwareProfile = new AzureNative.Compute.Inputs.HardwareProfileArgs
            {
                VmSize = AzureNative.Compute.VirtualMachineSizeTypes.Standard_D1_v2,
            },
            Location = "westus",
            NetworkProfile = new AzureNative.Compute.Inputs.NetworkProfileArgs
            {
                NetworkInterfaces = new[]
                {
                    new AzureNative.Compute.Inputs.NetworkInterfaceReferenceArgs
                    {
                        Id = "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                        Primary = true,
                    },
                },
            },
            OsProfile = new AzureNative.Compute.Inputs.OSProfileArgs
            {
                AdminPassword = "{your-password}",
                AdminUsername = "{your-username}",
                ComputerName = "{vm-name}",
            },
            ResourceGroupName = "myResourceGroup",
            StorageProfile = new AzureNative.Compute.Inputs.StorageProfileArgs
            {
                ImageReference = new AzureNative.Compute.Inputs.ImageReferenceArgs
                {
                    Offer = "WindowsServer",
                    Publisher = "MicrosoftWindowsServer",
                    Sku = "2016-Datacenter",
                    Version = "latest",
                },
                OsDisk = new AzureNative.Compute.Inputs.OSDiskArgs
                {
                    Caching = AzureNative.Compute.CachingTypes.ReadWrite,
                    CreateOption = AzureNative.Compute.DiskCreateOptionTypes.FromImage,
                    ManagedDisk = new AzureNative.Compute.Inputs.ManagedDiskParametersArgs
                    {
                        StorageAccountType = AzureNative.Compute.StorageAccountTypes.Standard_LRS,
                    },
                    Name = "vmOSdisk",
                },
            },
            UserData = "RXhhbXBsZSBVc2VyRGF0YQ==",
            VmName = "{vm-name}",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewVirtualMachine(ctx, "virtualMachine", &compute.VirtualMachineArgs{
    			DiagnosticsProfile: &compute.DiagnosticsProfileArgs{
    				BootDiagnostics: &compute.BootDiagnosticsArgs{
    					Enabled:    pulumi.Bool(true),
    					StorageUri: pulumi.String("http://{existing-storage-account-name}.blob.core.windows.net"),
    				},
    			},
    			HardwareProfile: &compute.HardwareProfileArgs{
    				VmSize: pulumi.String(compute.VirtualMachineSizeTypes_Standard_D1_v2),
    			},
    			Location: pulumi.String("westus"),
    			NetworkProfile: &compute.NetworkProfileArgs{
    				NetworkInterfaces: compute.NetworkInterfaceReferenceArray{
    					&compute.NetworkInterfaceReferenceArgs{
    						Id:      pulumi.String("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"),
    						Primary: pulumi.Bool(true),
    					},
    				},
    			},
    			OsProfile: &compute.OSProfileArgs{
    				AdminPassword: pulumi.String("{your-password}"),
    				AdminUsername: pulumi.String("{your-username}"),
    				ComputerName:  pulumi.String("{vm-name}"),
    			},
    			ResourceGroupName: pulumi.String("myResourceGroup"),
    			StorageProfile: &compute.StorageProfileArgs{
    				ImageReference: &compute.ImageReferenceArgs{
    					Offer:     pulumi.String("WindowsServer"),
    					Publisher: pulumi.String("MicrosoftWindowsServer"),
    					Sku:       pulumi.String("2016-Datacenter"),
    					Version:   pulumi.String("latest"),
    				},
    				OsDisk: &compute.OSDiskArgs{
    					Caching:      compute.CachingTypesReadWrite,
    					CreateOption: pulumi.String(compute.DiskCreateOptionTypesFromImage),
    					ManagedDisk: &compute.ManagedDiskParametersArgs{
    						StorageAccountType: pulumi.String(compute.StorageAccountTypes_Standard_LRS),
    					},
    					Name: pulumi.String("vmOSdisk"),
    				},
    			},
    			UserData: pulumi.String("RXhhbXBsZSBVc2VyRGF0YQ=="),
    			VmName:   pulumi.String("{vm-name}"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.compute.VirtualMachine;
    import com.pulumi.azurenative.compute.VirtualMachineArgs;
    import com.pulumi.azurenative.compute.inputs.DiagnosticsProfileArgs;
    import com.pulumi.azurenative.compute.inputs.BootDiagnosticsArgs;
    import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
    import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
    import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
    import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
    import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
    import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
    import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
                .diagnosticsProfile(DiagnosticsProfileArgs.builder()
                    .bootDiagnostics(BootDiagnosticsArgs.builder()
                        .enabled(true)
                        .storageUri("http://{existing-storage-account-name}.blob.core.windows.net")
                        .build())
                    .build())
                .hardwareProfile(HardwareProfileArgs.builder()
                    .vmSize("Standard_D1_v2")
                    .build())
                .location("westus")
                .networkProfile(NetworkProfileArgs.builder()
                    .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
                        .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
                        .primary(true)
                        .build())
                    .build())
                .osProfile(OSProfileArgs.builder()
                    .adminPassword("{your-password}")
                    .adminUsername("{your-username}")
                    .computerName("{vm-name}")
                    .build())
                .resourceGroupName("myResourceGroup")
                .storageProfile(StorageProfileArgs.builder()
                    .imageReference(ImageReferenceArgs.builder()
                        .offer("WindowsServer")
                        .publisher("MicrosoftWindowsServer")
                        .sku("2016-Datacenter")
                        .version("latest")
                        .build())
                    .osDisk(OSDiskArgs.builder()
                        .caching("ReadWrite")
                        .createOption("FromImage")
                        .managedDisk(ManagedDiskParametersArgs.builder()
                            .storageAccountType("Standard_LRS")
                            .build())
                        .name("vmOSdisk")
                        .build())
                    .build())
                .userData("RXhhbXBsZSBVc2VyRGF0YQ==")
                .vmName("{vm-name}")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    virtual_machine = azure_native.compute.VirtualMachine("virtualMachine",
        diagnostics_profile=azure_native.compute.DiagnosticsProfileArgs(
            boot_diagnostics=azure_native.compute.BootDiagnosticsArgs(
                enabled=True,
                storage_uri="http://{existing-storage-account-name}.blob.core.windows.net",
            ),
        ),
        hardware_profile=azure_native.compute.HardwareProfileArgs(
            vm_size=azure_native.compute.VirtualMachineSizeTypes.STANDARD_D1_V2,
        ),
        location="westus",
        network_profile=azure_native.compute.NetworkProfileArgs(
            network_interfaces=[azure_native.compute.NetworkInterfaceReferenceArgs(
                id="/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary=True,
            )],
        ),
        os_profile=azure_native.compute.OSProfileArgs(
            admin_password="{your-password}",
            admin_username="{your-username}",
            computer_name="{vm-name}",
        ),
        resource_group_name="myResourceGroup",
        storage_profile=azure_native.compute.StorageProfileArgs(
            image_reference=azure_native.compute.ImageReferenceArgs(
                offer="WindowsServer",
                publisher="MicrosoftWindowsServer",
                sku="2016-Datacenter",
                version="latest",
            ),
            os_disk=azure_native.compute.OSDiskArgs(
                caching=azure_native.compute.CachingTypes.READ_WRITE,
                create_option=azure_native.compute.DiskCreateOptionTypes.FROM_IMAGE,
                managed_disk=azure_native.compute.ManagedDiskParametersArgs(
                    storage_account_type=azure_native.compute.StorageAccountTypes.STANDARD_LRS,
                ),
                name="vmOSdisk",
            ),
        ),
        user_data="RXhhbXBsZSBVc2VyRGF0YQ==",
        vm_name="{vm-name}")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const virtualMachine = new azure_native.compute.VirtualMachine("virtualMachine", {
        diagnosticsProfile: {
            bootDiagnostics: {
                enabled: true,
                storageUri: "http://{existing-storage-account-name}.blob.core.windows.net",
            },
        },
        hardwareProfile: {
            vmSize: azure_native.compute.VirtualMachineSizeTypes.Standard_D1_v2,
        },
        location: "westus",
        networkProfile: {
            networkInterfaces: [{
                id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary: true,
            }],
        },
        osProfile: {
            adminPassword: "{your-password}",
            adminUsername: "{your-username}",
            computerName: "{vm-name}",
        },
        resourceGroupName: "myResourceGroup",
        storageProfile: {
            imageReference: {
                offer: "WindowsServer",
                publisher: "MicrosoftWindowsServer",
                sku: "2016-Datacenter",
                version: "latest",
            },
            osDisk: {
                caching: azure_native.compute.CachingTypes.ReadWrite,
                createOption: azure_native.compute.DiskCreateOptionTypes.FromImage,
                managedDisk: {
                    storageAccountType: azure_native.compute.StorageAccountTypes.Standard_LRS,
                },
                name: "vmOSdisk",
            },
        },
        userData: "RXhhbXBsZSBVc2VyRGF0YQ==",
        vmName: "{vm-name}",
    });
    
    resources:
      virtualMachine:
        type: azure-native:compute:VirtualMachine
        properties:
          diagnosticsProfile:
            bootDiagnostics:
              enabled: true
              storageUri: http://{existing-storage-account-name}.blob.core.windows.net
          hardwareProfile:
            vmSize: Standard_D1_v2
          location: westus
          networkProfile:
            networkInterfaces:
              - id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}
                primary: true
          osProfile:
            adminPassword: '{your-password}'
            adminUsername: '{your-username}'
            computerName: '{vm-name}'
          resourceGroupName: myResourceGroup
          storageProfile:
            imageReference:
              offer: WindowsServer
              publisher: MicrosoftWindowsServer
              sku: 2016-Datacenter
              version: latest
            osDisk:
              caching: ReadWrite
              createOption: FromImage
              managedDisk:
                storageAccountType: Standard_LRS
              name: vmOSdisk
          userData: RXhhbXBsZSBVc2VyRGF0YQ==
          vmName: '{vm-name}'
    

    Create a VM with VM Size Properties

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var virtualMachine = new AzureNative.Compute.VirtualMachine("virtualMachine", new()
        {
            DiagnosticsProfile = new AzureNative.Compute.Inputs.DiagnosticsProfileArgs
            {
                BootDiagnostics = new AzureNative.Compute.Inputs.BootDiagnosticsArgs
                {
                    Enabled = true,
                    StorageUri = "http://{existing-storage-account-name}.blob.core.windows.net",
                },
            },
            HardwareProfile = new AzureNative.Compute.Inputs.HardwareProfileArgs
            {
                VmSize = AzureNative.Compute.VirtualMachineSizeTypes.Standard_D4_v3,
                VmSizeProperties = new AzureNative.Compute.Inputs.VMSizePropertiesArgs
                {
                    VCPUsAvailable = 1,
                    VCPUsPerCore = 1,
                },
            },
            Location = "westus",
            NetworkProfile = new AzureNative.Compute.Inputs.NetworkProfileArgs
            {
                NetworkInterfaces = new[]
                {
                    new AzureNative.Compute.Inputs.NetworkInterfaceReferenceArgs
                    {
                        Id = "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                        Primary = true,
                    },
                },
            },
            OsProfile = new AzureNative.Compute.Inputs.OSProfileArgs
            {
                AdminPassword = "{your-password}",
                AdminUsername = "{your-username}",
                ComputerName = "myVM",
            },
            ResourceGroupName = "myResourceGroup",
            StorageProfile = new AzureNative.Compute.Inputs.StorageProfileArgs
            {
                ImageReference = new AzureNative.Compute.Inputs.ImageReferenceArgs
                {
                    Offer = "WindowsServer",
                    Publisher = "MicrosoftWindowsServer",
                    Sku = "2016-Datacenter",
                    Version = "latest",
                },
                OsDisk = new AzureNative.Compute.Inputs.OSDiskArgs
                {
                    Caching = AzureNative.Compute.CachingTypes.ReadWrite,
                    CreateOption = AzureNative.Compute.DiskCreateOptionTypes.FromImage,
                    ManagedDisk = new AzureNative.Compute.Inputs.ManagedDiskParametersArgs
                    {
                        StorageAccountType = AzureNative.Compute.StorageAccountTypes.Standard_LRS,
                    },
                    Name = "myVMosdisk",
                },
            },
            UserData = "U29tZSBDdXN0b20gRGF0YQ==",
            VmName = "myVM",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewVirtualMachine(ctx, "virtualMachine", &compute.VirtualMachineArgs{
    			DiagnosticsProfile: &compute.DiagnosticsProfileArgs{
    				BootDiagnostics: &compute.BootDiagnosticsArgs{
    					Enabled:    pulumi.Bool(true),
    					StorageUri: pulumi.String("http://{existing-storage-account-name}.blob.core.windows.net"),
    				},
    			},
    			HardwareProfile: &compute.HardwareProfileArgs{
    				VmSize: pulumi.String(compute.VirtualMachineSizeTypes_Standard_D4_v3),
    				VmSizeProperties: &compute.VMSizePropertiesArgs{
    					VCPUsAvailable: pulumi.Int(1),
    					VCPUsPerCore:   pulumi.Int(1),
    				},
    			},
    			Location: pulumi.String("westus"),
    			NetworkProfile: &compute.NetworkProfileArgs{
    				NetworkInterfaces: compute.NetworkInterfaceReferenceArray{
    					&compute.NetworkInterfaceReferenceArgs{
    						Id:      pulumi.String("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"),
    						Primary: pulumi.Bool(true),
    					},
    				},
    			},
    			OsProfile: &compute.OSProfileArgs{
    				AdminPassword: pulumi.String("{your-password}"),
    				AdminUsername: pulumi.String("{your-username}"),
    				ComputerName:  pulumi.String("myVM"),
    			},
    			ResourceGroupName: pulumi.String("myResourceGroup"),
    			StorageProfile: &compute.StorageProfileArgs{
    				ImageReference: &compute.ImageReferenceArgs{
    					Offer:     pulumi.String("WindowsServer"),
    					Publisher: pulumi.String("MicrosoftWindowsServer"),
    					Sku:       pulumi.String("2016-Datacenter"),
    					Version:   pulumi.String("latest"),
    				},
    				OsDisk: &compute.OSDiskArgs{
    					Caching:      compute.CachingTypesReadWrite,
    					CreateOption: pulumi.String(compute.DiskCreateOptionTypesFromImage),
    					ManagedDisk: &compute.ManagedDiskParametersArgs{
    						StorageAccountType: pulumi.String(compute.StorageAccountTypes_Standard_LRS),
    					},
    					Name: pulumi.String("myVMosdisk"),
    				},
    			},
    			UserData: pulumi.String("U29tZSBDdXN0b20gRGF0YQ=="),
    			VmName:   pulumi.String("myVM"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.compute.VirtualMachine;
    import com.pulumi.azurenative.compute.VirtualMachineArgs;
    import com.pulumi.azurenative.compute.inputs.DiagnosticsProfileArgs;
    import com.pulumi.azurenative.compute.inputs.BootDiagnosticsArgs;
    import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
    import com.pulumi.azurenative.compute.inputs.VMSizePropertiesArgs;
    import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
    import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
    import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
    import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
    import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
    import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
                .diagnosticsProfile(DiagnosticsProfileArgs.builder()
                    .bootDiagnostics(BootDiagnosticsArgs.builder()
                        .enabled(true)
                        .storageUri("http://{existing-storage-account-name}.blob.core.windows.net")
                        .build())
                    .build())
                .hardwareProfile(HardwareProfileArgs.builder()
                    .vmSize("Standard_D4_v3")
                    .vmSizeProperties(VMSizePropertiesArgs.builder()
                        .vCPUsAvailable(1)
                        .vCPUsPerCore(1)
                        .build())
                    .build())
                .location("westus")
                .networkProfile(NetworkProfileArgs.builder()
                    .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
                        .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
                        .primary(true)
                        .build())
                    .build())
                .osProfile(OSProfileArgs.builder()
                    .adminPassword("{your-password}")
                    .adminUsername("{your-username}")
                    .computerName("myVM")
                    .build())
                .resourceGroupName("myResourceGroup")
                .storageProfile(StorageProfileArgs.builder()
                    .imageReference(ImageReferenceArgs.builder()
                        .offer("WindowsServer")
                        .publisher("MicrosoftWindowsServer")
                        .sku("2016-Datacenter")
                        .version("latest")
                        .build())
                    .osDisk(OSDiskArgs.builder()
                        .caching("ReadWrite")
                        .createOption("FromImage")
                        .managedDisk(ManagedDiskParametersArgs.builder()
                            .storageAccountType("Standard_LRS")
                            .build())
                        .name("myVMosdisk")
                        .build())
                    .build())
                .userData("U29tZSBDdXN0b20gRGF0YQ==")
                .vmName("myVM")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    virtual_machine = azure_native.compute.VirtualMachine("virtualMachine",
        diagnostics_profile=azure_native.compute.DiagnosticsProfileArgs(
            boot_diagnostics=azure_native.compute.BootDiagnosticsArgs(
                enabled=True,
                storage_uri="http://{existing-storage-account-name}.blob.core.windows.net",
            ),
        ),
        hardware_profile=azure_native.compute.HardwareProfileArgs(
            vm_size=azure_native.compute.VirtualMachineSizeTypes.STANDARD_D4_V3,
            vm_size_properties=azure_native.compute.VMSizePropertiesArgs(
                v_cpus_available=1,
                v_cpus_per_core=1,
            ),
        ),
        location="westus",
        network_profile=azure_native.compute.NetworkProfileArgs(
            network_interfaces=[azure_native.compute.NetworkInterfaceReferenceArgs(
                id="/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary=True,
            )],
        ),
        os_profile=azure_native.compute.OSProfileArgs(
            admin_password="{your-password}",
            admin_username="{your-username}",
            computer_name="myVM",
        ),
        resource_group_name="myResourceGroup",
        storage_profile=azure_native.compute.StorageProfileArgs(
            image_reference=azure_native.compute.ImageReferenceArgs(
                offer="WindowsServer",
                publisher="MicrosoftWindowsServer",
                sku="2016-Datacenter",
                version="latest",
            ),
            os_disk=azure_native.compute.OSDiskArgs(
                caching=azure_native.compute.CachingTypes.READ_WRITE,
                create_option=azure_native.compute.DiskCreateOptionTypes.FROM_IMAGE,
                managed_disk=azure_native.compute.ManagedDiskParametersArgs(
                    storage_account_type=azure_native.compute.StorageAccountTypes.STANDARD_LRS,
                ),
                name="myVMosdisk",
            ),
        ),
        user_data="U29tZSBDdXN0b20gRGF0YQ==",
        vm_name="myVM")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const virtualMachine = new azure_native.compute.VirtualMachine("virtualMachine", {
        diagnosticsProfile: {
            bootDiagnostics: {
                enabled: true,
                storageUri: "http://{existing-storage-account-name}.blob.core.windows.net",
            },
        },
        hardwareProfile: {
            vmSize: azure_native.compute.VirtualMachineSizeTypes.Standard_D4_v3,
            vmSizeProperties: {
                vCPUsAvailable: 1,
                vCPUsPerCore: 1,
            },
        },
        location: "westus",
        networkProfile: {
            networkInterfaces: [{
                id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary: true,
            }],
        },
        osProfile: {
            adminPassword: "{your-password}",
            adminUsername: "{your-username}",
            computerName: "myVM",
        },
        resourceGroupName: "myResourceGroup",
        storageProfile: {
            imageReference: {
                offer: "WindowsServer",
                publisher: "MicrosoftWindowsServer",
                sku: "2016-Datacenter",
                version: "latest",
            },
            osDisk: {
                caching: azure_native.compute.CachingTypes.ReadWrite,
                createOption: azure_native.compute.DiskCreateOptionTypes.FromImage,
                managedDisk: {
                    storageAccountType: azure_native.compute.StorageAccountTypes.Standard_LRS,
                },
                name: "myVMosdisk",
            },
        },
        userData: "U29tZSBDdXN0b20gRGF0YQ==",
        vmName: "myVM",
    });
    
    resources:
      virtualMachine:
        type: azure-native:compute:VirtualMachine
        properties:
          diagnosticsProfile:
            bootDiagnostics:
              enabled: true
              storageUri: http://{existing-storage-account-name}.blob.core.windows.net
          hardwareProfile:
            vmSize: Standard_D4_v3
            vmSizeProperties:
              vCPUsAvailable: 1
              vCPUsPerCore: 1
          location: westus
          networkProfile:
            networkInterfaces:
              - id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}
                primary: true
          osProfile:
            adminPassword: '{your-password}'
            adminUsername: '{your-username}'
            computerName: myVM
          resourceGroupName: myResourceGroup
          storageProfile:
            imageReference:
              offer: WindowsServer
              publisher: MicrosoftWindowsServer
              sku: 2016-Datacenter
              version: latest
            osDisk:
              caching: ReadWrite
              createOption: FromImage
              managedDisk:
                storageAccountType: Standard_LRS
              name: myVMosdisk
          userData: U29tZSBDdXN0b20gRGF0YQ==
          vmName: myVM
    

    Create a VM with network interface configuration

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var virtualMachine = new AzureNative.Compute.VirtualMachine("virtualMachine", new()
        {
            HardwareProfile = new AzureNative.Compute.Inputs.HardwareProfileArgs
            {
                VmSize = AzureNative.Compute.VirtualMachineSizeTypes.Standard_D1_v2,
            },
            Location = "westus",
            NetworkProfile = new AzureNative.Compute.Inputs.NetworkProfileArgs
            {
                NetworkApiVersion = AzureNative.Compute.NetworkApiVersion.NetworkApiVersion_2020_11_01,
                NetworkInterfaceConfigurations = new[]
                {
                    new AzureNative.Compute.Inputs.VirtualMachineNetworkInterfaceConfigurationArgs
                    {
                        DeleteOption = AzureNative.Compute.DeleteOptions.Delete,
                        IpConfigurations = new[]
                        {
                            new AzureNative.Compute.Inputs.VirtualMachineNetworkInterfaceIPConfigurationArgs
                            {
                                Name = "{ip-config-name}",
                                Primary = true,
                                PublicIPAddressConfiguration = new AzureNative.Compute.Inputs.VirtualMachinePublicIPAddressConfigurationArgs
                                {
                                    DeleteOption = AzureNative.Compute.DeleteOptions.Detach,
                                    Name = "{publicIP-config-name}",
                                    PublicIPAllocationMethod = AzureNative.Compute.PublicIPAllocationMethod.Static,
                                    Sku = new AzureNative.Compute.Inputs.PublicIPAddressSkuArgs
                                    {
                                        Name = AzureNative.Compute.PublicIPAddressSkuName.Basic,
                                        Tier = AzureNative.Compute.PublicIPAddressSkuTier.Global,
                                    },
                                },
                            },
                        },
                        Name = "{nic-config-name}",
                        Primary = true,
                    },
                },
            },
            OsProfile = new AzureNative.Compute.Inputs.OSProfileArgs
            {
                AdminPassword = "{your-password}",
                AdminUsername = "{your-username}",
                ComputerName = "myVM",
            },
            ResourceGroupName = "myResourceGroup",
            StorageProfile = new AzureNative.Compute.Inputs.StorageProfileArgs
            {
                ImageReference = new AzureNative.Compute.Inputs.ImageReferenceArgs
                {
                    Offer = "WindowsServer",
                    Publisher = "MicrosoftWindowsServer",
                    Sku = "2016-Datacenter",
                    Version = "latest",
                },
                OsDisk = new AzureNative.Compute.Inputs.OSDiskArgs
                {
                    Caching = AzureNative.Compute.CachingTypes.ReadWrite,
                    CreateOption = AzureNative.Compute.DiskCreateOptionTypes.FromImage,
                    ManagedDisk = new AzureNative.Compute.Inputs.ManagedDiskParametersArgs
                    {
                        StorageAccountType = AzureNative.Compute.StorageAccountTypes.Standard_LRS,
                    },
                    Name = "myVMosdisk",
                },
            },
            VmName = "myVM",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewVirtualMachine(ctx, "virtualMachine", &compute.VirtualMachineArgs{
    			HardwareProfile: &compute.HardwareProfileArgs{
    				VmSize: pulumi.String(compute.VirtualMachineSizeTypes_Standard_D1_v2),
    			},
    			Location: pulumi.String("westus"),
    			NetworkProfile: &compute.NetworkProfileArgs{
    				NetworkApiVersion: pulumi.String(compute.NetworkApiVersion_2020_11_01),
    				NetworkInterfaceConfigurations: compute.VirtualMachineNetworkInterfaceConfigurationArray{
    					&compute.VirtualMachineNetworkInterfaceConfigurationArgs{
    						DeleteOption: pulumi.String(compute.DeleteOptionsDelete),
    						IpConfigurations: compute.VirtualMachineNetworkInterfaceIPConfigurationArray{
    							&compute.VirtualMachineNetworkInterfaceIPConfigurationArgs{
    								Name:    pulumi.String("{ip-config-name}"),
    								Primary: pulumi.Bool(true),
    								PublicIPAddressConfiguration: &compute.VirtualMachinePublicIPAddressConfigurationArgs{
    									DeleteOption:             pulumi.String(compute.DeleteOptionsDetach),
    									Name:                     pulumi.String("{publicIP-config-name}"),
    									PublicIPAllocationMethod: pulumi.String(compute.PublicIPAllocationMethodStatic),
    									Sku: &compute.PublicIPAddressSkuArgs{
    										Name: pulumi.String(compute.PublicIPAddressSkuNameBasic),
    										Tier: pulumi.String(compute.PublicIPAddressSkuTierGlobal),
    									},
    								},
    							},
    						},
    						Name:    pulumi.String("{nic-config-name}"),
    						Primary: pulumi.Bool(true),
    					},
    				},
    			},
    			OsProfile: &compute.OSProfileArgs{
    				AdminPassword: pulumi.String("{your-password}"),
    				AdminUsername: pulumi.String("{your-username}"),
    				ComputerName:  pulumi.String("myVM"),
    			},
    			ResourceGroupName: pulumi.String("myResourceGroup"),
    			StorageProfile: &compute.StorageProfileArgs{
    				ImageReference: &compute.ImageReferenceArgs{
    					Offer:     pulumi.String("WindowsServer"),
    					Publisher: pulumi.String("MicrosoftWindowsServer"),
    					Sku:       pulumi.String("2016-Datacenter"),
    					Version:   pulumi.String("latest"),
    				},
    				OsDisk: &compute.OSDiskArgs{
    					Caching:      compute.CachingTypesReadWrite,
    					CreateOption: pulumi.String(compute.DiskCreateOptionTypesFromImage),
    					ManagedDisk: &compute.ManagedDiskParametersArgs{
    						StorageAccountType: pulumi.String(compute.StorageAccountTypes_Standard_LRS),
    					},
    					Name: pulumi.String("myVMosdisk"),
    				},
    			},
    			VmName: pulumi.String("myVM"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.compute.VirtualMachine;
    import com.pulumi.azurenative.compute.VirtualMachineArgs;
    import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
    import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
    import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
    import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
    import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
    import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
    import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
                .hardwareProfile(HardwareProfileArgs.builder()
                    .vmSize("Standard_D1_v2")
                    .build())
                .location("westus")
                .networkProfile(NetworkProfileArgs.builder()
                    .networkApiVersion("2020-11-01")
                    .networkInterfaceConfigurations(VirtualMachineNetworkInterfaceConfigurationArgs.builder()
                        .deleteOption("Delete")
                        .ipConfigurations(VirtualMachineNetworkInterfaceIPConfigurationArgs.builder()
                            .name("{ip-config-name}")
                            .primary(true)
                            .publicIPAddressConfiguration(VirtualMachinePublicIPAddressConfigurationArgs.builder()
                                .deleteOption("Detach")
                                .name("{publicIP-config-name}")
                                .publicIPAllocationMethod("Static")
                                .sku(PublicIPAddressSkuArgs.builder()
                                    .name("Basic")
                                    .tier("Global")
                                    .build())
                                .build())
                            .build())
                        .name("{nic-config-name}")
                        .primary(true)
                        .build())
                    .build())
                .osProfile(OSProfileArgs.builder()
                    .adminPassword("{your-password}")
                    .adminUsername("{your-username}")
                    .computerName("myVM")
                    .build())
                .resourceGroupName("myResourceGroup")
                .storageProfile(StorageProfileArgs.builder()
                    .imageReference(ImageReferenceArgs.builder()
                        .offer("WindowsServer")
                        .publisher("MicrosoftWindowsServer")
                        .sku("2016-Datacenter")
                        .version("latest")
                        .build())
                    .osDisk(OSDiskArgs.builder()
                        .caching("ReadWrite")
                        .createOption("FromImage")
                        .managedDisk(ManagedDiskParametersArgs.builder()
                            .storageAccountType("Standard_LRS")
                            .build())
                        .name("myVMosdisk")
                        .build())
                    .build())
                .vmName("myVM")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    virtual_machine = azure_native.compute.VirtualMachine("virtualMachine",
        hardware_profile=azure_native.compute.HardwareProfileArgs(
            vm_size=azure_native.compute.VirtualMachineSizeTypes.STANDARD_D1_V2,
        ),
        location="westus",
        network_profile=azure_native.compute.NetworkProfileArgs(
            network_api_version=azure_native.compute.NetworkApiVersion.NETWORK_API_VERSION_2020_11_01,
            network_interface_configurations=[azure_native.compute.VirtualMachineNetworkInterfaceConfigurationArgs(
                delete_option=azure_native.compute.DeleteOptions.DELETE,
                ip_configurations=[azure_native.compute.VirtualMachineNetworkInterfaceIPConfigurationArgs(
                    name="{ip-config-name}",
                    primary=True,
                    public_ip_address_configuration=azure_native.compute.VirtualMachinePublicIPAddressConfigurationArgs(
                        delete_option=azure_native.compute.DeleteOptions.DETACH,
                        name="{publicIP-config-name}",
                        public_ip_allocation_method=azure_native.compute.PublicIPAllocationMethod.STATIC,
                        sku=azure_native.compute.PublicIPAddressSkuArgs(
                            name=azure_native.compute.PublicIPAddressSkuName.BASIC,
                            tier=azure_native.compute.PublicIPAddressSkuTier.GLOBAL_,
                        ),
                    ),
                )],
                name="{nic-config-name}",
                primary=True,
            )],
        ),
        os_profile=azure_native.compute.OSProfileArgs(
            admin_password="{your-password}",
            admin_username="{your-username}",
            computer_name="myVM",
        ),
        resource_group_name="myResourceGroup",
        storage_profile=azure_native.compute.StorageProfileArgs(
            image_reference=azure_native.compute.ImageReferenceArgs(
                offer="WindowsServer",
                publisher="MicrosoftWindowsServer",
                sku="2016-Datacenter",
                version="latest",
            ),
            os_disk=azure_native.compute.OSDiskArgs(
                caching=azure_native.compute.CachingTypes.READ_WRITE,
                create_option=azure_native.compute.DiskCreateOptionTypes.FROM_IMAGE,
                managed_disk=azure_native.compute.ManagedDiskParametersArgs(
                    storage_account_type=azure_native.compute.StorageAccountTypes.STANDARD_LRS,
                ),
                name="myVMosdisk",
            ),
        ),
        vm_name="myVM")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const virtualMachine = new azure_native.compute.VirtualMachine("virtualMachine", {
        hardwareProfile: {
            vmSize: azure_native.compute.VirtualMachineSizeTypes.Standard_D1_v2,
        },
        location: "westus",
        networkProfile: {
            networkApiVersion: azure_native.compute.NetworkApiVersion.NetworkApiVersion_2020_11_01,
            networkInterfaceConfigurations: [{
                deleteOption: azure_native.compute.DeleteOptions.Delete,
                ipConfigurations: [{
                    name: "{ip-config-name}",
                    primary: true,
                    publicIPAddressConfiguration: {
                        deleteOption: azure_native.compute.DeleteOptions.Detach,
                        name: "{publicIP-config-name}",
                        publicIPAllocationMethod: azure_native.compute.PublicIPAllocationMethod.Static,
                        sku: {
                            name: azure_native.compute.PublicIPAddressSkuName.Basic,
                            tier: azure_native.compute.PublicIPAddressSkuTier.Global,
                        },
                    },
                }],
                name: "{nic-config-name}",
                primary: true,
            }],
        },
        osProfile: {
            adminPassword: "{your-password}",
            adminUsername: "{your-username}",
            computerName: "myVM",
        },
        resourceGroupName: "myResourceGroup",
        storageProfile: {
            imageReference: {
                offer: "WindowsServer",
                publisher: "MicrosoftWindowsServer",
                sku: "2016-Datacenter",
                version: "latest",
            },
            osDisk: {
                caching: azure_native.compute.CachingTypes.ReadWrite,
                createOption: azure_native.compute.DiskCreateOptionTypes.FromImage,
                managedDisk: {
                    storageAccountType: azure_native.compute.StorageAccountTypes.Standard_LRS,
                },
                name: "myVMosdisk",
            },
        },
        vmName: "myVM",
    });
    
    resources:
      virtualMachine:
        type: azure-native:compute:VirtualMachine
        properties:
          hardwareProfile:
            vmSize: Standard_D1_v2
          location: westus
          networkProfile:
            networkApiVersion: 2020-11-01
            networkInterfaceConfigurations:
              - deleteOption: Delete
                ipConfigurations:
                  - name: '{ip-config-name}'
                    primary: true
                    publicIPAddressConfiguration:
                      deleteOption: Detach
                      name: '{publicIP-config-name}'
                      publicIPAllocationMethod: Static
                      sku:
                        name: Basic
                        tier: Global
                name: '{nic-config-name}'
                primary: true
          osProfile:
            adminPassword: '{your-password}'
            adminUsername: '{your-username}'
            computerName: myVM
          resourceGroupName: myResourceGroup
          storageProfile:
            imageReference:
              offer: WindowsServer
              publisher: MicrosoftWindowsServer
              sku: 2016-Datacenter
              version: latest
            osDisk:
              caching: ReadWrite
              createOption: FromImage
              managedDisk:
                storageAccountType: Standard_LRS
              name: myVMosdisk
          vmName: myVM
    

    Create a VM with securityType ConfidentialVM with Customer Managed Keys

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var virtualMachine = new AzureNative.Compute.VirtualMachine("virtualMachine", new()
        {
            HardwareProfile = new AzureNative.Compute.Inputs.HardwareProfileArgs
            {
                VmSize = "Standard_DC2as_v5",
            },
            Location = "westus",
            NetworkProfile = new AzureNative.Compute.Inputs.NetworkProfileArgs
            {
                NetworkInterfaces = new[]
                {
                    new AzureNative.Compute.Inputs.NetworkInterfaceReferenceArgs
                    {
                        Id = "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                        Primary = true,
                    },
                },
            },
            OsProfile = new AzureNative.Compute.Inputs.OSProfileArgs
            {
                AdminPassword = "{your-password}",
                AdminUsername = "{your-username}",
                ComputerName = "myVM",
            },
            ResourceGroupName = "myResourceGroup",
            SecurityProfile = new AzureNative.Compute.Inputs.SecurityProfileArgs
            {
                SecurityType = AzureNative.Compute.SecurityTypes.ConfidentialVM,
                UefiSettings = new AzureNative.Compute.Inputs.UefiSettingsArgs
                {
                    SecureBootEnabled = true,
                    VTpmEnabled = true,
                },
            },
            StorageProfile = new AzureNative.Compute.Inputs.StorageProfileArgs
            {
                ImageReference = new AzureNative.Compute.Inputs.ImageReferenceArgs
                {
                    Offer = "2019-datacenter-cvm",
                    Publisher = "MicrosoftWindowsServer",
                    Sku = "windows-cvm",
                    Version = "17763.2183.2109130127",
                },
                OsDisk = new AzureNative.Compute.Inputs.OSDiskArgs
                {
                    Caching = AzureNative.Compute.CachingTypes.ReadOnly,
                    CreateOption = AzureNative.Compute.DiskCreateOptionTypes.FromImage,
                    ManagedDisk = new AzureNative.Compute.Inputs.ManagedDiskParametersArgs
                    {
                        SecurityProfile = new AzureNative.Compute.Inputs.VMDiskSecurityProfileArgs
                        {
                            DiskEncryptionSet = new AzureNative.Compute.Inputs.DiskEncryptionSetParametersArgs
                            {
                                Id = "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}",
                            },
                            SecurityEncryptionType = AzureNative.Compute.SecurityEncryptionTypes.DiskWithVMGuestState,
                        },
                        StorageAccountType = AzureNative.Compute.StorageAccountTypes.StandardSSD_LRS,
                    },
                    Name = "myVMosdisk",
                },
            },
            VmName = "myVM",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewVirtualMachine(ctx, "virtualMachine", &compute.VirtualMachineArgs{
    			HardwareProfile: &compute.HardwareProfileArgs{
    				VmSize: pulumi.String("Standard_DC2as_v5"),
    			},
    			Location: pulumi.String("westus"),
    			NetworkProfile: &compute.NetworkProfileArgs{
    				NetworkInterfaces: compute.NetworkInterfaceReferenceArray{
    					&compute.NetworkInterfaceReferenceArgs{
    						Id:      pulumi.String("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"),
    						Primary: pulumi.Bool(true),
    					},
    				},
    			},
    			OsProfile: &compute.OSProfileArgs{
    				AdminPassword: pulumi.String("{your-password}"),
    				AdminUsername: pulumi.String("{your-username}"),
    				ComputerName:  pulumi.String("myVM"),
    			},
    			ResourceGroupName: pulumi.String("myResourceGroup"),
    			SecurityProfile: &compute.SecurityProfileArgs{
    				SecurityType: pulumi.String(compute.SecurityTypesConfidentialVM),
    				UefiSettings: &compute.UefiSettingsArgs{
    					SecureBootEnabled: pulumi.Bool(true),
    					VTpmEnabled:       pulumi.Bool(true),
    				},
    			},
    			StorageProfile: &compute.StorageProfileArgs{
    				ImageReference: &compute.ImageReferenceArgs{
    					Offer:     pulumi.String("2019-datacenter-cvm"),
    					Publisher: pulumi.String("MicrosoftWindowsServer"),
    					Sku:       pulumi.String("windows-cvm"),
    					Version:   pulumi.String("17763.2183.2109130127"),
    				},
    				OsDisk: &compute.OSDiskArgs{
    					Caching:      compute.CachingTypesReadOnly,
    					CreateOption: pulumi.String(compute.DiskCreateOptionTypesFromImage),
    					ManagedDisk: &compute.ManagedDiskParametersArgs{
    						SecurityProfile: &compute.VMDiskSecurityProfileArgs{
    							DiskEncryptionSet: &compute.DiskEncryptionSetParametersArgs{
    								Id: pulumi.String("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"),
    							},
    							SecurityEncryptionType: pulumi.String(compute.SecurityEncryptionTypesDiskWithVMGuestState),
    						},
    						StorageAccountType: pulumi.String(compute.StorageAccountTypes_StandardSSD_LRS),
    					},
    					Name: pulumi.String("myVMosdisk"),
    				},
    			},
    			VmName: pulumi.String("myVM"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.compute.VirtualMachine;
    import com.pulumi.azurenative.compute.VirtualMachineArgs;
    import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
    import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
    import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
    import com.pulumi.azurenative.compute.inputs.SecurityProfileArgs;
    import com.pulumi.azurenative.compute.inputs.UefiSettingsArgs;
    import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
    import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
    import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
    import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
    import com.pulumi.azurenative.compute.inputs.VMDiskSecurityProfileArgs;
    import com.pulumi.azurenative.compute.inputs.DiskEncryptionSetParametersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
                .hardwareProfile(HardwareProfileArgs.builder()
                    .vmSize("Standard_DC2as_v5")
                    .build())
                .location("westus")
                .networkProfile(NetworkProfileArgs.builder()
                    .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
                        .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
                        .primary(true)
                        .build())
                    .build())
                .osProfile(OSProfileArgs.builder()
                    .adminPassword("{your-password}")
                    .adminUsername("{your-username}")
                    .computerName("myVM")
                    .build())
                .resourceGroupName("myResourceGroup")
                .securityProfile(SecurityProfileArgs.builder()
                    .securityType("ConfidentialVM")
                    .uefiSettings(UefiSettingsArgs.builder()
                        .secureBootEnabled(true)
                        .vTpmEnabled(true)
                        .build())
                    .build())
                .storageProfile(StorageProfileArgs.builder()
                    .imageReference(ImageReferenceArgs.builder()
                        .offer("2019-datacenter-cvm")
                        .publisher("MicrosoftWindowsServer")
                        .sku("windows-cvm")
                        .version("17763.2183.2109130127")
                        .build())
                    .osDisk(OSDiskArgs.builder()
                        .caching("ReadOnly")
                        .createOption("FromImage")
                        .managedDisk(ManagedDiskParametersArgs.builder()
                            .securityProfile(VMDiskSecurityProfileArgs.builder()
                                .diskEncryptionSet(DiskEncryptionSetParametersArgs.builder()
                                    .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")
                                    .build())
                                .securityEncryptionType("DiskWithVMGuestState")
                                .build())
                            .storageAccountType("StandardSSD_LRS")
                            .build())
                        .name("myVMosdisk")
                        .build())
                    .build())
                .vmName("myVM")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    virtual_machine = azure_native.compute.VirtualMachine("virtualMachine",
        hardware_profile=azure_native.compute.HardwareProfileArgs(
            vm_size="Standard_DC2as_v5",
        ),
        location="westus",
        network_profile=azure_native.compute.NetworkProfileArgs(
            network_interfaces=[azure_native.compute.NetworkInterfaceReferenceArgs(
                id="/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary=True,
            )],
        ),
        os_profile=azure_native.compute.OSProfileArgs(
            admin_password="{your-password}",
            admin_username="{your-username}",
            computer_name="myVM",
        ),
        resource_group_name="myResourceGroup",
        security_profile=azure_native.compute.SecurityProfileArgs(
            security_type=azure_native.compute.SecurityTypes.CONFIDENTIAL_VM,
            uefi_settings=azure_native.compute.UefiSettingsArgs(
                secure_boot_enabled=True,
                v_tpm_enabled=True,
            ),
        ),
        storage_profile=azure_native.compute.StorageProfileArgs(
            image_reference=azure_native.compute.ImageReferenceArgs(
                offer="2019-datacenter-cvm",
                publisher="MicrosoftWindowsServer",
                sku="windows-cvm",
                version="17763.2183.2109130127",
            ),
            os_disk=azure_native.compute.OSDiskArgs(
                caching=azure_native.compute.CachingTypes.READ_ONLY,
                create_option=azure_native.compute.DiskCreateOptionTypes.FROM_IMAGE,
                managed_disk=azure_native.compute.ManagedDiskParametersArgs(
                    security_profile=azure_native.compute.VMDiskSecurityProfileArgs(
                        disk_encryption_set=azure_native.compute.DiskEncryptionSetParametersArgs(
                            id="/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}",
                        ),
                        security_encryption_type=azure_native.compute.SecurityEncryptionTypes.DISK_WITH_VM_GUEST_STATE,
                    ),
                    storage_account_type=azure_native.compute.StorageAccountTypes.STANDARD_SS_D_LRS,
                ),
                name="myVMosdisk",
            ),
        ),
        vm_name="myVM")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const virtualMachine = new azure_native.compute.VirtualMachine("virtualMachine", {
        hardwareProfile: {
            vmSize: "Standard_DC2as_v5",
        },
        location: "westus",
        networkProfile: {
            networkInterfaces: [{
                id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary: true,
            }],
        },
        osProfile: {
            adminPassword: "{your-password}",
            adminUsername: "{your-username}",
            computerName: "myVM",
        },
        resourceGroupName: "myResourceGroup",
        securityProfile: {
            securityType: azure_native.compute.SecurityTypes.ConfidentialVM,
            uefiSettings: {
                secureBootEnabled: true,
                vTpmEnabled: true,
            },
        },
        storageProfile: {
            imageReference: {
                offer: "2019-datacenter-cvm",
                publisher: "MicrosoftWindowsServer",
                sku: "windows-cvm",
                version: "17763.2183.2109130127",
            },
            osDisk: {
                caching: azure_native.compute.CachingTypes.ReadOnly,
                createOption: azure_native.compute.DiskCreateOptionTypes.FromImage,
                managedDisk: {
                    securityProfile: {
                        diskEncryptionSet: {
                            id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}",
                        },
                        securityEncryptionType: azure_native.compute.SecurityEncryptionTypes.DiskWithVMGuestState,
                    },
                    storageAccountType: azure_native.compute.StorageAccountTypes.StandardSSD_LRS,
                },
                name: "myVMosdisk",
            },
        },
        vmName: "myVM",
    });
    
    resources:
      virtualMachine:
        type: azure-native:compute:VirtualMachine
        properties:
          hardwareProfile:
            vmSize: Standard_DC2as_v5
          location: westus
          networkProfile:
            networkInterfaces:
              - id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}
                primary: true
          osProfile:
            adminPassword: '{your-password}'
            adminUsername: '{your-username}'
            computerName: myVM
          resourceGroupName: myResourceGroup
          securityProfile:
            securityType: ConfidentialVM
            uefiSettings:
              secureBootEnabled: true
              vTpmEnabled: true
          storageProfile:
            imageReference:
              offer: 2019-datacenter-cvm
              publisher: MicrosoftWindowsServer
              sku: windows-cvm
              version: 17763.2183.2109130127
            osDisk:
              caching: ReadOnly
              createOption: FromImage
              managedDisk:
                securityProfile:
                  diskEncryptionSet:
                    id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}
                  securityEncryptionType: DiskWithVMGuestState
                storageAccountType: StandardSSD_LRS
              name: myVMosdisk
          vmName: myVM
    

    Create a VM with securityType ConfidentialVM with Platform Managed Keys

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var virtualMachine = new AzureNative.Compute.VirtualMachine("virtualMachine", new()
        {
            HardwareProfile = new AzureNative.Compute.Inputs.HardwareProfileArgs
            {
                VmSize = "Standard_DC2as_v5",
            },
            Location = "westus",
            NetworkProfile = new AzureNative.Compute.Inputs.NetworkProfileArgs
            {
                NetworkInterfaces = new[]
                {
                    new AzureNative.Compute.Inputs.NetworkInterfaceReferenceArgs
                    {
                        Id = "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                        Primary = true,
                    },
                },
            },
            OsProfile = new AzureNative.Compute.Inputs.OSProfileArgs
            {
                AdminPassword = "{your-password}",
                AdminUsername = "{your-username}",
                ComputerName = "myVM",
            },
            ResourceGroupName = "myResourceGroup",
            SecurityProfile = new AzureNative.Compute.Inputs.SecurityProfileArgs
            {
                SecurityType = AzureNative.Compute.SecurityTypes.ConfidentialVM,
                UefiSettings = new AzureNative.Compute.Inputs.UefiSettingsArgs
                {
                    SecureBootEnabled = true,
                    VTpmEnabled = true,
                },
            },
            StorageProfile = new AzureNative.Compute.Inputs.StorageProfileArgs
            {
                ImageReference = new AzureNative.Compute.Inputs.ImageReferenceArgs
                {
                    Offer = "2019-datacenter-cvm",
                    Publisher = "MicrosoftWindowsServer",
                    Sku = "windows-cvm",
                    Version = "17763.2183.2109130127",
                },
                OsDisk = new AzureNative.Compute.Inputs.OSDiskArgs
                {
                    Caching = AzureNative.Compute.CachingTypes.ReadOnly,
                    CreateOption = AzureNative.Compute.DiskCreateOptionTypes.FromImage,
                    ManagedDisk = new AzureNative.Compute.Inputs.ManagedDiskParametersArgs
                    {
                        SecurityProfile = new AzureNative.Compute.Inputs.VMDiskSecurityProfileArgs
                        {
                            SecurityEncryptionType = AzureNative.Compute.SecurityEncryptionTypes.DiskWithVMGuestState,
                        },
                        StorageAccountType = AzureNative.Compute.StorageAccountTypes.StandardSSD_LRS,
                    },
                    Name = "myVMosdisk",
                },
            },
            VmName = "myVM",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewVirtualMachine(ctx, "virtualMachine", &compute.VirtualMachineArgs{
    			HardwareProfile: &compute.HardwareProfileArgs{
    				VmSize: pulumi.String("Standard_DC2as_v5"),
    			},
    			Location: pulumi.String("westus"),
    			NetworkProfile: &compute.NetworkProfileArgs{
    				NetworkInterfaces: compute.NetworkInterfaceReferenceArray{
    					&compute.NetworkInterfaceReferenceArgs{
    						Id:      pulumi.String("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"),
    						Primary: pulumi.Bool(true),
    					},
    				},
    			},
    			OsProfile: &compute.OSProfileArgs{
    				AdminPassword: pulumi.String("{your-password}"),
    				AdminUsername: pulumi.String("{your-username}"),
    				ComputerName:  pulumi.String("myVM"),
    			},
    			ResourceGroupName: pulumi.String("myResourceGroup"),
    			SecurityProfile: &compute.SecurityProfileArgs{
    				SecurityType: pulumi.String(compute.SecurityTypesConfidentialVM),
    				UefiSettings: &compute.UefiSettingsArgs{
    					SecureBootEnabled: pulumi.Bool(true),
    					VTpmEnabled:       pulumi.Bool(true),
    				},
    			},
    			StorageProfile: &compute.StorageProfileArgs{
    				ImageReference: &compute.ImageReferenceArgs{
    					Offer:     pulumi.String("2019-datacenter-cvm"),
    					Publisher: pulumi.String("MicrosoftWindowsServer"),
    					Sku:       pulumi.String("windows-cvm"),
    					Version:   pulumi.String("17763.2183.2109130127"),
    				},
    				OsDisk: &compute.OSDiskArgs{
    					Caching:      compute.CachingTypesReadOnly,
    					CreateOption: pulumi.String(compute.DiskCreateOptionTypesFromImage),
    					ManagedDisk: &compute.ManagedDiskParametersArgs{
    						SecurityProfile: &compute.VMDiskSecurityProfileArgs{
    							SecurityEncryptionType: pulumi.String(compute.SecurityEncryptionTypesDiskWithVMGuestState),
    						},
    						StorageAccountType: pulumi.String(compute.StorageAccountTypes_StandardSSD_LRS),
    					},
    					Name: pulumi.String("myVMosdisk"),
    				},
    			},
    			VmName: pulumi.String("myVM"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.compute.VirtualMachine;
    import com.pulumi.azurenative.compute.VirtualMachineArgs;
    import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
    import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
    import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
    import com.pulumi.azurenative.compute.inputs.SecurityProfileArgs;
    import com.pulumi.azurenative.compute.inputs.UefiSettingsArgs;
    import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
    import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
    import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
    import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
    import com.pulumi.azurenative.compute.inputs.VMDiskSecurityProfileArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
                .hardwareProfile(HardwareProfileArgs.builder()
                    .vmSize("Standard_DC2as_v5")
                    .build())
                .location("westus")
                .networkProfile(NetworkProfileArgs.builder()
                    .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
                        .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
                        .primary(true)
                        .build())
                    .build())
                .osProfile(OSProfileArgs.builder()
                    .adminPassword("{your-password}")
                    .adminUsername("{your-username}")
                    .computerName("myVM")
                    .build())
                .resourceGroupName("myResourceGroup")
                .securityProfile(SecurityProfileArgs.builder()
                    .securityType("ConfidentialVM")
                    .uefiSettings(UefiSettingsArgs.builder()
                        .secureBootEnabled(true)
                        .vTpmEnabled(true)
                        .build())
                    .build())
                .storageProfile(StorageProfileArgs.builder()
                    .imageReference(ImageReferenceArgs.builder()
                        .offer("2019-datacenter-cvm")
                        .publisher("MicrosoftWindowsServer")
                        .sku("windows-cvm")
                        .version("17763.2183.2109130127")
                        .build())
                    .osDisk(OSDiskArgs.builder()
                        .caching("ReadOnly")
                        .createOption("FromImage")
                        .managedDisk(ManagedDiskParametersArgs.builder()
                            .securityProfile(VMDiskSecurityProfileArgs.builder()
                                .securityEncryptionType("DiskWithVMGuestState")
                                .build())
                            .storageAccountType("StandardSSD_LRS")
                            .build())
                        .name("myVMosdisk")
                        .build())
                    .build())
                .vmName("myVM")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    virtual_machine = azure_native.compute.VirtualMachine("virtualMachine",
        hardware_profile=azure_native.compute.HardwareProfileArgs(
            vm_size="Standard_DC2as_v5",
        ),
        location="westus",
        network_profile=azure_native.compute.NetworkProfileArgs(
            network_interfaces=[azure_native.compute.NetworkInterfaceReferenceArgs(
                id="/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary=True,
            )],
        ),
        os_profile=azure_native.compute.OSProfileArgs(
            admin_password="{your-password}",
            admin_username="{your-username}",
            computer_name="myVM",
        ),
        resource_group_name="myResourceGroup",
        security_profile=azure_native.compute.SecurityProfileArgs(
            security_type=azure_native.compute.SecurityTypes.CONFIDENTIAL_VM,
            uefi_settings=azure_native.compute.UefiSettingsArgs(
                secure_boot_enabled=True,
                v_tpm_enabled=True,
            ),
        ),
        storage_profile=azure_native.compute.StorageProfileArgs(
            image_reference=azure_native.compute.ImageReferenceArgs(
                offer="2019-datacenter-cvm",
                publisher="MicrosoftWindowsServer",
                sku="windows-cvm",
                version="17763.2183.2109130127",
            ),
            os_disk=azure_native.compute.OSDiskArgs(
                caching=azure_native.compute.CachingTypes.READ_ONLY,
                create_option=azure_native.compute.DiskCreateOptionTypes.FROM_IMAGE,
                managed_disk=azure_native.compute.ManagedDiskParametersArgs(
                    security_profile=azure_native.compute.VMDiskSecurityProfileArgs(
                        security_encryption_type=azure_native.compute.SecurityEncryptionTypes.DISK_WITH_VM_GUEST_STATE,
                    ),
                    storage_account_type=azure_native.compute.StorageAccountTypes.STANDARD_SS_D_LRS,
                ),
                name="myVMosdisk",
            ),
        ),
        vm_name="myVM")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const virtualMachine = new azure_native.compute.VirtualMachine("virtualMachine", {
        hardwareProfile: {
            vmSize: "Standard_DC2as_v5",
        },
        location: "westus",
        networkProfile: {
            networkInterfaces: [{
                id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary: true,
            }],
        },
        osProfile: {
            adminPassword: "{your-password}",
            adminUsername: "{your-username}",
            computerName: "myVM",
        },
        resourceGroupName: "myResourceGroup",
        securityProfile: {
            securityType: azure_native.compute.SecurityTypes.ConfidentialVM,
            uefiSettings: {
                secureBootEnabled: true,
                vTpmEnabled: true,
            },
        },
        storageProfile: {
            imageReference: {
                offer: "2019-datacenter-cvm",
                publisher: "MicrosoftWindowsServer",
                sku: "windows-cvm",
                version: "17763.2183.2109130127",
            },
            osDisk: {
                caching: azure_native.compute.CachingTypes.ReadOnly,
                createOption: azure_native.compute.DiskCreateOptionTypes.FromImage,
                managedDisk: {
                    securityProfile: {
                        securityEncryptionType: azure_native.compute.SecurityEncryptionTypes.DiskWithVMGuestState,
                    },
                    storageAccountType: azure_native.compute.StorageAccountTypes.StandardSSD_LRS,
                },
                name: "myVMosdisk",
            },
        },
        vmName: "myVM",
    });
    
    resources:
      virtualMachine:
        type: azure-native:compute:VirtualMachine
        properties:
          hardwareProfile:
            vmSize: Standard_DC2as_v5
          location: westus
          networkProfile:
            networkInterfaces:
              - id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}
                primary: true
          osProfile:
            adminPassword: '{your-password}'
            adminUsername: '{your-username}'
            computerName: myVM
          resourceGroupName: myResourceGroup
          securityProfile:
            securityType: ConfidentialVM
            uefiSettings:
              secureBootEnabled: true
              vTpmEnabled: true
          storageProfile:
            imageReference:
              offer: 2019-datacenter-cvm
              publisher: MicrosoftWindowsServer
              sku: windows-cvm
              version: 17763.2183.2109130127
            osDisk:
              caching: ReadOnly
              createOption: FromImage
              managedDisk:
                securityProfile:
                  securityEncryptionType: DiskWithVMGuestState
                storageAccountType: StandardSSD_LRS
              name: myVMosdisk
          vmName: myVM
    

    Create a Windows vm with a patch setting assessmentMode of ImageDefault.

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var virtualMachine = new AzureNative.Compute.VirtualMachine("virtualMachine", new()
        {
            HardwareProfile = new AzureNative.Compute.Inputs.HardwareProfileArgs
            {
                VmSize = AzureNative.Compute.VirtualMachineSizeTypes.Standard_D1_v2,
            },
            Location = "westus",
            NetworkProfile = new AzureNative.Compute.Inputs.NetworkProfileArgs
            {
                NetworkInterfaces = new[]
                {
                    new AzureNative.Compute.Inputs.NetworkInterfaceReferenceArgs
                    {
                        Id = "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                        Primary = true,
                    },
                },
            },
            OsProfile = new AzureNative.Compute.Inputs.OSProfileArgs
            {
                AdminPassword = "{your-password}",
                AdminUsername = "{your-username}",
                ComputerName = "myVM",
                WindowsConfiguration = new AzureNative.Compute.Inputs.WindowsConfigurationArgs
                {
                    EnableAutomaticUpdates = true,
                    PatchSettings = new AzureNative.Compute.Inputs.PatchSettingsArgs
                    {
                        AssessmentMode = AzureNative.Compute.WindowsPatchAssessmentMode.ImageDefault,
                    },
                    ProvisionVMAgent = true,
                },
            },
            ResourceGroupName = "myResourceGroup",
            StorageProfile = new AzureNative.Compute.Inputs.StorageProfileArgs
            {
                ImageReference = new AzureNative.Compute.Inputs.ImageReferenceArgs
                {
                    Offer = "WindowsServer",
                    Publisher = "MicrosoftWindowsServer",
                    Sku = "2016-Datacenter",
                    Version = "latest",
                },
                OsDisk = new AzureNative.Compute.Inputs.OSDiskArgs
                {
                    Caching = AzureNative.Compute.CachingTypes.ReadWrite,
                    CreateOption = AzureNative.Compute.DiskCreateOptionTypes.FromImage,
                    ManagedDisk = new AzureNative.Compute.Inputs.ManagedDiskParametersArgs
                    {
                        StorageAccountType = AzureNative.Compute.StorageAccountTypes.Premium_LRS,
                    },
                    Name = "myVMosdisk",
                },
            },
            VmName = "myVM",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewVirtualMachine(ctx, "virtualMachine", &compute.VirtualMachineArgs{
    			HardwareProfile: &compute.HardwareProfileArgs{
    				VmSize: pulumi.String(compute.VirtualMachineSizeTypes_Standard_D1_v2),
    			},
    			Location: pulumi.String("westus"),
    			NetworkProfile: &compute.NetworkProfileArgs{
    				NetworkInterfaces: compute.NetworkInterfaceReferenceArray{
    					&compute.NetworkInterfaceReferenceArgs{
    						Id:      pulumi.String("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"),
    						Primary: pulumi.Bool(true),
    					},
    				},
    			},
    			OsProfile: &compute.OSProfileArgs{
    				AdminPassword: pulumi.String("{your-password}"),
    				AdminUsername: pulumi.String("{your-username}"),
    				ComputerName:  pulumi.String("myVM"),
    				WindowsConfiguration: &compute.WindowsConfigurationArgs{
    					EnableAutomaticUpdates: pulumi.Bool(true),
    					PatchSettings: &compute.PatchSettingsArgs{
    						AssessmentMode: pulumi.String(compute.WindowsPatchAssessmentModeImageDefault),
    					},
    					ProvisionVMAgent: pulumi.Bool(true),
    				},
    			},
    			ResourceGroupName: pulumi.String("myResourceGroup"),
    			StorageProfile: &compute.StorageProfileArgs{
    				ImageReference: &compute.ImageReferenceArgs{
    					Offer:     pulumi.String("WindowsServer"),
    					Publisher: pulumi.String("MicrosoftWindowsServer"),
    					Sku:       pulumi.String("2016-Datacenter"),
    					Version:   pulumi.String("latest"),
    				},
    				OsDisk: &compute.OSDiskArgs{
    					Caching:      compute.CachingTypesReadWrite,
    					CreateOption: pulumi.String(compute.DiskCreateOptionTypesFromImage),
    					ManagedDisk: &compute.ManagedDiskParametersArgs{
    						StorageAccountType: pulumi.String(compute.StorageAccountTypes_Premium_LRS),
    					},
    					Name: pulumi.String("myVMosdisk"),
    				},
    			},
    			VmName: pulumi.String("myVM"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.compute.VirtualMachine;
    import com.pulumi.azurenative.compute.VirtualMachineArgs;
    import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
    import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
    import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
    import com.pulumi.azurenative.compute.inputs.WindowsConfigurationArgs;
    import com.pulumi.azurenative.compute.inputs.PatchSettingsArgs;
    import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
    import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
    import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
    import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
                .hardwareProfile(HardwareProfileArgs.builder()
                    .vmSize("Standard_D1_v2")
                    .build())
                .location("westus")
                .networkProfile(NetworkProfileArgs.builder()
                    .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
                        .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
                        .primary(true)
                        .build())
                    .build())
                .osProfile(OSProfileArgs.builder()
                    .adminPassword("{your-password}")
                    .adminUsername("{your-username}")
                    .computerName("myVM")
                    .windowsConfiguration(WindowsConfigurationArgs.builder()
                        .enableAutomaticUpdates(true)
                        .patchSettings(PatchSettingsArgs.builder()
                            .assessmentMode("ImageDefault")
                            .build())
                        .provisionVMAgent(true)
                        .build())
                    .build())
                .resourceGroupName("myResourceGroup")
                .storageProfile(StorageProfileArgs.builder()
                    .imageReference(ImageReferenceArgs.builder()
                        .offer("WindowsServer")
                        .publisher("MicrosoftWindowsServer")
                        .sku("2016-Datacenter")
                        .version("latest")
                        .build())
                    .osDisk(OSDiskArgs.builder()
                        .caching("ReadWrite")
                        .createOption("FromImage")
                        .managedDisk(ManagedDiskParametersArgs.builder()
                            .storageAccountType("Premium_LRS")
                            .build())
                        .name("myVMosdisk")
                        .build())
                    .build())
                .vmName("myVM")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    virtual_machine = azure_native.compute.VirtualMachine("virtualMachine",
        hardware_profile=azure_native.compute.HardwareProfileArgs(
            vm_size=azure_native.compute.VirtualMachineSizeTypes.STANDARD_D1_V2,
        ),
        location="westus",
        network_profile=azure_native.compute.NetworkProfileArgs(
            network_interfaces=[azure_native.compute.NetworkInterfaceReferenceArgs(
                id="/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary=True,
            )],
        ),
        os_profile=azure_native.compute.OSProfileArgs(
            admin_password="{your-password}",
            admin_username="{your-username}",
            computer_name="myVM",
            windows_configuration=azure_native.compute.WindowsConfigurationArgs(
                enable_automatic_updates=True,
                patch_settings=azure_native.compute.PatchSettingsArgs(
                    assessment_mode=azure_native.compute.WindowsPatchAssessmentMode.IMAGE_DEFAULT,
                ),
                provision_vm_agent=True,
            ),
        ),
        resource_group_name="myResourceGroup",
        storage_profile=azure_native.compute.StorageProfileArgs(
            image_reference=azure_native.compute.ImageReferenceArgs(
                offer="WindowsServer",
                publisher="MicrosoftWindowsServer",
                sku="2016-Datacenter",
                version="latest",
            ),
            os_disk=azure_native.compute.OSDiskArgs(
                caching=azure_native.compute.CachingTypes.READ_WRITE,
                create_option=azure_native.compute.DiskCreateOptionTypes.FROM_IMAGE,
                managed_disk=azure_native.compute.ManagedDiskParametersArgs(
                    storage_account_type=azure_native.compute.StorageAccountTypes.PREMIUM_LRS,
                ),
                name="myVMosdisk",
            ),
        ),
        vm_name="myVM")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const virtualMachine = new azure_native.compute.VirtualMachine("virtualMachine", {
        hardwareProfile: {
            vmSize: azure_native.compute.VirtualMachineSizeTypes.Standard_D1_v2,
        },
        location: "westus",
        networkProfile: {
            networkInterfaces: [{
                id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary: true,
            }],
        },
        osProfile: {
            adminPassword: "{your-password}",
            adminUsername: "{your-username}",
            computerName: "myVM",
            windowsConfiguration: {
                enableAutomaticUpdates: true,
                patchSettings: {
                    assessmentMode: azure_native.compute.WindowsPatchAssessmentMode.ImageDefault,
                },
                provisionVMAgent: true,
            },
        },
        resourceGroupName: "myResourceGroup",
        storageProfile: {
            imageReference: {
                offer: "WindowsServer",
                publisher: "MicrosoftWindowsServer",
                sku: "2016-Datacenter",
                version: "latest",
            },
            osDisk: {
                caching: azure_native.compute.CachingTypes.ReadWrite,
                createOption: azure_native.compute.DiskCreateOptionTypes.FromImage,
                managedDisk: {
                    storageAccountType: azure_native.compute.StorageAccountTypes.Premium_LRS,
                },
                name: "myVMosdisk",
            },
        },
        vmName: "myVM",
    });
    
    resources:
      virtualMachine:
        type: azure-native:compute:VirtualMachine
        properties:
          hardwareProfile:
            vmSize: Standard_D1_v2
          location: westus
          networkProfile:
            networkInterfaces:
              - id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}
                primary: true
          osProfile:
            adminPassword: '{your-password}'
            adminUsername: '{your-username}'
            computerName: myVM
            windowsConfiguration:
              enableAutomaticUpdates: true
              patchSettings:
                assessmentMode: ImageDefault
              provisionVMAgent: true
          resourceGroupName: myResourceGroup
          storageProfile:
            imageReference:
              offer: WindowsServer
              publisher: MicrosoftWindowsServer
              sku: 2016-Datacenter
              version: latest
            osDisk:
              caching: ReadWrite
              createOption: FromImage
              managedDisk:
                storageAccountType: Premium_LRS
              name: myVMosdisk
          vmName: myVM
    

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

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var virtualMachine = new AzureNative.Compute.VirtualMachine("virtualMachine", new()
        {
            HardwareProfile = new AzureNative.Compute.Inputs.HardwareProfileArgs
            {
                VmSize = AzureNative.Compute.VirtualMachineSizeTypes.Standard_D1_v2,
            },
            Location = "westus",
            NetworkProfile = new AzureNative.Compute.Inputs.NetworkProfileArgs
            {
                NetworkInterfaces = new[]
                {
                    new AzureNative.Compute.Inputs.NetworkInterfaceReferenceArgs
                    {
                        Id = "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
                        Primary = true,
                    },
                },
            },
            OsProfile = new AzureNative.Compute.Inputs.OSProfileArgs
            {
                AdminPassword = "{your-password}",
                AdminUsername = "{your-username}",
                ComputerName = "myVM",
                WindowsConfiguration = new AzureNative.Compute.Inputs.WindowsConfigurationArgs
                {
                    EnableAutomaticUpdates = true,
                    PatchSettings = new AzureNative.Compute.Inputs.PatchSettingsArgs
                    {
                        PatchMode = AzureNative.Compute.WindowsVMGuestPatchMode.AutomaticByOS,
                    },
                    ProvisionVMAgent = true,
                },
            },
            ResourceGroupName = "myResourceGroup",
            StorageProfile = new AzureNative.Compute.Inputs.StorageProfileArgs
            {
                ImageReference = new AzureNative.Compute.Inputs.ImageReferenceArgs
                {
                    Offer = "WindowsServer",
                    Publisher = "MicrosoftWindowsServer",
                    Sku = "2016-Datacenter",
                    Version = "latest",
                },
                OsDisk = new AzureNative.Compute.Inputs.OSDiskArgs
                {
                    Caching = AzureNative.Compute.CachingTypes.ReadWrite,
                    CreateOption = AzureNative.Compute.DiskCreateOptionTypes.FromImage,
                    ManagedDisk = new AzureNative.Compute.Inputs.ManagedDiskParametersArgs
                    {
                        StorageAccountType = AzureNative.Compute.StorageAccountTypes.Premium_LRS,
                    },
                    Name = "myVMosdisk",
                },
            },
            VmName = "myVM",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewVirtualMachine(ctx, "virtualMachine", &compute.VirtualMachineArgs{
    			HardwareProfile: &compute.HardwareProfileArgs{
    				VmSize: pulumi.String(compute.VirtualMachineSizeTypes_Standard_D1_v2),
    			},
    			Location: pulumi.String("westus"),
    			NetworkProfile: &compute.NetworkProfileArgs{
    				NetworkInterfaces: compute.NetworkInterfaceReferenceArray{
    					&compute.NetworkInterfaceReferenceArgs{
    						Id:      pulumi.String("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic"),
    						Primary: pulumi.Bool(true),
    					},
    				},
    			},
    			OsProfile: &compute.OSProfileArgs{
    				AdminPassword: pulumi.String("{your-password}"),
    				AdminUsername: pulumi.String("{your-username}"),
    				ComputerName:  pulumi.String("myVM"),
    				WindowsConfiguration: &compute.WindowsConfigurationArgs{
    					EnableAutomaticUpdates: pulumi.Bool(true),
    					PatchSettings: &compute.PatchSettingsArgs{
    						PatchMode: pulumi.String(compute.WindowsVMGuestPatchModeAutomaticByOS),
    					},
    					ProvisionVMAgent: pulumi.Bool(true),
    				},
    			},
    			ResourceGroupName: pulumi.String("myResourceGroup"),
    			StorageProfile: &compute.StorageProfileArgs{
    				ImageReference: &compute.ImageReferenceArgs{
    					Offer:     pulumi.String("WindowsServer"),
    					Publisher: pulumi.String("MicrosoftWindowsServer"),
    					Sku:       pulumi.String("2016-Datacenter"),
    					Version:   pulumi.String("latest"),
    				},
    				OsDisk: &compute.OSDiskArgs{
    					Caching:      compute.CachingTypesReadWrite,
    					CreateOption: pulumi.String(compute.DiskCreateOptionTypesFromImage),
    					ManagedDisk: &compute.ManagedDiskParametersArgs{
    						StorageAccountType: pulumi.String(compute.StorageAccountTypes_Premium_LRS),
    					},
    					Name: pulumi.String("myVMosdisk"),
    				},
    			},
    			VmName: pulumi.String("myVM"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.compute.VirtualMachine;
    import com.pulumi.azurenative.compute.VirtualMachineArgs;
    import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
    import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
    import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
    import com.pulumi.azurenative.compute.inputs.WindowsConfigurationArgs;
    import com.pulumi.azurenative.compute.inputs.PatchSettingsArgs;
    import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
    import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
    import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
    import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
                .hardwareProfile(HardwareProfileArgs.builder()
                    .vmSize("Standard_D1_v2")
                    .build())
                .location("westus")
                .networkProfile(NetworkProfileArgs.builder()
                    .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
                        .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic")
                        .primary(true)
                        .build())
                    .build())
                .osProfile(OSProfileArgs.builder()
                    .adminPassword("{your-password}")
                    .adminUsername("{your-username}")
                    .computerName("myVM")
                    .windowsConfiguration(WindowsConfigurationArgs.builder()
                        .enableAutomaticUpdates(true)
                        .patchSettings(PatchSettingsArgs.builder()
                            .patchMode("AutomaticByOS")
                            .build())
                        .provisionVMAgent(true)
                        .build())
                    .build())
                .resourceGroupName("myResourceGroup")
                .storageProfile(StorageProfileArgs.builder()
                    .imageReference(ImageReferenceArgs.builder()
                        .offer("WindowsServer")
                        .publisher("MicrosoftWindowsServer")
                        .sku("2016-Datacenter")
                        .version("latest")
                        .build())
                    .osDisk(OSDiskArgs.builder()
                        .caching("ReadWrite")
                        .createOption("FromImage")
                        .managedDisk(ManagedDiskParametersArgs.builder()
                            .storageAccountType("Premium_LRS")
                            .build())
                        .name("myVMosdisk")
                        .build())
                    .build())
                .vmName("myVM")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    virtual_machine = azure_native.compute.VirtualMachine("virtualMachine",
        hardware_profile=azure_native.compute.HardwareProfileArgs(
            vm_size=azure_native.compute.VirtualMachineSizeTypes.STANDARD_D1_V2,
        ),
        location="westus",
        network_profile=azure_native.compute.NetworkProfileArgs(
            network_interfaces=[azure_native.compute.NetworkInterfaceReferenceArgs(
                id="/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
                primary=True,
            )],
        ),
        os_profile=azure_native.compute.OSProfileArgs(
            admin_password="{your-password}",
            admin_username="{your-username}",
            computer_name="myVM",
            windows_configuration=azure_native.compute.WindowsConfigurationArgs(
                enable_automatic_updates=True,
                patch_settings=azure_native.compute.PatchSettingsArgs(
                    patch_mode=azure_native.compute.WindowsVMGuestPatchMode.AUTOMATIC_BY_OS,
                ),
                provision_vm_agent=True,
            ),
        ),
        resource_group_name="myResourceGroup",
        storage_profile=azure_native.compute.StorageProfileArgs(
            image_reference=azure_native.compute.ImageReferenceArgs(
                offer="WindowsServer",
                publisher="MicrosoftWindowsServer",
                sku="2016-Datacenter",
                version="latest",
            ),
            os_disk=azure_native.compute.OSDiskArgs(
                caching=azure_native.compute.CachingTypes.READ_WRITE,
                create_option=azure_native.compute.DiskCreateOptionTypes.FROM_IMAGE,
                managed_disk=azure_native.compute.ManagedDiskParametersArgs(
                    storage_account_type=azure_native.compute.StorageAccountTypes.PREMIUM_LRS,
                ),
                name="myVMosdisk",
            ),
        ),
        vm_name="myVM")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const virtualMachine = new azure_native.compute.VirtualMachine("virtualMachine", {
        hardwareProfile: {
            vmSize: azure_native.compute.VirtualMachineSizeTypes.Standard_D1_v2,
        },
        location: "westus",
        networkProfile: {
            networkInterfaces: [{
                id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
                primary: true,
            }],
        },
        osProfile: {
            adminPassword: "{your-password}",
            adminUsername: "{your-username}",
            computerName: "myVM",
            windowsConfiguration: {
                enableAutomaticUpdates: true,
                patchSettings: {
                    patchMode: azure_native.compute.WindowsVMGuestPatchMode.AutomaticByOS,
                },
                provisionVMAgent: true,
            },
        },
        resourceGroupName: "myResourceGroup",
        storageProfile: {
            imageReference: {
                offer: "WindowsServer",
                publisher: "MicrosoftWindowsServer",
                sku: "2016-Datacenter",
                version: "latest",
            },
            osDisk: {
                caching: azure_native.compute.CachingTypes.ReadWrite,
                createOption: azure_native.compute.DiskCreateOptionTypes.FromImage,
                managedDisk: {
                    storageAccountType: azure_native.compute.StorageAccountTypes.Premium_LRS,
                },
                name: "myVMosdisk",
            },
        },
        vmName: "myVM",
    });
    
    resources:
      virtualMachine:
        type: azure-native:compute:VirtualMachine
        properties:
          hardwareProfile:
            vmSize: Standard_D1_v2
          location: westus
          networkProfile:
            networkInterfaces:
              - id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic
                primary: true
          osProfile:
            adminPassword: '{your-password}'
            adminUsername: '{your-username}'
            computerName: myVM
            windowsConfiguration:
              enableAutomaticUpdates: true
              patchSettings:
                patchMode: AutomaticByOS
              provisionVMAgent: true
          resourceGroupName: myResourceGroup
          storageProfile:
            imageReference:
              offer: WindowsServer
              publisher: MicrosoftWindowsServer
              sku: 2016-Datacenter
              version: latest
            osDisk:
              caching: ReadWrite
              createOption: FromImage
              managedDisk:
                storageAccountType: Premium_LRS
              name: myVMosdisk
          vmName: myVM
    

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

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var virtualMachine = new AzureNative.Compute.VirtualMachine("virtualMachine", new()
        {
            HardwareProfile = new AzureNative.Compute.Inputs.HardwareProfileArgs
            {
                VmSize = AzureNative.Compute.VirtualMachineSizeTypes.Standard_D1_v2,
            },
            Location = "westus",
            NetworkProfile = new AzureNative.Compute.Inputs.NetworkProfileArgs
            {
                NetworkInterfaces = new[]
                {
                    new AzureNative.Compute.Inputs.NetworkInterfaceReferenceArgs
                    {
                        Id = "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                        Primary = true,
                    },
                },
            },
            OsProfile = new AzureNative.Compute.Inputs.OSProfileArgs
            {
                AdminPassword = "{your-password}",
                AdminUsername = "{your-username}",
                ComputerName = "myVM",
                WindowsConfiguration = new AzureNative.Compute.Inputs.WindowsConfigurationArgs
                {
                    EnableAutomaticUpdates = true,
                    PatchSettings = new AzureNative.Compute.Inputs.PatchSettingsArgs
                    {
                        AssessmentMode = AzureNative.Compute.WindowsPatchAssessmentMode.AutomaticByPlatform,
                        AutomaticByPlatformSettings = new AzureNative.Compute.Inputs.WindowsVMGuestPatchAutomaticByPlatformSettingsArgs
                        {
                            BypassPlatformSafetyChecksOnUserSchedule = false,
                            RebootSetting = AzureNative.Compute.WindowsVMGuestPatchAutomaticByPlatformRebootSetting.Never,
                        },
                        PatchMode = AzureNative.Compute.WindowsVMGuestPatchMode.AutomaticByPlatform,
                    },
                    ProvisionVMAgent = true,
                },
            },
            ResourceGroupName = "myResourceGroup",
            StorageProfile = new AzureNative.Compute.Inputs.StorageProfileArgs
            {
                ImageReference = new AzureNative.Compute.Inputs.ImageReferenceArgs
                {
                    Offer = "WindowsServer",
                    Publisher = "MicrosoftWindowsServer",
                    Sku = "2016-Datacenter",
                    Version = "latest",
                },
                OsDisk = new AzureNative.Compute.Inputs.OSDiskArgs
                {
                    Caching = AzureNative.Compute.CachingTypes.ReadWrite,
                    CreateOption = AzureNative.Compute.DiskCreateOptionTypes.FromImage,
                    ManagedDisk = new AzureNative.Compute.Inputs.ManagedDiskParametersArgs
                    {
                        StorageAccountType = AzureNative.Compute.StorageAccountTypes.Premium_LRS,
                    },
                    Name = "myVMosdisk",
                },
            },
            VmName = "myVM",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/compute/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := compute.NewVirtualMachine(ctx, "virtualMachine", &compute.VirtualMachineArgs{
    			HardwareProfile: &compute.HardwareProfileArgs{
    				VmSize: pulumi.String(compute.VirtualMachineSizeTypes_Standard_D1_v2),
    			},
    			Location: pulumi.String("westus"),
    			NetworkProfile: &compute.NetworkProfileArgs{
    				NetworkInterfaces: compute.NetworkInterfaceReferenceArray{
    					&compute.NetworkInterfaceReferenceArgs{
    						Id:      pulumi.String("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}"),
    						Primary: pulumi.Bool(true),
    					},
    				},
    			},
    			OsProfile: &compute.OSProfileArgs{
    				AdminPassword: pulumi.String("{your-password}"),
    				AdminUsername: pulumi.String("{your-username}"),
    				ComputerName:  pulumi.String("myVM"),
    				WindowsConfiguration: &compute.WindowsConfigurationArgs{
    					EnableAutomaticUpdates: pulumi.Bool(true),
    					PatchSettings: &compute.PatchSettingsArgs{
    						AssessmentMode: pulumi.String(compute.WindowsPatchAssessmentModeAutomaticByPlatform),
    						AutomaticByPlatformSettings: &compute.WindowsVMGuestPatchAutomaticByPlatformSettingsArgs{
    							BypassPlatformSafetyChecksOnUserSchedule: pulumi.Bool(false),
    							RebootSetting:                            pulumi.String(compute.WindowsVMGuestPatchAutomaticByPlatformRebootSettingNever),
    						},
    						PatchMode: pulumi.String(compute.WindowsVMGuestPatchModeAutomaticByPlatform),
    					},
    					ProvisionVMAgent: pulumi.Bool(true),
    				},
    			},
    			ResourceGroupName: pulumi.String("myResourceGroup"),
    			StorageProfile: &compute.StorageProfileArgs{
    				ImageReference: &compute.ImageReferenceArgs{
    					Offer:     pulumi.String("WindowsServer"),
    					Publisher: pulumi.String("MicrosoftWindowsServer"),
    					Sku:       pulumi.String("2016-Datacenter"),
    					Version:   pulumi.String("latest"),
    				},
    				OsDisk: &compute.OSDiskArgs{
    					Caching:      compute.CachingTypesReadWrite,
    					CreateOption: pulumi.String(compute.DiskCreateOptionTypesFromImage),
    					ManagedDisk: &compute.ManagedDiskParametersArgs{
    						StorageAccountType: pulumi.String(compute.StorageAccountTypes_Premium_LRS),
    					},
    					Name: pulumi.String("myVMosdisk"),
    				},
    			},
    			VmName: pulumi.String("myVM"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azurenative.compute.VirtualMachine;
    import com.pulumi.azurenative.compute.VirtualMachineArgs;
    import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
    import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
    import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
    import com.pulumi.azurenative.compute.inputs.WindowsConfigurationArgs;
    import com.pulumi.azurenative.compute.inputs.PatchSettingsArgs;
    import com.pulumi.azurenative.compute.inputs.WindowsVMGuestPatchAutomaticByPlatformSettingsArgs;
    import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
    import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
    import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
    import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
                .hardwareProfile(HardwareProfileArgs.builder()
                    .vmSize("Standard_D1_v2")
                    .build())
                .location("westus")
                .networkProfile(NetworkProfileArgs.builder()
                    .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
                        .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
                        .primary(true)
                        .build())
                    .build())
                .osProfile(OSProfileArgs.builder()
                    .adminPassword("{your-password}")
                    .adminUsername("{your-username}")
                    .computerName("myVM")
                    .windowsConfiguration(WindowsConfigurationArgs.builder()
                        .enableAutomaticUpdates(true)
                        .patchSettings(PatchSettingsArgs.builder()
                            .assessmentMode("AutomaticByPlatform")
                            .automaticByPlatformSettings(WindowsVMGuestPatchAutomaticByPlatformSettingsArgs.builder()
                                .bypassPlatformSafetyChecksOnUserSchedule(false)
                                .rebootSetting("Never")
                                .build())
                            .patchMode("AutomaticByPlatform")
                            .build())
                        .provisionVMAgent(true)
                        .build())
                    .build())
                .resourceGroupName("myResourceGroup")
                .storageProfile(StorageProfileArgs.builder()
                    .imageReference(ImageReferenceArgs.builder()
                        .offer("WindowsServer")
                        .publisher("MicrosoftWindowsServer")
                        .sku("2016-Datacenter")
                        .version("latest")
                        .build())
                    .osDisk(OSDiskArgs.builder()
                        .caching("ReadWrite")
                        .createOption("FromImage")
                        .managedDisk(ManagedDiskParametersArgs.builder()
                            .storageAccountType("Premium_LRS")
                            .build())
                        .name("myVMosdisk")
                        .build())
                    .build())
                .vmName("myVM")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    virtual_machine = azure_native.compute.VirtualMachine("virtualMachine",
        hardware_profile=azure_native.compute.HardwareProfileArgs(
            vm_size=azure_native.compute.VirtualMachineSizeTypes.STANDARD_D1_V2,
        ),
        location="westus",
        network_profile=azure_native.compute.NetworkProfileArgs(
            network_interfaces=[azure_native.compute.NetworkInterfaceReferenceArgs(
                id="/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary=True,
            )],
        ),
        os_profile=azure_native.compute.OSProfileArgs(
            admin_password="{your-password}",
            admin_username="{your-username}",
            computer_name="myVM",
            windows_configuration=azure_native.compute.WindowsConfigurationArgs(
                enable_automatic_updates=True,
                patch_settings=azure_native.compute.PatchSettingsArgs(
                    assessment_mode=azure_native.compute.WindowsPatchAssessmentMode.AUTOMATIC_BY_PLATFORM,
                    automatic_by_platform_settings=azure_native.compute.WindowsVMGuestPatchAutomaticByPlatformSettingsArgs(
                        bypass_platform_safety_checks_on_user_schedule=False,
                        reboot_setting=azure_native.compute.WindowsVMGuestPatchAutomaticByPlatformRebootSetting.NEVER,
                    ),
                    patch_mode=azure_native.compute.WindowsVMGuestPatchMode.AUTOMATIC_BY_PLATFORM,
                ),
                provision_vm_agent=True,
            ),
        ),
        resource_group_name="myResourceGroup",
        storage_profile=azure_native.compute.StorageProfileArgs(
            image_reference=azure_native.compute.ImageReferenceArgs(
                offer="WindowsServer",
                publisher="MicrosoftWindowsServer",
                sku="2016-Datacenter",
                version="latest",
            ),
            os_disk=azure_native.compute.OSDiskArgs(
                caching=azure_native.compute.CachingTypes.READ_WRITE,
                create_option=azure_native.compute.DiskCreateOptionTypes.FROM_IMAGE,
                managed_disk=azure_native.compute.ManagedDiskParametersArgs(
                    storage_account_type=azure_native.compute.StorageAccountTypes.PREMIUM_LRS,
                ),
                name="myVMosdisk",
            ),
        ),
        vm_name="myVM")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const virtualMachine = new azure_native.compute.VirtualMachine("virtualMachine", {
        hardwareProfile: {
            vmSize: azure_native.compute.VirtualMachineSizeTypes.Standard_D1_v2,
        },
        location: "westus",
        networkProfile: {
            networkInterfaces: [{
                id: "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
                primary: true,
            }],
        },
        osProfile: {
            adminPassword: "{your-password}",
            adminUsername: "{your-username}",
            computerName: "myVM",
            windowsConfiguration: {
                enableAutomaticUpdates: true,
                patchSettings: {
                    assessmentMode: azure_native.compute.WindowsPatchAssessmentMode.AutomaticByPlatform,
                    automaticByPlatformSettings: {
                        bypassPlatformSafetyChecksOnUserSchedule: false,
                        rebootSetting: azure_native.compute.WindowsVMGuestPatchAutomaticByPlatformRebootSetting.Never,
                    },
                    patchMode: azure_native.compute.WindowsVMGuestPatchMode.AutomaticByPlatform,
                },
                provisionVMAgent: true,
            },
        },
        resourceGroupName: "myResourceGroup",
        storageProfile: {
            imageReference: {
                offer: "WindowsServer",
                publisher: "MicrosoftWindowsServer",
                sku: "2016-Datacenter",
                version: "latest",
            },
            osDisk: {
                caching: azure_native.compute.CachingTypes.ReadWrite,
                createOption: azure_native.compute.DiskCreateOptionTypes.FromImage,
                managedDisk: {
                    storageAccountType: azure_native.compute.StorageAccountTypes.Premium_LRS,
                },
                name: "myVMosdisk",
            },
        },
        vmName: "myVM",
    });
    
    resources:
      virtualMachine:
        type: azure-native:compute:VirtualMachine
        properties:
          hardwareProfile:
            vmSize: Standard_D1_v2
          location: westus
          networkProfile:
            networkInterfaces:
              - id: /subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}
                primary: true
          osProfile:
            adminPassword: '{your-password}'
            adminUsername: '{your-username}'
            computerName: myVM
            windowsConfiguration:
              enableAutomaticUpdates: true
              patchSettings:
                assessmentMode: AutomaticByPlatform
                automaticByPlatformSettings:
                  bypassPlatformSafetyChecksOnUserSchedule: false
                  rebootSetting: Never
                patchMode: AutomaticByPlatform
              provisionVMAgent: true
          resourceGroupName: myResourceGroup
          storageProfile:
            imageReference:
              offer: WindowsServer
              publisher: MicrosoftWindowsServer
              sku: 2016-Datacenter
              version: latest
            osDisk:
              caching: ReadWrite
              createOption: FromImage
              managedDisk:
                storageAccountType: Premium_LRS
              name: myVMosdisk
          vmName: myVM
    

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

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync