https://pulumi.com logo
#azure
Title
# azure
w

white-window-26081

07/12/2023, 3:30 PM
Copy code
virtual_machine = azure_native.compute.VirtualMachine("virtualMachine",
    hardware_profile=azure_native.compute.HardwareProfileArgs(
        vm_size="Standard_D2s_v3",
    ),
    location="westus",
    network_profile=azure_native.compute.NetworkProfileResponseArgs(
        network_interfaces=[azure_native.compute.NetworkInterfaceReferenceArgs(
            id="/subscriptions/MYSUBID/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nic",
            primary=True,
        )],
    ),
    os_profile=azure_native.compute.OSProfileResponseArgs(
        admin_password="admin",
        admin_username="admin",
        computer_name="myVM",
        linux_configuration={
            "patchSettings": azure_native.compute.LinuxPatchSettingsArgs(
                assessment_mode="ImageDefault",
            ),
            "provisionVMAgent": True,
        },
    ),
    resource_group_name="myResourceGroup",
    storage_profile=azure_native.compute.StorageProfileResponseArgs(
        image_reference=azure_native.compute.ImageReferenceArgs(
            offer="UbuntuServer",
            publisher="Canonical",
            sku="16.04-LTS",
            version="latest",
        ),
        os_disk={
            "caching": azure_native.compute.CachingTypes.READ_WRITE,
            "createOption": "FromImage",
            "managedDisk": azure_native.compute.ManagedDiskParametersArgs(
                storage_account_type="Premium_LRS",
            ),
            "name": "myVMosdisk",
        },
    ),
    vm_name="myVM")