共用方式為


Virtual Machines - Create Or Update

建立或更新虛擬機的作業。 請注意,某些屬性只能在虛擬機建立期間設定。

PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}?api-version=2024-03-01

URI 參數

名稱 位於 必要 類型 Description
resourceGroupName
path True

string

資源群組的名稱。

subscriptionId
path True

string

可唯一識別 Microsoft Azure 訂用帳戶的訂用帳戶認證。 訂用帳戶識別碼會構成每個服務呼叫 URI 的一部分。

vmName
path True

string

虛擬機器的名稱。

api-version
query True

string

用戶端 API 版本。

要求標頭

名稱 必要 類型 Description
If-Match

string

轉換的ETag。 省略此值以一律覆寫目前的資源。 指定最後一個出現的 ETag 值,以防止意外覆寫並行變更。

If-None-Match

string

設定為 『*』 以允許建立新的記錄集,但為了避免更新現有的記錄集。 其他值會導致伺服器發生錯誤,因為它們不受支援。

要求本文

名稱 類型 Description
parameters

VirtualMachine

提供給建立虛擬機作業的參數。

回應

名稱 類型 Description
200 OK

VirtualMachine

確定

201 Created

VirtualMachine

建立時間

Other Status Codes

CloudError

描述作業失敗原因的錯誤回應。

安全性

azure_auth

Azure Active Directory OAuth2 Flow

類型: oauth2
Flow: implicit
授權 URL: https://login.microsoftonline.com/common/oauth2/authorize

範圍

名稱 Description
user_impersonation 模擬您的用戶帳戶

範例

Create a custom-image vm from an unmanaged generalized os image.
Create a Linux vm with a patch setting assessmentMode of ImageDefault.
Create a Linux vm with a patch setting patchMode of AutomaticByPlatform and AutomaticByPlatformSettings.
Create a Linux vm with a patch setting patchMode of ImageDefault.
Create a Linux vm with a patch settings patchMode and assessmentMode set to AutomaticByPlatform.
Create a platform-image vm with unmanaged os and data disks.
Create a VM from a community gallery image
Create a vm from a custom image.
Create a vm from a generalized shared image.
Create a VM from a shared gallery image
Create a vm from a specialized shared image.
Create a vm in a Virtual Machine Scale Set with customer assigned platformFaultDomain.
Create a vm in an availability set.
Create a vm with a marketplace image plan.
Create a vm with an extensions time budget.
Create a vm with Application Profile.
Create a vm with boot diagnostics.
Create a vm with data disks using 'Copy' and 'Restore' options.
Create a VM with Disk Controller Type
Create a vm with DiskEncryptionSet resource id in the os disk and data disk.
Create a vm with empty data disks.
Create a VM with encryption identity
Create a vm with ephemeral os disk provisioning in Cache disk using placement property.
Create a vm with ephemeral os disk provisioning in Nvme disk using placement property.
Create a vm with ephemeral os disk provisioning in Resource disk using placement property.
Create a vm with ephemeral os disk.
Create a VM with HibernationEnabled
Create a vm with Host Encryption using encryptionAtHost property.
Create a vm with managed boot diagnostics.
Create a VM with network interface configuration
Create a VM with network interface configuration with public ip address dns settings
Create a vm with password authentication.
Create a vm with premium storage.
Create a VM with ProxyAgent Settings of enabled and mode.
Create a vm with Scheduled Events Profile
Create a VM with securityType ConfidentialVM with Customer Managed Keys
Create a VM with securityType ConfidentialVM with NonPersistedTPM securityEncryptionType
Create a VM with securityType ConfidentialVM with Platform Managed Keys
Create a vm with ssh authentication.
Create a VM with Uefi Settings of secureBoot and vTPM.
Create a VM with UserData
Create a VM with VM Size Properties
Create a Windows vm with a patch setting assessmentMode of ImageDefault.
Create a Windows vm with a patch setting patchMode of AutomaticByOS.
Create a Windows vm with a patch setting patchMode of AutomaticByPlatform and AutomaticByPlatformSettings.
Create a Windows vm with a patch setting patchMode of AutomaticByPlatform and enableHotpatching set to true.
Create a Windows vm with a patch setting patchMode of Manual.
Create a Windows vm with patch settings patchMode and assessmentMode set to AutomaticByPlatform.
Create or update a VM with capacity reservation

Create a custom-image vm from an unmanaged generalized os image.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/{vm-name}?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "osDisk": {
        "name": "myVMosdisk",
        "image": {
          "uri": "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd"
        },
        "osType": "Windows",
        "createOption": "FromImage",
        "caching": "ReadWrite",
        "vhd": {
          "uri": "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd"
        }
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "osDisk": {
        "name": "myVMosdisk",
        "image": {
          "uri": "https://{existing-storage-account-name}.blob.core.windows.net/system/Microsoft.Compute/Images/vhds/{existing-generalized-os-image-blob-name}.vhd"
        },
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "osType": "Windows",
        "vhd": {
          "uri": "http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk.vhd"
        }
      },
      "dataDisks": []
    },
    "vmId": "926cd555-a07c-4ff5-b214-4aa4dd09d79b",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "osDisk": {
        "name": "myVMosdisk",
        "image": {
          "uri": "https://{existing-storage-account-name}.blob.core.windows.net/system/Microsoft.Compute/Images/vhds/{existing-generalized-os-image-blob-name}.vhd"
        },
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "osType": "Windows",
        "vhd": {
          "uri": "http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk.vhd"
        }
      },
      "dataDisks": []
    },
    "vmId": "926cd555-a07c-4ff5-b214-4aa4dd09d79b",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

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

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "16.04-LTS",
        "publisher": "Canonical",
        "version": "latest",
        "offer": "UbuntuServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}",
      "linuxConfiguration": {
        "provisionVMAgent": true,
        "patchSettings": {
          "assessmentMode": "ImageDefault"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "provisionVMAgent": true,
        "patchSettings": {
          "assessmentMode": "ImageDefault"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "16.04-LTS",
        "publisher": "Canonical",
        "version": "latest",
        "offer": "UbuntuServer"
      },
      "osDisk": {
        "osType": "Linux",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "provisionVMAgent": true,
        "patchSettings": {
          "assessmentMode": "ImageDefault"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "16.04-LTS",
        "publisher": "Canonical",
        "version": "latest",
        "offer": "UbuntuServer"
      },
      "osDisk": {
        "osType": "Linux",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

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

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "16.04-LTS",
        "publisher": "Canonical",
        "version": "latest",
        "offer": "UbuntuServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}",
      "linuxConfiguration": {
        "provisionVMAgent": true,
        "patchSettings": {
          "patchMode": "AutomaticByPlatform",
          "assessmentMode": "AutomaticByPlatform",
          "automaticByPlatformSettings": {
            "rebootSetting": "Never",
            "bypassPlatformSafetyChecksOnUserSchedule": true
          }
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "provisionVMAgent": true,
        "patchSettings": {
          "patchMode": "AutomaticByPlatform",
          "assessmentMode": "AutomaticByPlatform",
          "automaticByPlatformSettings": {
            "rebootSetting": "Never",
            "bypassPlatformSafetyChecksOnUserSchedule": true
          }
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "16.04-LTS",
        "publisher": "Canonical",
        "version": "latest",
        "offer": "UbuntuServer"
      },
      "osDisk": {
        "osType": "Linux",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "provisionVMAgent": true,
        "patchSettings": {
          "patchMode": "AutomaticByPlatform",
          "assessmentMode": "AutomaticByPlatform",
          "automaticByPlatformSettings": {
            "rebootSetting": "Never",
            "bypassPlatformSafetyChecksOnUserSchedule": true
          }
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "16.04-LTS",
        "publisher": "Canonical",
        "version": "latest",
        "offer": "UbuntuServer"
      },
      "osDisk": {
        "osType": "Linux",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

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

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "16.04-LTS",
        "publisher": "Canonical",
        "version": "latest",
        "offer": "UbuntuServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}",
      "linuxConfiguration": {
        "provisionVMAgent": true,
        "patchSettings": {
          "patchMode": "ImageDefault"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "provisionVMAgent": true,
        "patchSettings": {
          "patchMode": "ImageDefault"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "16.04-LTS",
        "publisher": "Canonical",
        "version": "latest",
        "offer": "UbuntuServer"
      },
      "osDisk": {
        "osType": "Linux",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "provisionVMAgent": true,
        "patchSettings": {
          "patchMode": "ImageDefault"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "16.04-LTS",
        "publisher": "Canonical",
        "version": "latest",
        "offer": "UbuntuServer"
      },
      "osDisk": {
        "osType": "Linux",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

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

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "16.04-LTS",
        "publisher": "Canonical",
        "version": "latest",
        "offer": "UbuntuServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}",
      "linuxConfiguration": {
        "provisionVMAgent": true,
        "patchSettings": {
          "patchMode": "AutomaticByPlatform",
          "assessmentMode": "AutomaticByPlatform"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "provisionVMAgent": true,
        "patchSettings": {
          "patchMode": "AutomaticByPlatform",
          "assessmentMode": "AutomaticByPlatform"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "16.04-LTS",
        "publisher": "Canonical",
        "version": "latest",
        "offer": "UbuntuServer"
      },
      "osDisk": {
        "osType": "Linux",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "provisionVMAgent": true,
        "patchSettings": {
          "patchMode": "AutomaticByPlatform",
          "assessmentMode": "AutomaticByPlatform"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "16.04-LTS",
        "publisher": "Canonical",
        "version": "latest",
        "offer": "UbuntuServer"
      },
      "osDisk": {
        "osType": "Linux",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a platform-image vm with unmanaged os and data disks.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/{vm-name}?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D2_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "vhd": {
          "uri": "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": [
        {
          "diskSizeGB": 1023,
          "createOption": "Empty",
          "lun": 0,
          "vhd": {
            "uri": "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk0.vhd"
          }
        },
        {
          "diskSizeGB": 1023,
          "createOption": "Empty",
          "lun": 1,
          "vhd": {
            "uri": "http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk1.vhd"
          }
        }
      ]
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "vhd": {
          "uri": "http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk.vhd"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "caching": "ReadWrite"
      },
      "dataDisks": [
        {
          "name": "dataDisk0",
          "diskSizeGB": 1023,
          "createOption": "Empty",
          "caching": "None",
          "vhd": {
            "uri": "http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk0.vhd"
          },
          "lun": 0
        },
        {
          "name": "dataDisk1",
          "diskSizeGB": 1023,
          "createOption": "Empty",
          "caching": "None",
          "vhd": {
            "uri": "http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk1.vhd"
          },
          "lun": 1
        }
      ]
    },
    "vmId": "5230a749-2f68-4830-900b-702182d32e63",
    "hardwareProfile": {
      "vmSize": "Standard_D2_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "vhd": {
          "uri": "http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk.vhd"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "caching": "ReadWrite"
      },
      "dataDisks": [
        {
          "name": "dataDisk0",
          "diskSizeGB": 1023,
          "createOption": "Empty",
          "caching": "None",
          "vhd": {
            "uri": "http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk0.vhd"
          },
          "lun": 0
        },
        {
          "name": "dataDisk1",
          "diskSizeGB": 1023,
          "createOption": "Empty",
          "caching": "None",
          "vhd": {
            "uri": "http://{existing-storage-account-name}.blob.core.windows.net/vhds/myDisk1.vhd"
          },
          "lun": 1
        }
      ]
    },
    "vmId": "5230a749-2f68-4830-900b-702182d32e63",
    "hardwareProfile": {
      "vmSize": "Standard_D2_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "communityGalleryImageId": "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "disablePasswordAuthentication": false
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "communityGalleryImageId": "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName"
      },
      "osDisk": {
        "name": "myVMosdisk",
        "diskSizeGB": 30,
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "osType": "Linux"
      },
      "dataDisks": []
    },
    "vmId": "71aa3d5a-d73d-4970-9182-8580433b2865",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "disablePasswordAuthentication": false
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "communityGalleryImageId": "/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName"
      },
      "osDisk": {
        "name": "myVMosdisk",
        "diskSizeGB": 30,
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "osType": "Linux"
      },
      "dataDisks": []
    },
    "vmId": "71aa3d5a-d73d-4970-9182-8580433b2865",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a vm from a custom image.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "disablePasswordAuthentication": false
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"
      },
      "osDisk": {
        "name": "myVMosdisk",
        "diskSizeGB": 30,
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "osType": "Linux"
      },
      "dataDisks": []
    },
    "vmId": "71aa3d5a-d73d-4970-9182-8580433b2865",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "disablePasswordAuthentication": false
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"
      },
      "osDisk": {
        "name": "myVMosdisk",
        "diskSizeGB": 30,
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "osType": "Linux"
      },
      "dataDisks": []
    },
    "vmId": "71aa3d5a-d73d-4970-9182-8580433b2865",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a vm from a generalized shared image.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "disablePasswordAuthentication": false
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"
      },
      "osDisk": {
        "name": "myVMosdisk",
        "diskSizeGB": 30,
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "osType": "Linux"
      },
      "dataDisks": []
    },
    "vmId": "71aa3d5a-d73d-4970-9182-8580433b2865",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "disablePasswordAuthentication": false
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"
      },
      "osDisk": {
        "name": "myVMosdisk",
        "diskSizeGB": 30,
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "osType": "Linux"
      },
      "dataDisks": []
    },
    "vmId": "71aa3d5a-d73d-4970-9182-8580433b2865",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sharedGalleryImageId": "/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "disablePasswordAuthentication": false
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sharedGalleryImageId": "/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName"
      },
      "osDisk": {
        "name": "myVMosdisk",
        "diskSizeGB": 30,
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "osType": "Linux"
      },
      "dataDisks": []
    },
    "vmId": "71aa3d5a-d73d-4970-9182-8580433b2865",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "disablePasswordAuthentication": false
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sharedGalleryImageId": "/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName"
      },
      "osDisk": {
        "name": "myVMosdisk",
        "diskSizeGB": 30,
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "osType": "Linux"
      },
      "dataDisks": []
    },
    "vmId": "71aa3d5a-d73d-4970-9182-8580433b2865",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a vm from a specialized shared image.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"
      },
      "osDisk": {
        "name": "myVMosdisk",
        "diskSizeGB": 30,
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "osType": "Linux"
      },
      "dataDisks": []
    },
    "vmId": "71aa3d5a-d73d-4970-9182-8580433b2865",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage"
      },
      "osDisk": {
        "name": "myVMosdisk",
        "diskSizeGB": 30,
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "osType": "Linux"
      },
      "dataDisks": []
    },
    "vmId": "71aa3d5a-d73d-4970-9182-8580433b2865",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a vm in a Virtual Machine Scale Set with customer assigned platformFaultDomain.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "virtualMachineScaleSet": {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{existing-flex-vmss-name-with-platformFaultDomainCount-greater-than-1}"
    },
    "platformFaultDomain": 1
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "7cce54f2-ecd3-4ddd-a8d9-50984faa3918",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "virtualMachineScaleSet": {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myExistingFlexVmss"
    },
    "platformFaultDomain": 1,
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "7cce54f2-ecd3-4ddd-a8d9-50984faa3918",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "virtualMachineScaleSet": {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/myExistingFlexVmss"
    },
    "platformFaultDomain": 1,
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a vm in an availability set.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "availabilitySet": {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/{existing-availability-set-name}"
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "b7a098cc-b0b8-46e8-a205-62f301a62a8f",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "availabilitySet": {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/NSGEXISTINGAS"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "b7a098cc-b0b8-46e8-a205-62f301a62a8f",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "availabilitySet": {
      "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/NSGEXISTINGAS"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a vm with a marketplace image plan.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "plan": {
    "publisher": "microsoft-ads",
    "product": "windows-data-science-vm",
    "name": "windows2016"
  },
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "windows2016",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "windows-data-science-vm"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "standard-data-science-vm",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "standard-data-science-vm"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}
{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "standard-data-science-vm",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "standard-data-science-vm"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}

Create a vm with an extensions time budget.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://{existing-storage-account-name}.blob.core.windows.net",
        "enabled": true
      }
    },
    "extensionsTimeBudget": "PT30M"
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
        "enabled": true
      }
    },
    "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "extensionsTimeBudget": "PT30M",
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
        "enabled": true
      }
    },
    "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "extensionsTimeBudget": "PT30M",
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a vm with Application Profile.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "{image_sku}",
        "publisher": "{image_publisher}",
        "version": "latest",
        "offer": "{image_offer}"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "applicationProfile": {
      "galleryApplications": [
        {
          "tags": "myTag1",
          "order": 1,
          "packageReferenceId": "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0",
          "configurationReference": "https://mystorageaccount.blob.core.windows.net/configurations/settings.config",
          "treatFailureAsDeploymentFailure": false,
          "enableAutomaticUpgrade": false
        },
        {
          "packageReferenceId": "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"
        }
      ]
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "ssh": {
          "publicKeys": [
            {
              "path": "/home/{your-username}/.ssh/authorized_keys",
              "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"
            }
          ]
        },
        "disablePasswordAuthentication": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "16.04-LTS",
        "publisher": "Canonical",
        "version": "latest",
        "offer": "UbuntuServer"
      },
      "osDisk": {
        "osType": "Linux",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "applicationProfile": {
      "galleryApplications": [
        {
          "tags": "myTag1",
          "order": 1,
          "packageReferenceId": "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0",
          "configurationReference": "https://mystorageaccount.blob.core.windows.net/configurations/settings.config"
        },
        {
          "packageReferenceId": "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"
        }
      ]
    },
    "vmId": "e0de9b84-a506-4b95-9623-00a425d05c90",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "ssh": {
          "publicKeys": [
            {
              "path": "/home/{your-username}/.ssh/authorized_keys",
              "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"
            }
          ]
        },
        "disablePasswordAuthentication": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "16.04-LTS",
        "publisher": "Canonical",
        "version": "latest",
        "offer": "UbuntuServer"
      },
      "osDisk": {
        "osType": "Linux",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "applicationProfile": {
      "galleryApplications": [
        {
          "tags": "myTag1",
          "order": 1,
          "packageReferenceId": "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0",
          "configurationReference": "https://mystorageaccount.blob.core.windows.net/configurations/settings.config"
        },
        {
          "packageReferenceId": "/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1"
        }
      ]
    },
    "vmId": "e0de9b84-a506-4b95-9623-00a425d05c90",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a vm with boot diagnostics.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://{existing-storage-account-name}.blob.core.windows.net",
        "enabled": true
      }
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
        "enabled": true
      }
    },
    "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
        "enabled": true
      }
    },
    "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a vm with data disks using 'Copy' and 'Restore' options.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D2_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      },
      "dataDisks": [
        {
          "diskSizeGB": 1023,
          "createOption": "Copy",
          "sourceResource": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/{existing-snapshot-name}"
          },
          "lun": 0
        },
        {
          "diskSizeGB": 1023,
          "createOption": "Copy",
          "sourceResource": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-disk-name}"
          },
          "lun": 1
        },
        {
          "diskSizeGB": 1023,
          "createOption": "Restore",
          "sourceResource": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/{existing-rpc-name}/restorePoints/{existing-rp-name}/diskRestorePoints/{existing-disk-restore-point-name}"
          },
          "lun": 2
        }
      ]
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": [
        {
          "caching": "None",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "Copy",
          "sourceResource": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/{existing-snapshot-name}"
          },
          "lun": 0,
          "diskSizeGB": 1023
        },
        {
          "caching": "None",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "Copy",
          "sourceResource": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-disk-name}"
          },
          "lun": 1,
          "diskSizeGB": 1023
        },
        {
          "caching": "None",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "Restore",
          "sourceResource": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/{existing-rpc-name}/restorePoints/{existing-rp-name}/diskRestorePoints/{existing-disk-restore-point-name}"
          },
          "lun": 2,
          "diskSizeGB": 1023
        }
      ]
    },
    "vmId": "3906fef9-a1e5-4b83-a8a8-540858b41df0",
    "hardwareProfile": {
      "vmSize": "Standard_D2_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": [
        {
          "caching": "None",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "Copy",
          "sourceResource": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/snapshots/{existing-snapshot-name}"
          },
          "lun": 0,
          "diskSizeGB": 1023,
          "toBeDetached": false
        },
        {
          "caching": "None",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "Copy",
          "sourceResource": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-disk-name}"
          },
          "lun": 1,
          "diskSizeGB": 1023,
          "toBeDetached": false
        },
        {
          "caching": "None",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "Restore",
          "sourceResource": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/restorePointCollections/{existing-rpc-name}/restorePoints/{existing-rp-name}/diskRestorePoints/{existing-disk-restore-point-name}"
          },
          "lun": 2,
          "diskSizeGB": 1023,
          "toBeDetached": false
        }
      ]
    },
    "vmId": "3906fef9-a1e5-4b83-a8a8-540858b41df0",
    "hardwareProfile": {
      "vmSize": "Standard_D2_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a VM with Disk Controller Type

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D4_v3"
    },
    "scheduledEventsPolicy": {
      "scheduledEventsAdditionalPublishingTargets": {
        "eventGridAndResourceGraph": {
          "enable": true
        }
      },
      "userInitiatedRedeploy": {
        "automaticallyApprove": true
      },
      "userInitiatedReboot": {
        "automaticallyApprove": true
      }
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      },
      "diskControllerType": "NVMe"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://{existing-storage-account-name}.blob.core.windows.net",
        "enabled": true
      }
    },
    "userData": "U29tZSBDdXN0b20gRGF0YQ=="
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": [],
      "diskControllerType": "NVMe"
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
        "enabled": true
      }
    },
    "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
    "hardwareProfile": {
      "vmSize": "Standard_D4_v3"
    },
    "scheduledEventsPolicy": {
      "scheduledEventsAdditionalPublishingTargets": {
        "eventGridAndResourceGraph": {
          "enable": true
        }
      },
      "userInitiatedRedeploy": {
        "automaticallyApprove": true
      },
      "userInitiatedReboot": {
        "automaticallyApprove": true
      }
    },
    "provisioningState": "Updating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": [],
      "diskControllerType": "NVMe"
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
        "enabled": true
      }
    },
    "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
    "hardwareProfile": {
      "vmSize": "Standard_D4_v3"
    },
    "scheduledEventsPolicy": {
      "scheduledEventsAdditionalPublishingTargets": {
        "eventGridAndResourceGraph": {
          "enable": true
        }
      },
      "userInitiatedRedeploy": {
        "automaticallyApprove": true
      },
      "userInitiatedReboot": {
        "automaticallyApprove": true
      }
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a vm with DiskEncryptionSet resource id in the os disk and data disk.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS",
          "diskEncryptionSet": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
          }
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      },
      "dataDisks": [
        {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS",
            "diskEncryptionSet": {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
            }
          },
          "diskSizeGB": 1023,
          "createOption": "Empty",
          "lun": 0
        },
        {
          "caching": "ReadWrite",
          "managedDisk": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}",
            "storageAccountType": "Standard_LRS",
            "diskEncryptionSet": {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
            }
          },
          "diskSizeGB": 1023,
          "createOption": "Attach",
          "lun": 1
        }
      ]
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "disablePasswordAuthentication": false
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"
      },
      "osDisk": {
        "name": "myVMosdisk",
        "diskSizeGB": 30,
        "managedDisk": {
          "storageAccountType": "Standard_LRS",
          "diskEncryptionSet": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskencryptionset-name}"
          }
        },
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "osType": "Linux"
      },
      "dataDisks": [
        {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS",
            "diskEncryptionSet": {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
            }
          },
          "diskSizeGB": 1023,
          "createOption": "Empty",
          "lun": 0
        },
        {
          "caching": "ReadWrite",
          "managedDisk": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}",
            "storageAccountType": "Standard_LRS",
            "diskEncryptionSet": {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
            }
          },
          "diskSizeGB": 1023,
          "createOption": "Attach",
          "lun": 1
        }
      ]
    },
    "vmId": "71aa3d5a-d73d-4970-9182-8580433b2865",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "disablePasswordAuthentication": false
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/nsgcustom"
      },
      "osDisk": {
        "name": "myVMosdisk",
        "diskSizeGB": 30,
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "osType": "Linux"
      },
      "dataDisks": [
        {
          "caching": "ReadWrite",
          "managedDisk": {
            "storageAccountType": "Standard_LRS",
            "diskEncryptionSet": {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
            }
          },
          "diskSizeGB": 1023,
          "createOption": "Empty",
          "lun": 0
        },
        {
          "caching": "ReadWrite",
          "managedDisk": {
            "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}",
            "storageAccountType": "Standard_LRS",
            "diskEncryptionSet": {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
            }
          },
          "diskSizeGB": 1023,
          "createOption": "Attach",
          "lun": 1
        }
      ]
    },
    "vmId": "71aa3d5a-d73d-4970-9182-8580433b2865",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a vm with empty data disks.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D2_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      },
      "dataDisks": [
        {
          "diskSizeGB": 1023,
          "createOption": "Empty",
          "lun": 0
        },
        {
          "diskSizeGB": 1023,
          "createOption": "Empty",
          "lun": 1
        }
      ]
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": [
        {
          "caching": "None",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "Empty",
          "lun": 0,
          "diskSizeGB": 1023
        },
        {
          "caching": "None",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "Empty",
          "lun": 1,
          "diskSizeGB": 1023
        }
      ]
    },
    "vmId": "3906fef9-a1e5-4b83-a8a8-540858b41df0",
    "hardwareProfile": {
      "vmSize": "Standard_D2_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": [
        {
          "caching": "None",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "Empty",
          "lun": 0,
          "diskSizeGB": 1023,
          "toBeDetached": false
        },
        {
          "caching": "None",
          "managedDisk": {
            "storageAccountType": "Standard_LRS"
          },
          "createOption": "Empty",
          "lun": 1,
          "diskSizeGB": 1023,
          "toBeDetached": false
        }
      ]
    },
    "vmId": "3906fef9-a1e5-4b83-a8a8-540858b41df0",
    "hardwareProfile": {
      "vmSize": "Standard_D2_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a VM with encryption identity

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": {}
    }
  },
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "securityProfile": {
      "encryptionIdentity": {
        "userAssignedIdentityResourceId": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"
      }
    },
    "storageProfile": {
      "imageReference": {
        "publisher": "MicrosoftWindowsServer",
        "offer": "WindowsServer",
        "sku": "2019-Datacenter",
        "version": "latest"
      },
      "osDisk": {
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "StandardSSD_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "name": "myVM",
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": {}
    }
  },
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "publisher": "MicrosoftWindowsServer",
        "offer": "WindowsServer",
        "sku": "2019-Datacenter",
        "version": "latest"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "StandardSSD_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "securityProfile": {
      "encryptionIdentity": {
        "userAssignedIdentityResourceId": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"
      }
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}
{
  "name": "myVM",
  "identity": {
    "type": "UserAssigned",
    "userAssignedIdentities": {
      "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity": {}
    }
  },
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "publisher": "MicrosoftWindowsServer",
        "offer": "WindowsServer",
        "sku": "2019-Datacenter",
        "version": "latest"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "StandardSSD_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "securityProfile": {
      "encryptionIdentity": {
        "userAssignedIdentityResourceId": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"
      }
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}

Create a vm with ephemeral os disk provisioning in Cache disk using placement property.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "plan": {
    "publisher": "microsoft-ads",
    "product": "windows-data-science-vm",
    "name": "windows2016"
  },
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "windows2016",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "windows-data-science-vm"
      },
      "osDisk": {
        "caching": "ReadOnly",
        "diffDiskSettings": {
          "option": "Local",
          "placement": "CacheDisk"
        },
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "standard-data-science-vm",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "standard-data-science-vm"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadOnly",
        "diffDiskSettings": {
          "option": "Local",
          "placement": "CacheDisk"
        },
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}
{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "standard-data-science-vm",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "standard-data-science-vm"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadOnly",
        "diffDiskSettings": {
          "option": "Local",
          "placement": "CacheDisk"
        },
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}

Create a vm with ephemeral os disk provisioning in Nvme disk using placement property.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "plan": {
    "publisher": "microsoft-ads",
    "product": "windows-data-science-vm",
    "name": "windows2016"
  },
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "windows2016",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "windows-data-science-vm"
      },
      "osDisk": {
        "caching": "ReadOnly",
        "diffDiskSettings": {
          "option": "Local",
          "placement": "NvmeDisk"
        },
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "standard-data-science-vm",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "standard-data-science-vm"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadOnly",
        "diffDiskSettings": {
          "option": "Local",
          "placement": "NvmeDisk"
        },
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}
{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "standard-data-science-vm",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "standard-data-science-vm"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadOnly",
        "diffDiskSettings": {
          "option": "Local",
          "placement": "NvmeDisk"
        },
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}

Create a vm with ephemeral os disk provisioning in Resource disk using placement property.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "plan": {
    "publisher": "microsoft-ads",
    "product": "windows-data-science-vm",
    "name": "windows2016"
  },
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "windows2016",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "windows-data-science-vm"
      },
      "osDisk": {
        "caching": "ReadOnly",
        "diffDiskSettings": {
          "option": "Local",
          "placement": "ResourceDisk"
        },
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "standard-data-science-vm",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "standard-data-science-vm"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadOnly",
        "diffDiskSettings": {
          "option": "Local",
          "placement": "ResourceDisk"
        },
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}
{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "standard-data-science-vm",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "standard-data-science-vm"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadOnly",
        "diffDiskSettings": {
          "option": "Local",
          "placement": "ResourceDisk"
        },
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}

Create a vm with ephemeral os disk.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "plan": {
    "publisher": "microsoft-ads",
    "product": "windows-data-science-vm",
    "name": "windows2016"
  },
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "windows2016",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "windows-data-science-vm"
      },
      "osDisk": {
        "caching": "ReadOnly",
        "diffDiskSettings": {
          "option": "Local"
        },
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "standard-data-science-vm",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "standard-data-science-vm"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadOnly",
        "diffDiskSettings": {
          "option": "Local"
        },
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}
{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "standard-data-science-vm",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "standard-data-science-vm"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadOnly",
        "diffDiskSettings": {
          "option": "Local"
        },
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}

Create a VM with HibernationEnabled

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/{vm-name}?api-version=2024-03-01

{
  "location": "eastus2euap",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "additionalCapabilities": {
      "hibernationEnabled": true
    },
    "storageProfile": {
      "imageReference": {
        "publisher": "MicrosoftWindowsServer",
        "offer": "WindowsServer",
        "sku": "2019-Datacenter",
        "version": "latest"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "vmOSdisk",
        "createOption": "FromImage"
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "{vm-name}",
      "adminPassword": "{your-password}"
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://{existing-storage-account-name}.blob.core.windows.net",
        "enabled": true
      }
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/{vm-name}",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "{vm-name}",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "publisher": "MicrosoftWindowsServer",
        "offer": "WindowsServer",
        "sku": "2019-Datacenter",
        "version": "latest"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "vmOSdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
        "enabled": true
      }
    },
    "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "additionalCapabilities": {
      "hibernationEnabled": true
    },
    "provisioningState": "Updating"
  },
  "name": "{vm-name}",
  "location": "eastus2euap"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/{vm-name}",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "{vm-name}",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "publisher": "MicrosoftWindowsServer",
        "offer": "WindowsServer",
        "sku": "2019-Datacenter",
        "version": "latest"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "vmOSdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
        "enabled": true
      }
    },
    "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "additionalCapabilities": {
      "hibernationEnabled": true
    },
    "provisioningState": "Creating"
  },
  "name": "{vm-name}",
  "location": "eastus2euap"
}

Create a vm with Host Encryption using encryptionAtHost property.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "plan": {
    "publisher": "microsoft-ads",
    "product": "windows-data-science-vm",
    "name": "windows2016"
  },
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "securityProfile": {
      "encryptionAtHost": true
    },
    "storageProfile": {
      "imageReference": {
        "sku": "windows2016",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "windows-data-science-vm"
      },
      "osDisk": {
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "standard-data-science-vm",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "standard-data-science-vm"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "securityProfile": {
      "encryptionAtHost": true
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}
{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "standard-data-science-vm",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "standard-data-science-vm"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "securityProfile": {
      "encryptionAtHost": true
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}

Create a vm with managed boot diagnostics.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "enabled": true
      }
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "enabled": true
      }
    },
    "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "enabled": true
      }
    },
    "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a VM with network interface configuration

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "networkProfile": {
      "networkApiVersion": "2020-11-01",
      "networkInterfaceConfigurations": [
        {
          "name": "{nic-config-name}",
          "properties": {
            "primary": true,
            "deleteOption": "Delete",
            "ipConfigurations": [
              {
                "name": "{ip-config-name}",
                "properties": {
                  "primary": true,
                  "publicIPAddressConfiguration": {
                    "name": "{publicIP-config-name}",
                    "sku": {
                      "name": "Basic",
                      "tier": "Global"
                    },
                    "properties": {
                      "deleteOption": "Detach",
                      "publicIPAllocationMethod": "Static"
                    }
                  }
                }
              }
            ]
          }
        }
      ]
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/toBeCreatedNetworkInterface",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "b7a098cc-b0b8-46e8-a205-62f301a62a8f",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/toBeCreatedNetworkInterface",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "b7a098cc-b0b8-46e8-a205-62f301a62a8f",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a VM with network interface configuration with public ip address dns settings

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "networkProfile": {
      "networkApiVersion": "2020-11-01",
      "networkInterfaceConfigurations": [
        {
          "name": "{nic-config-name}",
          "properties": {
            "primary": true,
            "deleteOption": "Delete",
            "ipConfigurations": [
              {
                "name": "{ip-config-name}",
                "properties": {
                  "primary": true,
                  "publicIPAddressConfiguration": {
                    "name": "{publicIP-config-name}",
                    "sku": {
                      "name": "Basic",
                      "tier": "Global"
                    },
                    "properties": {
                      "deleteOption": "Detach",
                      "publicIPAllocationMethod": "Static",
                      "dnsSettings": {
                        "domainNameLabel": "aaaaa",
                        "domainNameLabelScope": "TenantReuse"
                      }
                    }
                  }
                }
              }
            ]
          }
        }
      ]
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/toBeCreatedNetworkInterface",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "b7a098cc-b0b8-46e8-a205-62f301a62a8f",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/toBeCreatedNetworkInterface",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "b7a098cc-b0b8-46e8-a205-62f301a62a8f",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a vm with password authentication.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "b248db33-62ba-4d2d-b791-811e075ee0f5",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "b248db33-62ba-4d2d-b791-811e075ee0f5",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a vm with premium storage.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a VM with ProxyAgent Settings of enabled and mode.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "securityProfile": {
      "proxyAgentSettings": {
        "enabled": true,
        "mode": "Enforce"
      }
    },
    "storageProfile": {
      "imageReference": {
        "publisher": "MicrosoftWindowsServer",
        "offer": "WindowsServer",
        "sku": "2019-Datacenter",
        "version": "latest"
      },
      "osDisk": {
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "StandardSSD_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "publisher": "MicrosoftWindowsServer",
        "offer": "WindowsServer",
        "sku": "2019-Datacenter",
        "version": "latest"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "StandardSSD_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "securityProfile": {
      "proxyAgentSettings": {
        "enabled": true,
        "mode": "Enforce"
      }
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}
{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "publisher": "MicrosoftWindowsServer",
        "offer": "WindowsServer",
        "sku": "2019-Datacenter",
        "version": "latest"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "StandardSSD_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "securityProfile": {
      "proxyAgentSettings": {
        "enabled": true,
        "mode": "Enforce"
      }
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}

Create a vm with Scheduled Events Profile

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "scheduledEventsPolicy": {
      "scheduledEventsAdditionalPublishingTargets": {
        "eventGridAndResourceGraph": {
          "enable": true
        }
      },
      "userInitiatedRedeploy": {
        "automaticallyApprove": true
      },
      "userInitiatedReboot": {
        "automaticallyApprove": true
      }
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://{existing-storage-account-name}.blob.core.windows.net",
        "enabled": true
      }
    },
    "scheduledEventsProfile": {
      "terminateNotificationProfile": {
        "notBeforeTimeout": "PT10M",
        "enable": true
      },
      "osImageNotificationProfile": {
        "notBeforeTimeout": "PT15M",
        "enable": true
      }
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
        "enabled": true
      }
    },
    "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "scheduledEventsPolicy": {
      "scheduledEventsAdditionalPublishingTargets": {
        "eventGridAndResourceGraph": {
          "enable": true
        }
      },
      "userInitiatedRedeploy": {
        "automaticallyApprove": true
      },
      "userInitiatedReboot": {
        "automaticallyApprove": true
      }
    },
    "scheduledEventsProfile": {
      "terminateNotificationProfile": {
        "notBeforeTimeout": "PT10M",
        "enable": true
      },
      "osImageNotificationProfile": {
        "notBeforeTimeout": "PT15M",
        "enable": true
      }
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
        "enabled": true
      }
    },
    "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "scheduledEventsPolicy": {
      "scheduledEventsAdditionalPublishingTargets": {
        "eventGridAndResourceGraph": {
          "enable": true
        }
      },
      "userInitiatedRedeploy": {
        "automaticallyApprove": true
      },
      "userInitiatedReboot": {
        "automaticallyApprove": true
      }
    },
    "scheduledEventsProfile": {
      "terminateNotificationProfile": {
        "notBeforeTimeout": "PT10M",
        "enable": true
      },
      "osImageNotificationProfile": {
        "notBeforeTimeout": "PT15M",
        "enable": true
      }
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a VM with securityType ConfidentialVM with Customer Managed Keys

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_DC2as_v5"
    },
    "securityProfile": {
      "uefiSettings": {
        "secureBootEnabled": true,
        "vTpmEnabled": true
      },
      "securityType": "ConfidentialVM"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "windows-cvm",
        "publisher": "MicrosoftWindowsServer",
        "version": "17763.2183.2109130127",
        "offer": "2019-datacenter-cvm"
      },
      "osDisk": {
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "StandardSSD_LRS",
          "securityProfile": {
            "securityEncryptionType": "DiskWithVMGuestState",
            "diskEncryptionSet": {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
            }
          }
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "windows-cvm",
        "publisher": "MicrosoftWindowsServer",
        "version": "17763.2183.2109130127",
        "offer": "2019-datacenter-cvm"
      },
      "osDisk": {
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "StandardSSD_LRS",
          "securityProfile": {
            "securityEncryptionType": "DiskWithVMGuestState",
            "diskEncryptionSet": {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
            }
          }
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "securityProfile": {
      "uefiSettings": {
        "secureBootEnabled": true,
        "vTpmEnabled": true
      },
      "securityType": "ConfidentialVM"
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_DC2as_v5"
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}
{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "windows-cvm",
        "publisher": "MicrosoftWindowsServer",
        "version": "17763.2183.2109130127",
        "offer": "2019-datacenter-cvm"
      },
      "osDisk": {
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "StandardSSD_LRS",
          "securityProfile": {
            "securityEncryptionType": "DiskWithVMGuestState",
            "diskEncryptionSet": {
              "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}"
            }
          }
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "securityProfile": {
      "uefiSettings": {
        "secureBootEnabled": true,
        "vTpmEnabled": true
      },
      "securityType": "ConfidentialVM"
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_DC2as_v5"
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}

Create a VM with securityType ConfidentialVM with NonPersistedTPM securityEncryptionType

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_DC2es_v5"
    },
    "securityProfile": {
      "uefiSettings": {
        "secureBootEnabled": false,
        "vTpmEnabled": true
      },
      "securityType": "ConfidentialVM"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "linux-cvm",
        "publisher": "UbuntuServer",
        "version": "17763.2183.2109130127",
        "offer": "2022-datacenter-cvm"
      },
      "osDisk": {
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "StandardSSD_LRS",
          "securityProfile": {
            "securityEncryptionType": "NonPersistedTPM"
          }
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "linux-cvm",
        "publisher": "UbuntuServer",
        "version": "17763.2183.2109130127",
        "offer": "2022-datacenter-cvm"
      },
      "osDisk": {
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "StandardSSD_LRS",
          "securityProfile": {
            "securityEncryptionType": "NonPersistedTPM"
          }
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "securityProfile": {
      "uefiSettings": {
        "secureBootEnabled": false,
        "vTpmEnabled": true
      },
      "securityType": "ConfidentialVM"
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_DC2es_v5"
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}
{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "linux-cvm",
        "publisher": "UbuntuServer",
        "version": "17763.2183.2109130127",
        "offer": "2022-datacenter-cvm"
      },
      "osDisk": {
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "StandardSSD_LRS",
          "securityProfile": {
            "securityEncryptionType": "NonPersistedTPM"
          }
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "securityProfile": {
      "uefiSettings": {
        "secureBootEnabled": false,
        "vTpmEnabled": true
      },
      "securityType": "ConfidentialVM"
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_DC2es_v5"
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}

Create a VM with securityType ConfidentialVM with Platform Managed Keys

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_DC2as_v5"
    },
    "securityProfile": {
      "uefiSettings": {
        "secureBootEnabled": true,
        "vTpmEnabled": true
      },
      "securityType": "ConfidentialVM"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "windows-cvm",
        "publisher": "MicrosoftWindowsServer",
        "version": "17763.2183.2109130127",
        "offer": "2019-datacenter-cvm"
      },
      "osDisk": {
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "StandardSSD_LRS",
          "securityProfile": {
            "securityEncryptionType": "DiskWithVMGuestState"
          }
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "windows-cvm",
        "publisher": "MicrosoftWindowsServer",
        "version": "17763.2183.2109130127",
        "offer": "2019-datacenter-cvm"
      },
      "osDisk": {
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "StandardSSD_LRS",
          "securityProfile": {
            "securityEncryptionType": "DiskWithVMGuestState"
          }
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "securityProfile": {
      "uefiSettings": {
        "secureBootEnabled": true,
        "vTpmEnabled": true
      },
      "securityType": "ConfidentialVM"
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_DC2as_v5"
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}
{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "windows-cvm",
        "publisher": "MicrosoftWindowsServer",
        "version": "17763.2183.2109130127",
        "offer": "2019-datacenter-cvm"
      },
      "osDisk": {
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "StandardSSD_LRS",
          "securityProfile": {
            "securityEncryptionType": "DiskWithVMGuestState"
          }
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "securityProfile": {
      "uefiSettings": {
        "secureBootEnabled": true,
        "vTpmEnabled": true
      },
      "securityType": "ConfidentialVM"
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_DC2as_v5"
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}

Create a vm with ssh authentication.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "{image_sku}",
        "publisher": "{image_publisher}",
        "version": "latest",
        "offer": "{image_offer}"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "linuxConfiguration": {
        "ssh": {
          "publicKeys": [
            {
              "path": "/home/{your-username}/.ssh/authorized_keys",
              "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"
            }
          ]
        },
        "disablePasswordAuthentication": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "ssh": {
          "publicKeys": [
            {
              "path": "/home/{your-username}/.ssh/authorized_keys",
              "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"
            }
          ]
        },
        "disablePasswordAuthentication": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "16.04-LTS",
        "publisher": "Canonical",
        "version": "latest",
        "offer": "UbuntuServer"
      },
      "osDisk": {
        "osType": "Linux",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "e0de9b84-a506-4b95-9623-00a425d05c90",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "linuxConfiguration": {
        "ssh": {
          "publicKeys": [
            {
              "path": "/home/{your-username}/.ssh/authorized_keys",
              "keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1"
            }
          ]
        },
        "disablePasswordAuthentication": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "16.04-LTS",
        "publisher": "Canonical",
        "version": "latest",
        "offer": "UbuntuServer"
      },
      "osDisk": {
        "osType": "Linux",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "e0de9b84-a506-4b95-9623-00a425d05c90",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create a VM with Uefi Settings of secureBoot and vTPM.

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "securityProfile": {
      "uefiSettings": {
        "secureBootEnabled": true,
        "vTpmEnabled": true
      },
      "securityType": "TrustedLaunch"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "windows10-tvm",
        "publisher": "MicrosoftWindowsServer",
        "version": "18363.592.2001092016",
        "offer": "windowsserver-gen2preview-preview"
      },
      "osDisk": {
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "StandardSSD_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "windows10-tvm",
        "publisher": "MicrosoftWindowsServer",
        "version": "18363.592.2001092016",
        "offer": "windowsserver-gen2preview-preview"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "StandardSSD_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "securityProfile": {
      "uefiSettings": {
        "secureBootEnabled": true,
        "vTpmEnabled": true
      },
      "securityType": "TrustedLaunch"
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}
{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "windows10-tvm",
        "publisher": "MicrosoftWindowsServer",
        "version": "18363.592.2001092016",
        "offer": "windowsserver-gen2preview-preview"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "StandardSSD_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "securityProfile": {
      "uefiSettings": {
        "secureBootEnabled": true,
        "vTpmEnabled": true
      },
      "securityType": "TrustedLaunch"
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_D2s_v3"
    },
    "provisioningState": "Creating"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}

Create a VM with UserData

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/{vm-name}?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "vmOSdisk",
        "createOption": "FromImage"
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "{vm-name}",
      "adminPassword": "{your-password}"
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://{existing-storage-account-name}.blob.core.windows.net",
        "enabled": true
      }
    },
    "userData": "RXhhbXBsZSBVc2VyRGF0YQ=="
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/{vm-name}",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "{vm-name}",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "vmOSdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
        "enabled": true
      }
    },
    "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "{vm-name}",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/{vm-name}",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "{vm-name}",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "vmOSdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
        "enabled": true
      }
    },
    "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "{vm-name}",
  "location": "westus"
}

Create a VM with VM Size Properties

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D4_v3",
      "vmSizeProperties": {
        "vCPUsAvailable": 1,
        "vCPUsPerCore": 1
      }
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://{existing-storage-account-name}.blob.core.windows.net",
        "enabled": true
      }
    },
    "userData": "U29tZSBDdXN0b20gRGF0YQ=="
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
        "enabled": true
      }
    },
    "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
    "hardwareProfile": {
      "vmSize": "Standard_D4_v3",
      "vmSizeProperties": {
        "vCPUsAvailable": 1,
        "vCPUsPerCore": 1
      }
    },
    "provisioningState": "Updating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      },
      "dataDisks": []
    },
    "diagnosticsProfile": {
      "bootDiagnostics": {
        "storageUri": "http://nsgdiagnostic.blob.core.windows.net",
        "enabled": true
      }
    },
    "vmId": "676420ba-7a24-4bfe-80bd-9c841ee184fa",
    "hardwareProfile": {
      "vmSize": "Standard_D4_v3",
      "vmSizeProperties": {
        "vCPUsAvailable": 1,
        "vCPUsPerCore": 1
      }
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

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

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true,
        "patchSettings": {
          "assessmentMode": "ImageDefault"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true,
        "patchSettings": {
          "assessmentMode": "ImageDefault"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": false,
        "patchSettings": {
          "assessmentMode": "ImageDefault"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

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

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true,
        "patchSettings": {
          "patchMode": "AutomaticByOS"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true,
        "patchSettings": {
          "patchMode": "AutomaticByOS"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true,
        "patchSettings": {
          "patchMode": "AutomaticByOS"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

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

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true,
        "patchSettings": {
          "patchMode": "AutomaticByPlatform",
          "assessmentMode": "AutomaticByPlatform",
          "automaticByPlatformSettings": {
            "rebootSetting": "Never",
            "bypassPlatformSafetyChecksOnUserSchedule": false
          }
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true,
        "patchSettings": {
          "patchMode": "AutomaticByPlatform",
          "assessmentMode": "AutomaticByPlatform",
          "automaticByPlatformSettings": {
            "rebootSetting": "Never",
            "bypassPlatformSafetyChecksOnUserSchedule": false
          }
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true,
        "patchSettings": {
          "patchMode": "AutomaticByPlatform",
          "assessmentMode": "AutomaticByPlatform",
          "automaticByPlatformSettings": {
            "rebootSetting": "Never",
            "bypassPlatformSafetyChecksOnUserSchedule": false
          }
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

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

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true,
        "patchSettings": {
          "patchMode": "AutomaticByPlatform",
          "enableHotpatching": true
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true,
        "patchSettings": {
          "patchMode": "AutomaticByPlatform",
          "enableHotpatching": true
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true,
        "patchSettings": {
          "patchMode": "AutomaticByPlatform",
          "enableHotpatching": true
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

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

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true,
        "patchSettings": {
          "patchMode": "Manual"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true,
        "patchSettings": {
          "patchMode": "Manual"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": false,
        "patchSettings": {
          "patchMode": "Manual"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

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

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_D1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        },
        "name": "myVMosdisk",
        "createOption": "FromImage"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true,
        "patchSettings": {
          "patchMode": "AutomaticByPlatform",
          "assessmentMode": "AutomaticByPlatform"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true,
        "patchSettings": {
          "patchMode": "AutomaticByPlatform",
          "assessmentMode": "AutomaticByPlatform"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}
{
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "type": "Microsoft.Compute/virtualMachines",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true,
        "patchSettings": {
          "patchMode": "AutomaticByPlatform",
          "assessmentMode": "AutomaticByPlatform"
        }
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "2016-Datacenter",
        "publisher": "MicrosoftWindowsServer",
        "version": "latest",
        "offer": "WindowsServer"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadWrite",
        "createOption": "FromImage",
        "name": "myVMosdisk",
        "managedDisk": {
          "storageAccountType": "Premium_LRS"
        }
      },
      "dataDisks": []
    },
    "vmId": "a149cd25-409f-41af-8088-275f5486bc93",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "name": "myVM",
  "location": "westus"
}

Create or update a VM with capacity reservation

範例要求

PUT https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM?api-version=2024-03-01

{
  "location": "westus",
  "plan": {
    "publisher": "microsoft-ads",
    "product": "windows-data-science-vm",
    "name": "windows2016"
  },
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "storageProfile": {
      "imageReference": {
        "sku": "windows2016",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "windows-data-science-vm"
      },
      "osDisk": {
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      }
    },
    "capacityReservation": {
      "capacityReservationGroup": {
        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"
      }
    },
    "osProfile": {
      "adminUsername": "{your-username}",
      "computerName": "myVM",
      "adminPassword": "{your-password}"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}",
          "properties": {
            "primary": true
          }
        }
      ]
    }
  }
}

範例回覆

{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "capacityReservation": {
      "capacityReservationGroup": {
        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "standard-data-science-vm",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "standard-data-science-vm"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}
{
  "name": "myVM",
  "properties": {
    "osProfile": {
      "adminUsername": "{your-username}",
      "secrets": [],
      "computerName": "myVM",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "capacityReservation": {
      "capacityReservationGroup": {
        "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}"
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic",
          "properties": {
            "primary": true
          }
        }
      ]
    },
    "storageProfile": {
      "imageReference": {
        "sku": "standard-data-science-vm",
        "publisher": "microsoft-ads",
        "version": "latest",
        "offer": "standard-data-science-vm"
      },
      "osDisk": {
        "osType": "Windows",
        "caching": "ReadOnly",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        },
        "createOption": "FromImage",
        "name": "myVMosdisk"
      },
      "dataDisks": []
    },
    "vmId": "5c0d55a7-c407-4ed6-bf7d-ddb810267c85",
    "hardwareProfile": {
      "vmSize": "Standard_DS1_v2"
    },
    "provisioningState": "Creating"
  },
  "plan": {
    "publisher": "microsoft-ads",
    "product": "standard-data-science-vm",
    "name": "standard-data-science-vm"
  },
  "type": "Microsoft.Compute/virtualMachines",
  "id": "/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/myVM",
  "location": "westus"
}

定義

名稱 Description
AdditionalCapabilities

指定虛擬機上啟用或停用的其他功能。

AdditionalUnattendContent

指定可併入 Unattend.xml 檔案 (由 Windows 安裝程式使用) 的額外 Base-64 編碼 XML 格式資訊。

ApiEntityReference

來源資源標識碼。 它可以是建立磁碟的快照集或磁碟還原點。

ApiError

API 錯誤。

ApiErrorBase

Api 錯誤基底。

ApplicationProfile

指定應該提供給 VM/VMSS 的資源庫應用程式。

AvailablePatchSummary

虛擬機最新評量作業的可用修補程式摘要。

BillingProfile

指定 Azure Spot 虛擬機的計費相關詳細數據。 API 版本下限:2019-03-01。

BootDiagnostics

開機診斷是一項偵錯功能,可讓您檢視控制台輸出和螢幕快照以診斷 VM 狀態。 注意:如果要指定 storageUri,請確定記憶體帳戶位於與 VM 相同的區域和訂用帳戶中。 您可以輕鬆地檢視主控台記錄檔的輸出。 Azure 也可讓您從 Hypervisor 查看 VM 的螢幕快照。

BootDiagnosticsInstanceView

開機診斷是一項偵錯功能,可讓您檢視控制台輸出和螢幕快照以診斷 VM 狀態。 您可以輕鬆地檢視主控台記錄檔的輸出。 Azure 也可讓您從 Hypervisor 查看 VM 的螢幕快照。

CachingTypes

指定快取需求。 可能的值為: None、ReadOnly、ReadWrite。 默認行為為: 標準記憶體的 None。進階記憶體的 ReadOnly。

CapacityReservationProfile

指定用來配置虛擬機之容量保留區的相關信息。 API 版本下限:2021-04-01。

CloudError

來自計算服務的錯誤回應。

ComponentNames

元件名稱。 目前唯一允許的值是 Microsoft-Windows-Shell-Setup。

DataDisk

指定用來將資料磁碟加入至虛擬機器的參數。 如需磁碟的詳細資訊,請參閱 關於 Azure 虛擬機的磁碟和 VHD

DeleteOptions

指定刪除 VM 時網路介面會發生什麼事

DiagnosticsProfile

指定開機診斷設定狀態。 API 版本下限:2015-06-15。

DiffDiskOptions

指定作業系統磁碟的暫時磁碟設定。

DiffDiskPlacement

指定作業系統磁碟的暫時磁碟位置。 可能的值為: CacheDisk、ResourceDisk、NvmeDisk。 默認行為為:如果已針對 VM 大小設定 快取Disk ,否則會使用 ResourceDiskNvmeDisk 。 請參閱 上的 https://docs.microsoft.com/azure/virtual-machines/windows/sizes Windows VM 和 Linux VM https://docs.microsoft.com/azure/virtual-machines/linux/sizes 的 VM 大小檔,以檢查哪些 VM 大小會公開快取磁碟。 NvmeDisk 的最低 API 版本:2024-03-01。

DiffDiskSettings

指定虛擬機所使用作業系統磁碟的暫時磁碟設定。

DiskControllerTypes

指定為 VM 設定的磁碟控制器類型。 注意: 如果未指定,則會使用 『hyperVGeneration』 設定為 V2,根據指定之最低 API 版本之作業系統磁碟和 VM 大小的功能,將此屬性設定為預設磁碟控制器類型。 除非您更新 VM 組態中的 VM 大小,以隱含地解除分配和重新配置 VM,否則您必須在更新其磁碟控制器類型之前解除分配 VM。 API 版本下限:2022-08-01。

DiskCreateOptionTypes

指定應如何建立虛擬機磁碟。 可能的值為 Attach: 當您使用特製化磁碟來建立虛擬機時,會使用此值。 FromImage: 當您使用映像來建立虛擬機時,會使用此值。 如果您使用平臺映像,則也應該使用上述的 imageReference 元素。 如果您使用 Marketplace 映射,則也應該使用先前所述的方案元素。

DiskDeleteOptionTypes

指定在 VM 刪除時應刪除或中斷連結 OS 磁碟。 可能的值為: Delete。 如果使用此值,則會在刪除 VM 時刪除 OS 磁碟。 分離。 如果使用此值,則會在刪除 VM 之後保留 os 磁碟。 默認值設定為 [卸離]。 若為暫時OS磁碟,預設值會設定為 Delete。 使用者無法變更暫時 OS 磁碟的刪除選項。

DiskDetachOptionTypes

指定卸離磁碟時所要使用的卸離行為,或已在從虛擬機中斷鏈接的過程中使用。 支援的值: ForceDetach。 detachOption: ForceDetach 僅適用於受控數據磁碟。 如果先前的數據磁碟斷連結嘗試因為虛擬機發生非預期的失敗而未完成,但磁碟仍然未釋放,請使用強制中斷連結作為最後一個從 VM 中斷連結磁碟的最後一個選項。 使用此卸離行為時,可能不會排清所有寫入。 此功能仍處於預覽 模式,且 VirtualMachineScaleSet 不支援此功能。 若要強制中斷數據磁碟更新至BeDetached 為 『true』,以及設定 detachOption: 'ForceDetach'。

DiskEncryptionSetParameters

指定受控磁碟的客戶受控磁碟加密集資源標識符。

DiskEncryptionSettings

指定 OS 磁碟的加密設定。 API 版本下限:2015-06-15。

DiskInstanceView

虛擬機磁碟資訊。

DomainNameLabelScopeTypes

即將建立之 PublicIPAddress 資源的功能變數名稱標籤範圍。 產生的名稱標籤是根據功能變數名稱標籤範圍和 vm 網路配置檔唯一識別碼,與原則串連哈希功能變數名稱標籤。

EncryptionIdentity

指定 ADE 用來取得金鑰保存庫作業存取令牌的受控識別。

EventGridAndResourceGraph

建立 eventGridAndResourceGraph 排程事件設定時所使用的組態參數。

ExtendedLocation

虛擬機的擴充位置。

ExtendedLocationTypes

擴充位置的類型。

HardwareProfile

指定虛擬機器的硬體設定。

HyperVGenerationType

指定與資源相關聯的 HyperVGeneration 類型

ImageReference

指定要使用之映像的相關信息。 您可以指定平臺映像、市集映像或虛擬機映像的相關信息。 當您想要使用平臺映像、市集映像或虛擬機映像,但不會用於其他建立作業時,需要此元素。

InnerError

內部錯誤詳細數據。

InstanceViewStatus

實例檢視狀態。

IPVersions

從 Api-Version 2019-07-01 起提供,它代表特定 ipconfiguration 是 IPv4 或 IPv6。 預設值會視為 IPv4。 可能的值為:'IPv4' 和 'IPv6'。

KeyVaultKeyReference

指定 金鑰保存庫 中金鑰加密金鑰的位置。

KeyVaultSecretReference

以傳址方式傳遞並從金鑰保存庫取用的延伸模組受保護設定

LastPatchInstallationSummary

虛擬機最新安裝作業的安裝摘要。

LinuxConfiguration

指定虛擬機上的Linux作業系統設定。 如需支援的Linux發行版清單,請參閱 Azure-Endorsed 發行版上的Linux

LinuxPatchAssessmentMode

指定 IaaS 虛擬機的 VM 客體修補評估模式。

可能的值包括:

ImageDefault - 您可以在虛擬機上控制修補程式評估的時間。

AutomaticByPlatform - 平臺會觸發定期修補評估。 屬性 provisionVMAgent 必須是 true。

LinuxPatchSettings

[預覽功能]指定與Linux上的VM客體修補相關的設定。

LinuxVMGuestPatchAutomaticByPlatformRebootSetting

指定所有 AutomaticByPlatform 修補程式安裝作業的重新啟動設定。

LinuxVMGuestPatchAutomaticByPlatformSettings

在 Linux 上的 VM 客體修補中指定 Patch 模式 AutomaticByPlatform 的其他設定。

LinuxVMGuestPatchMode

指定 VM 客體修補至 IaaS 虛擬機的模式,或與 OrchestraMode 為彈性的虛擬機擴展集相關聯的虛擬機。

可能的值包括:

ImageDefault - 會使用虛擬機的默認修補組態。

AutomaticByPlatform - 虛擬機將會由平台自動更新。 provisionVMAgent 屬性必須是 true

MaintenanceOperationResultCodeTypes

上次維護作業結果碼。

MaintenanceRedeployStatus

虛擬機上的維護作業狀態。

ManagedDiskParameters

受控磁碟參數。

Mode

指定如果啟用此功能,ProxyAgent 將會在 上執行的模式。 ProxyAgent 會開始稽核或監視,但不會對稽核模式中的主機端點要求強制執行訪問控制,而在 [強制執行] 模式中,則會強制執行訪問控制。 默認值為 [強制] 模式。

NetworkApiVersion

會指定在網路介面組態中建立網路資源時所使用的 Microsoft.Network API 版本

NetworkInterfaceAuxiliaryMode

指定是否為網路介面資源啟用輔助模式。

NetworkInterfaceAuxiliarySku

指定是否為網路介面資源啟用輔助 SKU。

NetworkInterfaceReference

指定與虛擬機相關聯之網路介面的資源標識符清單。

NetworkProfile

指定虛擬機器的網路介面。

OperatingSystemTypes

操作系統類型。

OSDisk

指定虛擬機所使用的作業系統磁碟相關信息。 如需磁碟的詳細資訊,請參閱 關於 Azure 虛擬機的磁碟和 VHD

OSImageNotificationProfile

指定OS映像排程事件相關組態。

OSProfile

指定建立虛擬機時所使用的作業系統設定。 一旦布建 VM 之後,就無法變更部分設定。

PassNames

傳遞名稱。 目前唯一允許的值是 OobeSystem。

PatchOperationStatus

作業的整體成功或失敗狀態。 它會維持 「InProgress」,直到作業完成為止。 此時,它會變成「未知」、「失敗」、「成功」或「CompletedWithWarnings」。

PatchSettings

[預覽功能]指定與 Windows 上的 VM 客體修補相關的設定。

Plan

指定用來建立虛擬機之 Marketplace 映像的相關信息。 此元素僅用於市集映像。 您必須先啟用映像以程序設計方式使用,才能從 API 使用市集映射。 在 Azure 入口網站 中,尋找您想要使用的市集映像,然後按兩下 [想要以程序設計方式部署][開始使用] ->。 輸入任何必要資訊,然後按兩下 [ 儲存]。

ProtocolTypes

指定 WinRM 接聽程式的通訊協定。 可能的值為: HTTP、https。

ProxyAgentSettings

指定建立虛擬機時的 ProxyAgent 設定。 API 版本下限:2024-03-01。

PublicIPAddressSku

描述公用IP Sku。 它只能以 OrchestrationMode 設定為彈性。

PublicIPAddressSkuName

指定公用IP SKU 名稱

PublicIPAddressSkuTier

指定公用IP SKU層

PublicIPAllocationMethod

指定公用IP配置類型

ResourceIdentityType

用於虛擬機的身分識別類型。 「SystemAssigned、UserAssigned」類型同時包含隱含建立的身分識別,和一組使用者指派的身分識別。 類型 『None』 將會從虛擬機中移除任何身分識別。

ScheduledEventsAdditionalPublishingTargets

發佈 scheduledEventsAdditionalPublishingTargets 時所使用的組態參數。

ScheduledEventsPolicy

指定虛擬機的重新部署、重新啟動和 ScheduledEventsAdditionalPublishingTargets Scheduled 事件相關設定。

ScheduledEventsProfile

指定排程的事件相關組態。

securityEncryptionTypes

指定受控磁碟的 EncryptionType。 它設定為 DiskWithVMGuestState 以加密受控磁碟以及 VMGuestState Blob、VMGuestStateOnly 只加密 VMGuestState Blob,以及 NonPersistedTPM 表示未在 VMGuestState Blob 中保存韌體狀態。 注意: 它只能設定為機密 VM。

SecurityProfile

指定虛擬機的安全性相關配置檔設定。

SecurityTypes

指定虛擬機的 SecurityType。 它必須設定為任何指定的值,才能啟用 UefiSettings。 默認行為為:除非設定此屬性,否則不會啟用 UefiSettings。

SettingNames

指定要套用內容之設定的名稱。 可能的值為:FirstLogonCommands 和 AutoLogon。

SshConfiguration

指定 Linux OS 的 SSH 金鑰組態。

SshPublicKey

用來向Linux型VM進行驗證的SSH公鑰清單。

StatusLevelTypes

層級程序代碼。

StorageAccountTypes

指定受控磁碟的記憶體帳戶類型。 注意:UltraSSD_LRS只能與數據磁碟搭配使用,它不能與OS磁碟搭配使用。

StorageProfile

指定虛擬機器磁碟的儲存體設定。

SubResource

包含秘密之 金鑰保存庫的相對 URL。

TerminateNotificationProfile

指定終止排程事件相關組態。

UefiSettings

指定安全性設定,例如建立虛擬機時所使用的安全開機和 vTPM。 API 版本下限:2020-12-01。

UserAssignedIdentities

與虛擬機相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。

UserInitiatedReboot

建立 userInitiatedReboot 排程事件設定時所使用的組態參數。

UserInitiatedRedeploy

建立 userInitiatedRedeploy 排程事件設定時所使用的組態參數。

VaultCertificate

SourceVault 中包含憑證的金鑰保存庫參考清單。

VaultSecretGroup

指定應該安裝到虛擬機器的憑證集。 若要在虛擬機上安裝憑證,建議使用適用於Linux的 Azure 金鑰保存庫 虛擬機擴充功能適用於Windows的 Azure 金鑰保存庫 虛擬機擴充功能

VirtualHardDisk

虛擬硬碟。

VirtualMachine

描述虛擬機。

VirtualMachineAgentInstanceView

在虛擬機上執行的 VM 代理程式。

VirtualMachineEvictionPolicyTypes

指定 Azure Spot 虛擬機和 Azure Spot 擴展集的收回原則。 針對 Azure Spot 虛擬機,支援「解除分配」和「刪除」,而最低 API 版本為 2019-03-01。 針對 Azure Spot 擴展集,同時支援 'Deallocate' 和 'Delete',而最低 API 版本為 2017-10-30-preview。

VirtualMachineExtension

虛擬機子擴充功能資源。

VirtualMachineExtensionHandlerInstanceView

虛擬機擴充功能處理程序實例檢視。

VirtualMachineExtensionInstanceView

虛擬機擴充實例檢視。

VirtualMachineHealthStatus

VM 的健康情況狀態。

VirtualMachineIdentity

如果已設定,則為虛擬機的身分識別。

VirtualMachineInstanceView

虛擬機實例檢視。

VirtualMachineIpTag

與公用IP位址相關聯的IP標籤清單。

VirtualMachineNetworkInterfaceConfiguration

指定將用來建立虛擬機網路資源的網路設定。

VirtualMachineNetworkInterfaceDnsSettingsConfiguration

要套用在網路介面上的 DNS 設定。

VirtualMachineNetworkInterfaceIPConfiguration

指定網路介面的IP組態。

VirtualMachinePatchStatus

[預覽功能]虛擬機修補作業的狀態。

VirtualMachinePriorityTypes

指定虛擬機的優先順序。 最低 api-version:2019-03-01

VirtualMachinePublicIPAddressConfiguration

publicIPAddressConfiguration。

VirtualMachinePublicIPAddressDnsSettingsConfiguration

要套用在 publicIP 位址 上的 DNS 設定。

VirtualMachineSizeTypes

指定虛擬機器的大小。 列舉數據類型目前已被取代,將於 2023 年 12 月 23 日移除。 取得可用大小清單的建議方式是使用這些 API: 列出可用性設定組中的所有可用虛擬機器大小列出區域中所有可用的虛擬機大小列出所有可用的虛擬機大小以重設大小。 如需虛擬機大小的詳細資訊,請參閱 虛擬機的大小。 可用的 VM 大小取決於區域和可用性設定組。

VMDiskSecurityProfile

指定受控磁碟的安全性配置檔。

VMGalleryApplication

指定應該提供給 VM/VMSS 使用的資源庫應用程式

VMSizeProperties

指定自定義虛擬機大小的屬性。 API 版本下限:2021-07-01。 此功能仍處於預覽模式,且 VirtualMachineScaleSet 不支援此功能。 如需詳細資訊,請遵循 VM 自定義 中的指示。

WindowsConfiguration

指定虛擬機器上的 Windows 作業系統設定。

WindowsPatchAssessmentMode

指定 IaaS 虛擬機的 VM 客體修補評估模式。

可能的值包括:

ImageDefault - 您可以在虛擬機上控制修補程式評估的時間。

AutomaticByPlatform - 平臺會觸發定期修補評估。 屬性 provisionVMAgent 必須是 true。

WindowsVMGuestPatchAutomaticByPlatformRebootSetting

指定所有 AutomaticByPlatform 修補程式安裝作業的重新啟動設定。

WindowsVMGuestPatchAutomaticByPlatformSettings

指定 Windows 上 VM 客體修補中的 Patch 模式 AutomaticByPlatform 的其他設定。

WindowsVMGuestPatchMode

指定 VM 客體修補至 IaaS 虛擬機的模式,或與 OrchestraMode 為彈性的虛擬機擴展集相關聯的虛擬機。

可能的值包括:

手動 - 您可以控制將修補程式應用程式套用至虛擬機。 您可以在 VM 內手動套用修補程式來執行此動作。 在此模式中,自動更新會停用;屬性 WindowsConfiguration.enableAutomaticUpdates 必須為 false

AutomaticByOS - 作業系統會自動更新虛擬機。 WindowsConfiguration.enableAutomaticUpdates 屬性必須是 true。

AutomaticByPlatform - 虛擬機將會由平台自動更新。 provisionVMAgent 和 WindowsConfiguration.enableAutomaticUpdates 屬性必須是 true

WinRMConfiguration

指定 Windows 遠端管理接聽程式。 藉此將啟用遠端 Windows PowerShell。

WinRMListener

Windows 遠端管理接聽程式清單

AdditionalCapabilities

指定虛擬機上啟用或停用的其他功能。

名稱 類型 Description
hibernationEnabled

boolean

啟用或停用 VM 上休眠功能的旗標。

ultraSSDEnabled

boolean

旗標,可啟用或停用在 VM 或 VMSS 上具有一或多個具有 UltraSSD_LRS記憶體帳戶類型的受控數據磁碟。 只有啟用此屬性時,才能將具有記憶體帳戶類型的受控磁碟UltraSSD_LRS新增至虛擬機或虛擬機擴展集。

AdditionalUnattendContent

指定可併入 Unattend.xml 檔案 (由 Windows 安裝程式使用) 的額外 Base-64 編碼 XML 格式資訊。

名稱 類型 Description
componentName

ComponentNames

元件名稱。 目前唯一允許的值是 Microsoft-Windows-Shell-Setup。

content

string

針對指定的路徑和元件,指定新增至 unattend.xml 檔案的 XML 格式內容。 XML 必須小於 4KB,而且必須包含要插入之設定或功能的根元素。

passName

PassNames

傳遞名稱。 目前唯一允許的值是 OobeSystem。

settingName

SettingNames

指定要套用內容之設定的名稱。 可能的值為:FirstLogonCommands 和 AutoLogon。

ApiEntityReference

來源資源標識碼。 它可以是建立磁碟的快照集或磁碟還原點。

名稱 類型 Description
id

string

/subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... 形式的 ARM 資源標識符

ApiError

API 錯誤。

名稱 類型 Description
code

string

錯誤碼。

details

ApiErrorBase[]

API 錯誤詳細數據

innererror

InnerError

Api 內部錯誤

message

string

錯誤訊息。

target

string

特定錯誤的目標。

ApiErrorBase

Api 錯誤基底。

名稱 類型 Description
code

string

錯誤碼。

message

string

錯誤訊息。

target

string

特定錯誤的目標。

ApplicationProfile

指定應該提供給 VM/VMSS 的資源庫應用程式。

名稱 類型 Description
galleryApplications

VMGalleryApplication[]

指定應該提供給 VM/VMSS 使用的資源庫應用程式

AvailablePatchSummary

虛擬機最新評量作業的可用修補程式摘要。

名稱 類型 Description
assessmentActivityId

string

產生此結果之作業的活動標識碼。 它用來相互關聯CRP和延伸模組記錄。

criticalAndSecurityPatchCount

integer

偵測到為可用且尚未安裝的重要或安全性修補程式數目。

error

ApiError

執行作業期間遇到的錯誤。 詳細數據陣列包含它們的清單。

lastModifiedTime

string

作業開始時的 UTC 時間戳。

otherPatchCount

integer

排除重大和安全性的所有可用修補程式數目。

rebootPending

boolean

VM 的整體重新啟動狀態。 部分安裝的修補程式需要重新啟動才能完成安裝,但尚未發生重新啟動時,就會是 true。

startTime

string

作業開始時的 UTC 時間戳。

status

PatchOperationStatus

作業的整體成功或失敗狀態。 它會維持 「InProgress」,直到作業完成為止。 此時,它將會變成「未知」、「失敗」、「成功」或「CompletedWithWarnings」。

BillingProfile

指定 Azure Spot 虛擬機的計費相關詳細數據。 API 版本下限:2019-03-01。

名稱 類型 Description
maxPrice

number

指定您願意支付 Azure Spot VM/VMSS 的最大價格。 此價格以美元為單位。

此價格將會與 VM 大小的目前 Azure Spot 價格進行比較。 此外,價格會在建立/更新 Azure Spot VM/VMSS 時進行比較,而且只有在 maxPrice 大於目前的 Azure Spot 價格時,作業才會成功。

如果目前的 Azure Spot 價格在建立 VM/VMSS 之後超過 maxPrice,則 maxPrice 也會用於收回 Azure Spot VM/VMSS。

可能的值包括:

- 大於零的任何十進位值。 範例:0.01538

-1 – 表示預設價格為隨選。

您可以將 maxPrice 設定為 -1,以指出基於價格考慮,不應收回 Azure Spot VM/VMSS。 此外,如果預設的最大值價格不是由您提供,則為 -1。

API 版本下限:2019-03-01。

BootDiagnostics

開機診斷是一項偵錯功能,可讓您檢視控制台輸出和螢幕快照以診斷 VM 狀態。 注意:如果要指定 storageUri,請確定記憶體帳戶位於與 VM 相同的區域和訂用帳戶中。 您可以輕鬆地檢視主控台記錄檔的輸出。 Azure 也可讓您從 Hypervisor 查看 VM 的螢幕快照。

名稱 類型 Description
enabled

boolean

是否應在虛擬機上啟用開機診斷。

storageUri

string

用來放置主控台輸出和螢幕快照的記憶體帳戶 URI。 如果未在啟用開機診斷時指定 storageUri,則會使用受控記憶體。

BootDiagnosticsInstanceView

開機診斷是一項偵錯功能,可讓您檢視控制台輸出和螢幕快照以診斷 VM 狀態。 您可以輕鬆地檢視主控台記錄檔的輸出。 Azure 也可讓您從 Hypervisor 查看 VM 的螢幕快照。

名稱 類型 Description
consoleScreenshotBlobUri

string

控制台螢幕快照 Blob URI。 注意: 如果目前已啟用受控記憶體的開機診斷,則 不會 設定此設定。

serialConsoleLogBlobUri

string

序列主控台記錄 Blob URI。 注意: 如果目前已啟用受控記憶體的開機診斷,則 不會 設定此設定。

status

InstanceViewStatus

VM 的開機診斷狀態資訊。 注意: 只有在啟用開機診斷時發生錯誤時,才會設定它。

CachingTypes

指定快取需求。 可能的值為: None、ReadOnly、ReadWrite。 默認行為為: 標準記憶體的 None。進階記憶體的 ReadOnly。

名稱 類型 Description
None

string

ReadOnly

string

ReadWrite

string

CapacityReservationProfile

指定用來配置虛擬機之容量保留區的相關信息。 API 版本下限:2021-04-01。

名稱 類型 Description
capacityReservationGroup

SubResource

指定容量保留群組資源標識符,該標識元應該用於配置已保留足夠容量的虛擬機或擴展集 VM 實例。 如需詳細資訊, https://aka.ms/CapacityReservation 請參閱 。

CloudError

來自計算服務的錯誤回應。

名稱 類型 Description
error

ApiError

API 錯誤。

ComponentNames

元件名稱。 目前唯一允許的值是 Microsoft-Windows-Shell-Setup。

名稱 類型 Description
Microsoft-Windows-Shell-Setup

string

DataDisk

指定用來將資料磁碟加入至虛擬機器的參數。 如需磁碟的詳細資訊,請參閱 關於 Azure 虛擬機的磁碟和 VHD

名稱 類型 Description
caching

CachingTypes

指定快取需求。 可能的值為: None、ReadOnly、ReadWrite。 默認行為為: 標準記憶體無。進階記憶體的 ReadOnly。

createOption

DiskCreateOptionTypes

指定應該如何建立虛擬機磁碟。 可能的值為 Attach: 當您使用特製化磁碟來建立虛擬機時,會使用此值。 FromImage: 當您使用映像來建立虛擬機數據磁碟時,會使用此值。 如果您使用平臺映像,則也應該使用上述的 imageReference 元素。 如果您使用市集映像,您也應該使用先前所述的方案元素。 空: 建立空的數據磁碟時,會使用此值。 複製: 這個值可用來從快照集或其他磁碟建立數據磁碟。 恢復: 這個值是用來從磁碟還原點建立數據磁碟。

deleteOption

DiskDeleteOptionTypes

指定在 VM 刪除時應該刪除或中斷連結資料磁碟。 可能的值為: Delete。 如果使用此值,則會在刪除 VM 時刪除資料磁碟。 分離。 如果使用此值,則會在刪除 VM 之後保留資料磁碟。 默認值設定為 [卸離]。

detachOption

DiskDetachOptionTypes

指定要在中斷連結磁碟時使用的卸離行為,或已在從虛擬機中斷鏈接的過程中使用。 支援的值: ForceDetach。 detachOption: ForceDetach 僅適用於受控數據磁碟。 如果先前的數據磁碟斷連結嘗試因為虛擬機發生意外失敗而未完成,但磁碟仍然未釋放,請使用強制卸離作為最後一個從 VM 強制卸離磁碟的選項。 使用這個卸離行為時,所有寫入可能都尚未排清。 此功能仍在預覽模式中 ,且 VirtualMachineScaleSet 不支援此功能。 若要強制中斷數據磁碟更新至BeDetached 為 『true』,以及設定 detachOption: 'ForceDetach'。

diskIOPSReadWrite

integer

指定 StorageAccountType UltraSSD_LRS時,受控磁碟的 Read-Write IOPS。 僅針對 VirtualMachine ScaleSet VM 磁碟傳回。 只能透過 VirtualMachine 擴展集的更新來更新。

diskMBpsReadWrite

integer

指定 StorageAccountType UltraSSD_LRS時,受控磁碟每秒以 MB 為單位的頻寬。 僅針對 VirtualMachine ScaleSet VM 磁碟傳回。 只能透過 VirtualMachine 擴展集的更新來更新。

diskSizeGB

integer

指定以 GB 為單位的空白資料磁碟大小。 此元素可用來覆寫虛擬機映像中的磁碟大小。 屬性 'diskSizeGB' 是磁碟的位元組 x 1024^3 數目,值不能大於 1023。

image

VirtualHardDisk

來源使用者映像虛擬硬碟。 在連接至虛擬機之前,將會先複製虛擬硬碟。 如果提供SourceImage,目的地虛擬硬碟不得存在。

lun

integer

指定數據磁碟的邏輯單位編號。 此值是用來識別 VM 內的數據磁碟,因此對於連結至 VM 的每個數據磁碟而言,都必須是唯一的。

managedDisk

ManagedDiskParameters

受控磁碟參數。

name

string

磁碟名稱。

sourceResource

ApiEntityReference

來源資源標識碼。 它可以是建立磁碟的快照集或磁碟還原點。

toBeDetached

boolean

指定數據磁碟是否正在從 VirtualMachine/VirtualMachineScaleset 中斷連結

vhd

VirtualHardDisk

虛擬硬碟。

writeAcceleratorEnabled

boolean

指定是否應該在磁碟上啟用或停用 writeAccelerator。

DeleteOptions

指定刪除 VM 時網路介面會發生什麼事

名稱 類型 Description
Delete

string

Detach

string

DiagnosticsProfile

指定開機診斷設定狀態。 API 版本下限:2015-06-15。

名稱 類型 Description
bootDiagnostics

BootDiagnostics

開機診斷是一項偵錯功能,可讓您檢視控制台輸出和螢幕快照以診斷 VM 狀態。 注意:如果要指定 storageUri,請確定記憶體帳戶位於與 VM 相同的區域和訂用帳戶中。 您可以輕鬆地檢視主控台記錄檔的輸出。 Azure 也可讓您從 Hypervisor 查看 VM 的螢幕快照。

DiffDiskOptions

指定作業系統磁碟的暫時磁碟設定。

名稱 類型 Description
Local

string

DiffDiskPlacement

指定作業系統磁碟的暫時磁碟位置。 可能的值為: CacheDisk、ResourceDisk、NvmeDisk。 默認行為為:如果已針對 VM 大小設定 快取Disk ,否則會使用 ResourceDiskNvmeDisk 。 請參閱 上的 https://docs.microsoft.com/azure/virtual-machines/windows/sizes Windows VM 和 Linux VM https://docs.microsoft.com/azure/virtual-machines/linux/sizes 的 VM 大小檔,以檢查哪些 VM 大小會公開快取磁碟。 NvmeDisk 的最低 API 版本:2024-03-01。

名稱 類型 Description
CacheDisk

string

NvmeDisk

string

ResourceDisk

string

DiffDiskSettings

指定虛擬機所使用作業系統磁碟的暫時磁碟設定。

名稱 類型 Description
option

DiffDiskOptions

指定作業系統磁碟的暫時磁碟設定。

placement

DiffDiskPlacement

指定作業系統磁碟的暫時磁碟位置。 可能的值為: CacheDisk、ResourceDisk、NvmeDisk。 默認行為為:如果已針對 VM 大小設定快取 Disk ,否則會使用 ResourceDiskNvmeDisk 。 請參閱 上的 https://docs.microsoft.com/azure/virtual-machines/windows/sizes Windows VM 和 Linux VM https://docs.microsoft.com/azure/virtual-machines/linux/sizes 的 VM 大小檔,以檢查哪些 VM 大小會公開快取磁碟。 NvmeDisk 的最低 API 版本:2024-03-01。

DiskControllerTypes

指定為 VM 設定的磁碟控制器類型。 注意: 如果未指定,則會使用 『hyperVGeneration』 設定為 V2,根據指定之最低 API 版本之作業系統磁碟和 VM 大小的功能,將此屬性設定為預設磁碟控制器類型。 除非您更新 VM 組態中的 VM 大小,以隱含地解除分配和重新配置 VM,否則您必須在更新其磁碟控制器類型之前解除分配 VM。 API 版本下限:2022-08-01。

名稱 類型 Description
NVMe

string

SCSI

string

DiskCreateOptionTypes

指定應如何建立虛擬機磁碟。 可能的值為 Attach: 當您使用特製化磁碟來建立虛擬機時,會使用此值。 FromImage: 當您使用映像來建立虛擬機時,會使用此值。 如果您使用平臺映像,則也應該使用上述的 imageReference 元素。 如果您使用 Marketplace 映射,則也應該使用先前所述的方案元素。

名稱 類型 Description
Attach

string

Copy

string

Empty

string

FromImage

string

Restore

string

DiskDeleteOptionTypes

指定在 VM 刪除時應刪除或中斷連結 OS 磁碟。 可能的值為: Delete。 如果使用此值,則會在刪除 VM 時刪除 OS 磁碟。 分離。 如果使用此值,則會在刪除 VM 之後保留 os 磁碟。 默認值設定為 [卸離]。 若為暫時OS磁碟,預設值會設定為 Delete。 使用者無法變更暫時 OS 磁碟的刪除選項。

名稱 類型 Description
Delete

string

Detach

string

DiskDetachOptionTypes

指定卸離磁碟時所要使用的卸離行為,或已在從虛擬機中斷鏈接的過程中使用。 支援的值: ForceDetach。 detachOption: ForceDetach 僅適用於受控數據磁碟。 如果先前的數據磁碟斷連結嘗試因為虛擬機發生非預期的失敗而未完成,但磁碟仍然未釋放,請使用強制中斷連結作為最後一個從 VM 中斷連結磁碟的最後一個選項。 使用此卸離行為時,可能不會排清所有寫入。 此功能仍處於預覽 模式,且 VirtualMachineScaleSet 不支援此功能。 若要強制中斷數據磁碟更新至BeDetached 為 『true』,以及設定 detachOption: 'ForceDetach'。

名稱 類型 Description
ForceDetach

string

DiskEncryptionSetParameters

指定受控磁碟的客戶受控磁碟加密集資源標識符。

名稱 類型 Description
id

string

資源標識碼

DiskEncryptionSettings

指定 OS 磁碟的加密設定。 API 版本下限:2015-06-15。

名稱 類型 Description
diskEncryptionKey

KeyVaultSecretReference

指定磁碟加密金鑰的位置,這是 金鑰保存庫 秘密。

enabled

boolean

指定是否應在虛擬機上啟用磁碟加密。

keyEncryptionKey

KeyVaultKeyReference

指定 金鑰保存庫 中金鑰加密金鑰的位置。

DiskInstanceView

虛擬機磁碟資訊。

名稱 類型 Description
encryptionSettings

DiskEncryptionSettings[]

指定 OS 磁碟的加密設定。

最低 api-version:2015-06-15

name

string

磁碟名稱。

statuses

InstanceViewStatus[]

資源狀態資訊。

DomainNameLabelScopeTypes

即將建立之 PublicIPAddress 資源的功能變數名稱標籤範圍。 產生的名稱標籤是根據功能變數名稱標籤範圍和 vm 網路配置檔唯一識別碼,與原則串連哈希功能變數名稱標籤。

名稱 類型 Description
NoReuse

string

ResourceGroupReuse

string

SubscriptionReuse

string

TenantReuse

string

EncryptionIdentity

指定 ADE 用來取得金鑰保存庫作業存取令牌的受控識別。

名稱 類型 Description
userAssignedIdentityResourceId

string

指定與 VM 相關聯的其中一個使用者身分識別的 ARM 資源識別碼。

EventGridAndResourceGraph

建立 eventGridAndResourceGraph 排程事件設定時所使用的組態參數。

名稱 類型 Description
enable

boolean

指定是否已啟用排程事件相關組態的事件方格和資源圖表。

ExtendedLocation

虛擬機的擴充位置。

名稱 類型 Description
name

string

擴充位置的名稱。

type

ExtendedLocationTypes

擴充位置的類型。

ExtendedLocationTypes

擴充位置的類型。

名稱 類型 Description
EdgeZone

string

HardwareProfile

指定虛擬機器的硬體設定。

名稱 類型 Description
vmSize

VirtualMachineSizeTypes

指定虛擬機器的大小。 列舉數據類型目前已被取代,將於 2023 年 12 月 23 日移除。 取得可用大小清單的建議方式是使用這些 API: 列出可用性設定組中的所有可用虛擬機器大小列出區域中的所有可用虛擬機大小列出所有可用的虛擬機大小以進行重設大小。 如需虛擬機大小的詳細資訊,請參閱 虛擬機的大小。 可用的 VM 大小取決於區域和可用性設定組。

vmSizeProperties

VMSizeProperties

指定自定義虛擬機大小的屬性。 API 版本下限:2021-07-01。 此功能仍在預覽模式中,且 VirtualMachineScaleSet 不支援此功能。 如需詳細資訊,請遵循 VM 自定義 中的指示。

HyperVGenerationType

指定與資源相關聯的 HyperVGeneration 類型

名稱 類型 Description
V1

string

V2

string

ImageReference

指定要使用之映像的相關信息。 您可以指定平臺映像、市集映像或虛擬機映像的相關信息。 當您想要使用平臺映像、市集映像或虛擬機映像,但不會用於其他建立作業時,需要此元素。

名稱 類型 Description
communityGalleryImageId

string

指定 vm 部署的社群資源庫映像唯一標識碼。 這可以從社群資源庫映像 GET 呼叫擷取。

exactVersion

string

以十進位數指定,也就是用來建立虛擬機的平臺映像或市集映射版本。 這個只讀欄位與 'version' 不同,只有在 'version' 字段中指定的值是 'latest'時。

id

string

資源標識碼

offer

string

指定用來建立虛擬機的平臺映像或 Marketplace 映像供應專案。

publisher

string

映像發行者。

sharedGalleryImageId

string

指定 VM 部署的共享資源庫映像唯一識別碼。 這可以從共用資源庫映像 GET 呼叫擷取。

sku

string

映像 SKU。

version

string

指定用來建立虛擬機的平臺映像或 Marketplace 映像版本。 允許的格式為 Major.Minor.Build 或 'latest'。 主要、次要和組建是十進位數。 指定「最新」以使用部署階段可用的最新映像版本。 即使您使用「最新」,即使有新版本可供使用,VM 映像也不會在部署時間之後自動更新。 請勿針對資源庫映射部署使用字段 'version',資源庫映射應該一律使用 'id' 字段進行部署,若要使用資源庫映射的 'latest' 版本,只要設定 '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/gallerys/{galleryName}/images/{imageName}' 字段,就不需要輸入版本。

InnerError

內部錯誤詳細數據。

名稱 類型 Description
errordetail

string

內部錯誤訊息或例外狀況傾印。

exceptiontype

string

例外狀況型別。

InstanceViewStatus

實例檢視狀態。

名稱 類型 Description
code

string

狀態碼。

displayStatus

string

狀態的簡短可當地語系化標籤。

level

StatusLevelTypes

層級程序代碼。

message

string

詳細的狀態消息,包括警示和錯誤訊息。

time

string

狀態的時間。

IPVersions

從 Api-Version 2019-07-01 起提供,它代表特定 ipconfiguration 是 IPv4 或 IPv6。 預設值會視為 IPv4。 可能的值為:'IPv4' 和 'IPv6'。

名稱 類型 Description
IPv4

string

IPv6

string

KeyVaultKeyReference

指定 金鑰保存庫 中金鑰加密金鑰的位置。

名稱 類型 Description
keyUrl

string

參考 金鑰保存庫 中金鑰加密金鑰的 URL。

sourceVault

SubResource

包含金鑰之 金鑰保存庫 的相對 URL。

KeyVaultSecretReference

以傳址方式傳遞並從金鑰保存庫取用的延伸模組受保護設定

名稱 類型 Description
secretUrl

string

參考 金鑰保存庫 秘密的 URL。

sourceVault

SubResource

包含秘密之 金鑰保存庫的相對 URL。

LastPatchInstallationSummary

虛擬機最新安裝作業的安裝摘要。

名稱 類型 Description
error

ApiError

執行作業期間遇到的錯誤。 詳細數據陣列包含它們的清單。

excludedPatchCount

integer

客戶指定排除清單相符項目明確排除的所有可用修補程式數目。

failedPatchCount

integer

安裝失敗的修補程式計數。

installationActivityId

string

產生此結果之作業的活動標識碼。 它用來相互關聯CRP和延伸模組記錄。

installedPatchCount

integer

已成功安裝的修補程式計數。

lastModifiedTime

string

作業開始時的 UTC 時間戳。

maintenanceWindowExceeded

boolean

描述作業是否在完成所有預定動作之前用盡時間

notSelectedPatchCount

integer

所有可用的修補程式數目,但不會安裝,因為它不符合分類或包含清單專案。

pendingPatchCount

integer

預期會在修補程式安裝作業期間安裝的所有可用修補程式數目。

startTime

string

作業開始時的 UTC 時間戳。

status

PatchOperationStatus

作業的整體成功或失敗狀態。 它會維持 「InProgress」,直到作業完成為止。 此時,它將會變成「未知」、「失敗」、「成功」或「CompletedWithWarnings」。

LinuxConfiguration

指定虛擬機上的Linux作業系統設定。 如需支援的Linux發行版清單,請參閱 Azure-Endorsed 發行版上的Linux

名稱 類型 Description
disablePasswordAuthentication

boolean

指定是否應該停用密碼驗證。

enableVMAgentPlatformUpdates

boolean

指出是否為Linux虛擬機啟用 VMAgent Platform 匯報。 預設值為 False。

patchSettings

LinuxPatchSettings

[預覽功能]指定與Linux上的VM客體修補相關的設定。

provisionVMAgent

boolean

指出是否應該在虛擬機器上佈建虛擬機器代理程式。 當要求本文中未指定這個屬性時,預設行為是將它設定為 true。 這可確保 VM 代理程式已安裝在 VM 上,以便稍後將擴充功能新增至 VM。

ssh

SshConfiguration

指定 Linux OS 的 SSH 金鑰組態。

LinuxPatchAssessmentMode

指定 IaaS 虛擬機的 VM 客體修補評估模式。

可能的值包括:

ImageDefault - 您可以在虛擬機上控制修補程式評估的時間。

AutomaticByPlatform - 平臺會觸發定期修補評估。 屬性 provisionVMAgent 必須是 true。

名稱 類型 Description
AutomaticByPlatform

string

ImageDefault

string

LinuxPatchSettings

[預覽功能]指定與Linux上的VM客體修補相關的設定。

名稱 類型 Description
assessmentMode

LinuxPatchAssessmentMode

指定 IaaS 虛擬機的 VM 客體修補評估模式。

可能的值包括:

ImageDefault - 您可以在虛擬機上控制修補程式評估的時間。

AutomaticByPlatform - 平臺會觸發定期修補評估。 屬性 provisionVMAgent 必須是 true。

automaticByPlatformSettings

LinuxVMGuestPatchAutomaticByPlatformSettings

在 Linux 上的 VM 客體修補中指定 Patch 模式 AutomaticByPlatform 的其他設定。

patchMode

LinuxVMGuestPatchMode

指定 VM 客體修補至 IaaS 虛擬機的模式,或與 OrchestraMode 為彈性的虛擬機擴展集相關聯的虛擬機。

可能的值包括:

ImageDefault - 會使用虛擬機的默認修補組態。

AutomaticByPlatform - 虛擬機將會由平台自動更新。 provisionVMAgent 屬性必須是 true

LinuxVMGuestPatchAutomaticByPlatformRebootSetting

指定所有 AutomaticByPlatform 修補程式安裝作業的重新啟動設定。

名稱 類型 Description
Always

string

IfRequired

string

Never

string

Unknown

string

LinuxVMGuestPatchAutomaticByPlatformSettings

在 Linux 上的 VM 客體修補中指定 Patch 模式 AutomaticByPlatform 的其他設定。

名稱 類型 Description
bypassPlatformSafetyChecksOnUserSchedule

boolean

讓客戶排程修補而不意外升級

rebootSetting

LinuxVMGuestPatchAutomaticByPlatformRebootSetting

指定所有 AutomaticByPlatform 修補程式安裝作業的重新啟動設定。

LinuxVMGuestPatchMode

指定 VM 客體修補至 IaaS 虛擬機的模式,或與 OrchestraMode 為彈性的虛擬機擴展集相關聯的虛擬機。

可能的值包括:

ImageDefault - 會使用虛擬機的默認修補組態。

AutomaticByPlatform - 虛擬機將會由平台自動更新。 provisionVMAgent 屬性必須是 true

名稱 類型 Description
AutomaticByPlatform

string

ImageDefault

string

MaintenanceOperationResultCodeTypes

上次維護作業結果碼。

名稱 類型 Description
MaintenanceAborted

string

MaintenanceCompleted

string

None

string

RetryLater

string

MaintenanceRedeployStatus

虛擬機上的維護作業狀態。

名稱 類型 Description
isCustomerInitiatedMaintenanceAllowed

boolean

如果允許客戶執行維護,則為 True。

lastOperationMessage

string

針對上次維護作業傳回的訊息。

lastOperationResultCode

MaintenanceOperationResultCodeTypes

上次維護作業結果碼。

maintenanceWindowEndTime

string

維護時段的結束時間。

maintenanceWindowStartTime

string

維護時段的開始時間。

preMaintenanceWindowEndTime

string

維護前時段的結束時間。

preMaintenanceWindowStartTime

string

維護前時段的開始時間。

ManagedDiskParameters

受控磁碟參數。

名稱 類型 Description
diskEncryptionSet

DiskEncryptionSetParameters

指定受控磁碟的客戶受控磁碟加密集資源標識符。

id

string

資源標識碼

securityProfile

VMDiskSecurityProfile

指定受控磁碟的安全性配置檔。

storageAccountType

StorageAccountTypes

指定受控磁碟的記憶體帳戶類型。 注意:UltraSSD_LRS只能與數據磁碟搭配使用,因此無法與OS磁碟搭配使用。

Mode

指定如果啟用此功能,ProxyAgent 將會在 上執行的模式。 ProxyAgent 會開始稽核或監視,但不會對稽核模式中的主機端點要求強制執行訪問控制,而在 [強制執行] 模式中,則會強制執行訪問控制。 默認值為 [強制] 模式。

名稱 類型 Description
Audit

string

Enforce

string

NetworkApiVersion

會指定在網路介面組態中建立網路資源時所使用的 Microsoft.Network API 版本

名稱 類型 Description
2020-11-01

string

NetworkInterfaceAuxiliaryMode

指定是否為網路介面資源啟用輔助模式。

名稱 類型 Description
AcceleratedConnections

string

Floating

string

None

string

NetworkInterfaceAuxiliarySku

指定是否為網路介面資源啟用輔助 SKU。

名稱 類型 Description
A1

string

A2

string

A4

string

A8

string

None

string

NetworkInterfaceReference

指定與虛擬機相關聯之網路介面的資源標識符清單。

名稱 類型 Description
id

string

資源標識碼

properties.deleteOption

DeleteOptions

指定刪除 VM 時網路介面會發生什麼情況

properties.primary

boolean

指定虛擬機有1個以上的網路介面時的主要網路介面。

NetworkProfile

指定虛擬機器的網路介面。

名稱 類型 Description
networkApiVersion

NetworkApiVersion

會指定在網路介面組態中建立網路資源時所使用的 Microsoft.Network API 版本

networkInterfaceConfigurations

VirtualMachineNetworkInterfaceConfiguration[]

指定將用來建立虛擬機網路資源的網路設定。

networkInterfaces

NetworkInterfaceReference[]

指定與虛擬機相關聯之網路介面的資源標識符清單。

OperatingSystemTypes

操作系統類型。

名稱 類型 Description
Linux

string

Windows

string

OSDisk

指定虛擬機所使用的作業系統磁碟相關信息。 如需磁碟的詳細資訊,請參閱 關於 Azure 虛擬機的磁碟和 VHD

名稱 類型 Description
caching

CachingTypes

指定快取需求。 可能的值為: None、ReadOnly、ReadWrite。 默認行為為: 標準記憶體無。進階記憶體的 ReadOnly。

createOption

DiskCreateOptionTypes

指定應該如何建立虛擬機磁碟。 可能的值為 Attach: 當您使用特製化磁碟來建立虛擬機時,會使用此值。 FromImage: 當您使用映像來建立虛擬機時,會使用此值。 如果您使用平臺映像,則也應該使用上述的 imageReference 元素。 如果您使用市集映像,您也應該使用先前所述的方案元素。

deleteOption

DiskDeleteOptionTypes

指定在 VM 刪除時,是否應該刪除或中斷連結 OS 磁碟。 可能的值為: Delete。 如果使用此值,則會在刪除 VM 時刪除 OS 磁碟。 分離。 如果使用此值,則會在刪除 VM 之後保留 os 磁碟。 默認值設定為 [卸離]。 對於暫時 OS 磁碟,預設值會設定為 [刪除]。 使用者無法變更暫時 OS 磁碟的刪除選項。

diffDiskSettings

DiffDiskSettings

指定虛擬機所使用作業系統磁碟的暫時磁碟設定。

diskSizeGB

integer

指定以 GB 為單位的空白資料磁碟大小。 此元素可用來覆寫虛擬機映像中的磁碟大小。 屬性 'diskSizeGB' 是磁碟的位元組 x 1024^3 數目,值不能大於 1023。

encryptionSettings

DiskEncryptionSettings

指定 OS 磁碟的加密設定。 API 版本下限:2015-06-15。

image

VirtualHardDisk

來源使用者映像虛擬硬碟。 在連接至虛擬機之前,將會先複製虛擬硬碟。 如果提供SourceImage,目的地虛擬硬碟不得存在。

managedDisk

ManagedDiskParameters

受控磁碟參數。

name

string

磁碟名稱。

osType

OperatingSystemTypes

此屬性可讓您指定從使用者映像或特製化 VHD 建立 VM 時,磁碟包含的 OS 類型。 可能的值為: Windows、Linux。

vhd

VirtualHardDisk

虛擬硬碟。

writeAcceleratorEnabled

boolean

指定是否應該在磁碟上啟用或停用 writeAccelerator。

OSImageNotificationProfile

指定OS映像排程事件相關組態。

名稱 類型 Description
enable

boolean

指定是否啟用或停用OS映像排程事件。

notBeforeTimeout

string

虛擬機重新映像或其操作系統升級的時間長度,在事件自動核准之前,必須先核准 OS 映射排程事件, (逾時) 。 設定是以 ISO 8601 格式指定,而且此值必須是 15 分鐘, (PT15M)

OSProfile

指定建立虛擬機時所使用的作業系統設定。 一旦布建 VM 之後,就無法變更部分設定。

名稱 類型 Description
adminPassword

string

指定系統管理員帳戶的密碼。

Windows) 長度下限 (: 8 個字元

Linux) 長度下限 (: 6 個字元

Windows) 長度上限 (: 123 個字元

Linux) 長度上限 (: 72 個字元

複雜度需求: 需要滿足下列 4 個條件中的 3 個
字元較低
具有大字元
具有數位
具有特殊字元 (Regex 比對 [\W_])

不允許的值: “abc@123”、“P@$$w 0rd”、“P@ssw0rd”、“P@ssword123”、“Pa$$word”、“pass@word1”、“Password!”、“Password1”、“Password22”、“P@ssword123”、“pa$$word”、“Password!”、“Password1”、“Password22”、“P@ssword123!”

如需重設密碼,請參閱 如何在 Windows VM 中重設遠端桌面服務或其登入密碼

如需重設根密碼,請參閱 使用 VMAccess 擴充功能管理使用者、SSH 及檢查或修復 Azure Linux VM 上的磁碟

adminUsername

string

指定系統管理員帳戶的名稱。

建立 VM 之後,就無法更新此屬性。

僅限 Windows 的限制: 不能以 “.

不允許的值: “administrator”、“admin”、“user”、“user1”、“test”、“user2”、“test1”、“user3”、“admin1”、“1”、 “123”、“a”、“actuser”、“adm”、“admin2”、“aspnet”、“backup”、“console”、“david”、“guest”、“john”、“owner”、“root”、“server”、“sql”、“support”、“support_388945a0”、“sys”、“test2”、“test3”、“user4”、“user5”。

Linux () 長度下限: 1 個字元

Linux) 長度上限 (: 64 個字元

Windows) 長度上限 () : 20 個字元。

allowExtensionOperations

boolean

指定是否應在虛擬機上允許擴充功能作業。 只有在虛擬機上沒有擴充功能時,才能將此設定為 False。

computerName

string

指定虛擬機的主機OS名稱。 建立 VM 之後,就無法更新此名稱。 Windows) 長度上限 (: 15 個字元。 Linux) 長度上限 (: 64 個字元。 如需命名慣例和限制,請參閱 Azure 基礎結構服務實作指導方針

customData

string

指定自訂資料的 Base-64 編碼字串。 Base-64 編碼字串會解碼成二進位陣列而儲存為虛擬機器上的檔案。 二進位陣列的長度上限是 65535 個位元組。 注意:請勿在 customData 屬性中傳遞任何秘密或密碼。 建立 VM 之後,就無法更新此屬性。 屬性 'customData' 會傳遞至要儲存為檔案的 VM,如需詳細資訊,請參閱 Azure VM 上的自定義數據。 如需針對Linux VM使用 cloud-init,請參閱在建立期間使用cloud-init 自定義Linux VM

linuxConfiguration

LinuxConfiguration

指定虛擬機上的Linux作業系統設定。 如需支援的Linux發行版清單,請參閱 Azure-Endorsed 發行版上的Linux

requireGuestProvisionSignal

boolean

必須設定為 True 或省略的選擇性屬性。

secrets

VaultSecretGroup[]

指定應該安裝到虛擬機器的憑證集。 若要在虛擬機上安裝憑證,建議使用適用於Linux的 Azure 金鑰保存庫 虛擬機擴充功能適用於Windows的 Azure 金鑰保存庫 虛擬機擴充功能

windowsConfiguration

WindowsConfiguration

指定虛擬機器上的 Windows 作業系統設定。

PassNames

傳遞名稱。 目前唯一允許的值是 OobeSystem。

名稱 類型 Description
OobeSystem

string

PatchOperationStatus

作業的整體成功或失敗狀態。 它會維持 「InProgress」,直到作業完成為止。 此時,它會變成「未知」、「失敗」、「成功」或「CompletedWithWarnings」。

名稱 類型 Description
CompletedWithWarnings

string

Failed

string

InProgress

string

Succeeded

string

Unknown

string

PatchSettings

[預覽功能]指定與 Windows 上的 VM 客體修補相關的設定。

名稱 類型 Description
assessmentMode

WindowsPatchAssessmentMode

指定 IaaS 虛擬機的 VM 客體修補評估模式。

可能的值包括:

ImageDefault - 您可以在虛擬機上控制修補程式評估的時間。

AutomaticByPlatform - 平臺會觸發定期修補評估。 屬性 provisionVMAgent 必須是 true。

automaticByPlatformSettings

WindowsVMGuestPatchAutomaticByPlatformSettings

指定 Windows 上 VM 客體修補中的 Patch 模式 AutomaticByPlatform 的其他設定。

enableHotpatching

boolean

可讓客戶修補其 Azure VM,而不需要重新啟動。 針對 enableHotpatching,'provisionVMAgent' 必須設定為 true,而且 'patchMode' 必須設定為 'AutomaticByPlatform'。

patchMode

WindowsVMGuestPatchMode

指定 VM 客體修補至 IaaS 虛擬機的模式,或與 OrchestraMode 為彈性的虛擬機擴展集相關聯的虛擬機。

可能的值包括:

手動 - 您可以控制將修補程式應用程式套用至虛擬機。 您可以在 VM 內手動套用修補程式來執行此動作。 在此模式中,自動更新會停用;屬性 WindowsConfiguration.enableAutomaticUpdates 必須為 false

AutomaticByOS - 作業系統會自動更新虛擬機。 WindowsConfiguration.enableAutomaticUpdates 屬性必須是 true。

AutomaticByPlatform - 虛擬機將會由平台自動更新。 provisionVMAgent 和 WindowsConfiguration.enableAutomaticUpdates 屬性必須是 true

Plan

指定用來建立虛擬機之 Marketplace 映像的相關信息。 此元素僅用於市集映像。 您必須先啟用映像以程序設計方式使用,才能從 API 使用市集映射。 在 Azure 入口網站 中,尋找您想要使用的市集映像,然後按兩下 [想要以程序設計方式部署][開始使用] ->。 輸入任何必要資訊,然後按兩下 [ 儲存]。

名稱 類型 Description
name

string

方案標識碼。

product

string

指定市集中映像的產品。 這個值與 imageReference 元素下的 Offer 相同。

promotionCode

string

促銷碼。

publisher

string

發行者標識碼。

ProtocolTypes

指定 WinRM 接聽程式的通訊協定。 可能的值為: HTTP、https。

名稱 類型 Description
Http

string

Https

string

ProxyAgentSettings

指定建立虛擬機時的 ProxyAgent 設定。 API 版本下限:2024-03-01。

名稱 類型 Description
enabled

boolean

指定是否應在虛擬機或虛擬機擴展集上啟用 ProxyAgent 功能。

keyIncarnationId

integer

增加此屬性的值可讓使用者重設用來保護客體與主機之間通道的密鑰。

mode

Mode

指定啟用此功能時,ProxyAgent 將會在 上執行的模式。 ProxyAgent 會開始稽核或監視,但不會在稽核模式中對主機端點的要求強制執行訪問控制,而在 [強制執行] 模式中,則會強制執行訪問控制。 默認值為 [強制模式]。

PublicIPAddressSku

描述公用IP Sku。 它只能以 OrchestrationMode 設定為彈性。

名稱 類型 Description
name

PublicIPAddressSkuName

指定公用IP SKU 名稱

tier

PublicIPAddressSkuTier

指定公用IP SKU層

PublicIPAddressSkuName

指定公用IP SKU 名稱

名稱 類型 Description
Basic

string

Standard

string

PublicIPAddressSkuTier

指定公用IP SKU層

名稱 類型 Description
Global

string

Regional

string

PublicIPAllocationMethod

指定公用IP配置類型

名稱 類型 Description
Dynamic

string

Static

string

ResourceIdentityType

用於虛擬機的身分識別類型。 「SystemAssigned、UserAssigned」類型同時包含隱含建立的身分識別,和一組使用者指派的身分識別。 類型 『None』 將會從虛擬機中移除任何身分識別。

名稱 類型 Description
None

string

SystemAssigned

string

SystemAssigned, UserAssigned

string

UserAssigned

string

ScheduledEventsAdditionalPublishingTargets

發佈 scheduledEventsAdditionalPublishingTargets 時所使用的組態參數。

名稱 類型 Description
eventGridAndResourceGraph

EventGridAndResourceGraph

建立 eventGridAndResourceGraph Scheduled Event 設定時所使用的組態參數。

ScheduledEventsPolicy

指定虛擬機的重新部署、重新啟動和 ScheduledEventsAdditionalPublishingTargets Scheduled 事件相關設定。

名稱 類型 Description
scheduledEventsAdditionalPublishingTargets

ScheduledEventsAdditionalPublishingTargets

發佈 scheduledEventsAdditionalPublishingTargets 時所使用的組態參數。

userInitiatedReboot

UserInitiatedReboot

建立 userInitiatedReboot 排程事件設定時所使用的組態參數。

userInitiatedRedeploy

UserInitiatedRedeploy

建立 userInitiatedRedeploy 排程事件設定時所使用的組態參數。

ScheduledEventsProfile

指定排程的事件相關組態。

名稱 類型 Description
osImageNotificationProfile

OSImageNotificationProfile

指定OS映像排程事件相關組態。

terminateNotificationProfile

TerminateNotificationProfile

指定終止排程事件相關組態。

securityEncryptionTypes

指定受控磁碟的 EncryptionType。 它設定為 DiskWithVMGuestState 以加密受控磁碟以及 VMGuestState Blob、VMGuestStateOnly 只加密 VMGuestState Blob,以及 NonPersistedTPM 表示未在 VMGuestState Blob 中保存韌體狀態。 注意: 它只能設定為機密 VM。

名稱 類型 Description
DiskWithVMGuestState

string

NonPersistedTPM

string

VMGuestStateOnly

string

SecurityProfile

指定虛擬機的安全性相關配置檔設定。

名稱 類型 Description
encryptionAtHost

boolean

用戶可以在要求中使用此屬性,以啟用或停用虛擬機或虛擬機擴展集的主機加密。 這會啟用所有磁碟的加密,包括主機本身的資源/暫存磁碟。 默認行為為:除非資源將此屬性設定為 true,否則將會停用主機加密。

encryptionIdentity

EncryptionIdentity

指定 ADE 用來取得金鑰保存庫作業存取令牌的受控識別。

proxyAgentSettings

ProxyAgentSettings

指定建立虛擬機時的 ProxyAgent 設定。 API 版本下限:2024-03-01。

securityType

SecurityTypes

指定虛擬機的 SecurityType。 它必須設定為任何指定的值,才能啟用 UefiSettings。 默認行為為:除非設定此屬性,否則不會啟用 UefiSettings。

uefiSettings

UefiSettings

指定安全性設定,例如建立虛擬機時所使用的安全開機和 vTPM。 API 版本下限:2020-12-01。

SecurityTypes

指定虛擬機的 SecurityType。 它必須設定為任何指定的值,才能啟用 UefiSettings。 默認行為為:除非設定此屬性,否則不會啟用 UefiSettings。

名稱 類型 Description
ConfidentialVM

string

TrustedLaunch

string

SettingNames

指定要套用內容之設定的名稱。 可能的值為:FirstLogonCommands 和 AutoLogon。

名稱 類型 Description
AutoLogon

string

FirstLogonCommands

string

SshConfiguration

指定 Linux OS 的 SSH 金鑰組態。

名稱 類型 Description
publicKeys

SshPublicKey[]

用來向Linux型VM進行驗證的SSH公鑰清單。

SshPublicKey

用來向Linux型VM進行驗證的SSH公鑰清單。

名稱 類型 Description
keyData

string

用來透過 ssh 向 VM 進行驗證的 SSH 公鑰憑證。 密鑰至少必須是 2048 位,且以 ssh-rsa 格式表示。 如需建立 SSH 金鑰,請參閱 [在 Linux 和 Mac 上為 Azure 中的 Linux VM 建立 SSH 金鑰]https://docs.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed).

path

string

指定儲存 ssh 公鑰之已建立 VM 上的完整路徑。 如果檔案已經存在,指定的金鑰就會附加至該檔案。 範例:/home/user/.ssh/authorized_keys

StatusLevelTypes

層級程序代碼。

名稱 類型 Description
Error

string

Info

string

Warning

string

StorageAccountTypes

指定受控磁碟的記憶體帳戶類型。 注意:UltraSSD_LRS只能與數據磁碟搭配使用,它不能與OS磁碟搭配使用。

名稱 類型 Description
PremiumV2_LRS

string

Premium_LRS

string

Premium_ZRS

string

StandardSSD_LRS

string

StandardSSD_ZRS

string

Standard_LRS

string

UltraSSD_LRS

string

StorageProfile

指定虛擬機器磁碟的儲存體設定。

名稱 類型 Description
dataDisks

DataDisk[]

指定用來將資料磁碟加入至虛擬機器的參數。 如需磁碟的詳細資訊,請參閱 關於 Azure 虛擬機的磁碟和 VHD

diskControllerType

DiskControllerTypes

指定為 VM 設定的磁碟控制器類型。 注意: 如果未指定提供的虛擬機是以 『hyperVGeneration』 設定為 V2,根據指定的最小 API 版本中的作業系統磁碟和 VM 大小功能,此屬性將會設定為預設磁碟控制器類型。 除非您在 VM 組態中更新 VM 大小,以隱含解除分配並重新配置 VM,否則您必須在更新其磁碟控制器類型之前解除分配 VM。 API 版本下限:2022-08-01。

imageReference

ImageReference

指定要使用之映像的相關信息。 您可以指定平臺映像、市集映像或虛擬機映像的相關信息。 當您想要使用平臺映像、市集映像或虛擬機映像,但不會用於其他建立作業時,需要此元素。

osDisk

OSDisk

指定虛擬機所使用的作業系統磁碟相關信息。 如需磁碟的詳細資訊,請參閱 關於 Azure 虛擬機的磁碟和 VHD

SubResource

包含秘密之 金鑰保存庫的相對 URL。

名稱 類型 Description
id

string

資源標識碼

TerminateNotificationProfile

指定終止排程事件相關組態。

名稱 類型 Description
enable

boolean

指定是否啟用或停用 Terminate Scheduled 事件。

notBeforeTimeout

string

刪除虛擬機的可設定時間長度,在自動核准事件之前,虛擬機必須核准終止排程事件, (逾時) 。 設定必須以 ISO 8601 格式指定,預設值為 5 分鐘, (PT5M)

UefiSettings

指定安全性設定,例如建立虛擬機時所使用的安全開機和 vTPM。 API 版本下限:2020-12-01。

名稱 類型 Description
secureBootEnabled

boolean

指定是否應在虛擬機上啟用安全開機。 API 版本下限:2020-12-01。

vTpmEnabled

boolean

指定是否應在虛擬機上啟用 vTPM。 API 版本下限:2020-12-01。

UserAssignedIdentities

與虛擬機相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。

名稱 類型 Description

UserInitiatedReboot

建立 userInitiatedReboot 排程事件設定時所使用的組態參數。

名稱 類型 Description
automaticallyApprove

boolean

指定重新啟動排程事件相關設定。

UserInitiatedRedeploy

建立 userInitiatedRedeploy 排程事件設定時所使用的組態參數。

名稱 類型 Description
automaticallyApprove

boolean

指定重新部署排程事件相關組態。

VaultCertificate

SourceVault 中包含憑證的金鑰保存庫參考清單。

名稱 類型 Description
certificateStore

string

針對 Windows VM,指定應該新增憑證之虛擬機上的證書存儲。 指定的證書存儲隱含地位於LocalMachine帳戶中。 針對Linux VM,憑證檔案會放在 /var/lib/waagent 目錄底下,而 X509 憑證檔案的檔名<為 UppercaseThumbprint.crt,而<私鑰則為 UppercaseThumbprint.prv>>。 這兩個檔案都是 .pem 格式。

certificateUrl

string

這是已上傳至 金鑰保存庫 作為秘密之憑證的 URL。 如需將秘密新增至 金鑰保存庫,請參閱將密鑰或秘密新增至密鑰保存庫。 在此情況下,您的憑證必須是下列 JSON 物件的 Base64 編碼,其編碼方式為 UTF-8:

{
“data”:“”,
“dataType”:“pfx”,
“password”:“”
}
若要在虛擬機上安裝憑證,建議您使用適用於Linux的 Azure 金鑰保存庫 虛擬機擴充功能,或適用於Windows的 Azure 金鑰保存庫 虛擬機擴充功能

VaultSecretGroup

指定應該安裝到虛擬機器的憑證集。 若要在虛擬機上安裝憑證,建議使用適用於Linux的 Azure 金鑰保存庫 虛擬機擴充功能適用於Windows的 Azure 金鑰保存庫 虛擬機擴充功能

名稱 類型 Description
sourceVault

SubResource

包含 VaultCertificates 中所有憑證之 金鑰保存庫 的相對 URL。

vaultCertificates

VaultCertificate[]

SourceVault 中包含憑證的金鑰保存庫參考清單。

VirtualHardDisk

虛擬硬碟。

名稱 類型 Description
uri

string

指定虛擬硬碟的 URI。

VirtualMachine

描述虛擬機。

名稱 類型 Description
etag

string

Etag 是在 VM 的建立/更新/取得回應中傳回的屬性,讓客戶可以在標頭中提供它,以確保開放式更新。

extendedLocation

ExtendedLocation

虛擬機的擴充位置。

id

string

資源標識碼

identity

VirtualMachineIdentity

如果已設定,則為虛擬機的身分識別。

location

string

資源位置

managedBy

string

如果 VM 是 VMSS 的一部分,ManagedBy 會設定為虛擬機擴展集 (VMSS) flex ARM resourceID。 這個屬性是由平臺用於內部資源群組刪除優化。

name

string

資源名稱

plan

Plan

指定用來建立虛擬機之 Marketplace 映像的相關信息。 此元素僅用於市集映像。 您必須先啟用映像以供程序設計使用,才能從 API 使用市集映射。 在 Azure 入口網站 中,尋找您想要使用的市集映射,然後按兩下 [想要以程序設計方式部署] [開始使用] -> 。 輸入任何必要資訊,然後按兩下 [ 儲存]。

properties.additionalCapabilities

AdditionalCapabilities

指定在虛擬機上啟用或停用的其他功能。

properties.applicationProfile

ApplicationProfile

指定應該提供給 VM/VMSS 的資源庫應用程式。

properties.availabilitySet

SubResource

指定虛擬機應指派給的可用性設定組相關信息。 在相同可用性設定組中指定的虛擬機器會配置到不同的節點,以便將可用性最大化。 如需可用性設定組的詳細資訊,請參閱 可用性設定組概觀。 如需 Azure 計劃性維護的詳細資訊,請參閱 Azure 中 虛擬機器 的維護和更新。 目前,VM 只能在建立時新增至可用性設定組。 要新增 VM 的可用性設定組應該位於與可用性設定組資源相同的資源群組之下。 現有的 VM 無法新增至可用性設定組。 此屬性不能與非 Null 屬性一起存在。virtualMachineScaleSet 參考。

properties.billingProfile

BillingProfile

指定 Azure Spot 虛擬機的計費相關詳細數據。 API 版本下限:2019-03-01。

properties.capacityReservation

CapacityReservationProfile

指定用來配置虛擬機之容量保留區的相關信息。 API 版本下限:2021-04-01。

properties.diagnosticsProfile

DiagnosticsProfile

指定開機診斷設定狀態。 API 版本下限:2015-06-15。

properties.evictionPolicy

VirtualMachineEvictionPolicyTypes

指定 Azure Spot 虛擬機和 Azure Spot 擴展集的收回原則。 針對 Azure Spot 虛擬機,支援「解除分配」和「刪除」,而最低 API 版本為 2019-03-01。 針對 Azure Spot 擴展集,同時支援 'Deallocate' 和 'Delete',而最低 API 版本為 2017-10-30-preview。

properties.extensionsTimeBudget

string

指定要啟動之所有延伸模組加上批注的時間。 持續時間應介於 15 分鐘到 120 分鐘之間, (包含) ,且應以 ISO 8601 格式指定。 預設值為90分鐘 (PT1H30M) 。 API 版本下限:2020-06-01。

properties.hardwareProfile

HardwareProfile

指定虛擬機器的硬體設定。

properties.host

SubResource

指定虛擬機所在專用主機的相關信息。 API 版本下限:2018-10-01。

properties.hostGroup

SubResource

指定虛擬機所在專用主機群組的相關信息。 注意: 用戶無法同時指定 host 和 hostGroup 屬性。 API 版本下限:2020-06-01。

properties.instanceView

VirtualMachineInstanceView

虛擬機實例檢視。

properties.licenseType

string

指定正在使用的映像或磁碟是在內部部署授權。

Windows Server 操作系統的可能值為:

Windows_Client

Windows_Server

Linux Server 操作系統的可能值為:

RHEL) 的RHEL_BYOS (

SUSE) 的SLES_BYOS (

如需詳細資訊,請參閱 適用於 Windows Server 的 Azure Hybrid Use Benefit

適用於Linux伺服器的 Azure Hybrid Use Benefit

最低 api-version:2015-06-15

properties.networkProfile

NetworkProfile

指定虛擬機器的網路介面。

properties.osProfile

OSProfile

指定建立虛擬機時所使用的作業系統設定。 布建 VM 之後,就無法變更部分設定。

properties.platformFaultDomain

integer

指定要在其中建立虛擬機的擴展集邏輯容錯網域。 根據預設,虛擬機會自動指派給容錯網域,以在可用的容錯網域之間維持平衡。 只有在設定此虛擬機的 'virtualMachineScaleSet' 屬性時,才適用這個屬性。 所參考的虛擬機擴展集必須具有大於 1 的 『platformFaultDomainCount』。 建立虛擬機之後,就無法更新此屬性。 容錯網域指派可以在虛擬機實例檢視中檢視。 最低 api-version:2020?12?01。

properties.priority

VirtualMachinePriorityTypes

指定虛擬機的優先順序。 最低 api-version:2019-03-01

properties.provisioningState

string

布建狀態,只會出現在回應中。

properties.proximityPlacementGroup

SubResource

指定虛擬機應指派給之鄰近放置群組的相關信息。 API 版本下限:2018-04-01。

properties.scheduledEventsPolicy

ScheduledEventsPolicy

指定虛擬機的重新部署、重新啟動和 ScheduledEventsAdditionalPublishingTargets Scheduled 事件相關組態。

properties.scheduledEventsProfile

ScheduledEventsProfile

指定排程的事件相關組態。

properties.securityProfile

SecurityProfile

指定虛擬機的安全性相關配置檔設定。

properties.storageProfile

StorageProfile

指定虛擬機器磁碟的儲存體設定。

properties.timeCreated

string

指定虛擬機資源建立的時間。 最低 api-version:2021-11-01。

properties.userData

string

VM 的 UserData,必須以 base-64 編碼。 客戶不應在此傳遞任何秘密。 最低 api-version:2021-03-01。

properties.virtualMachineScaleSet

SubResource

指定要指派虛擬機之虛擬機擴展集的相關信息。 相同虛擬機擴展集中指定的虛擬機會配置給不同的節點,以最大化可用性。 目前,VM 只能在建立時新增至虛擬機擴展集。 現有的 VM 無法新增至虛擬機擴展集。 這個屬性不能與非 Null properties.availabilitySet 參考一起存在。 最低 api-version:2019?03\01。

properties.vmId

string

指定 VM 唯一識別碼,這是編碼並儲存在所有 Azure IaaS VM SMBIOS 中的 128 位識別符,而且可以使用平臺 BIOS 命令來讀取。

resources

VirtualMachineExtension[]

虛擬機子擴充功能資源。

tags

object

資源標籤

type

string

資源類型

zones

string[]

虛擬機區域。

VirtualMachineAgentInstanceView

在虛擬機上執行的 VM 代理程式。

名稱 類型 Description
extensionHandlers

VirtualMachineExtensionHandlerInstanceView[]

虛擬機擴充處理程序實例檢視。

statuses

InstanceViewStatus[]

資源狀態資訊。

vmAgentVersion

string

VM 代理程式完整版本。

VirtualMachineEvictionPolicyTypes

指定 Azure Spot 虛擬機和 Azure Spot 擴展集的收回原則。 針對 Azure Spot 虛擬機,支援「解除分配」和「刪除」,而最低 API 版本為 2019-03-01。 針對 Azure Spot 擴展集,同時支援 'Deallocate' 和 'Delete',而最低 API 版本為 2017-10-30-preview。

名稱 類型 Description
Deallocate

string

Delete

string

VirtualMachineExtension

虛擬機子擴充功能資源。

名稱 類型 Description
id

string

資源標識碼

location

string

資源位置

name

string

資源名稱

properties.autoUpgradeMinorVersion

boolean

指出擴充功能是否應該在部署時間使用較新的次要版本。 不過,部署之後,除非重新部署延伸模組,否則延伸模組將不會升級次要版本,即使此屬性設定為 true 亦然。

properties.enableAutomaticUpgrade

boolean

指出如果有較新版本的擴充功能可用,平臺是否應該自動升級延伸模組。

properties.forceUpdateTag

string

延伸模組處理程式應該如何強制更新,即使延伸模組組態尚未變更也一樣。

properties.instanceView

VirtualMachineExtensionInstanceView

虛擬機擴充實例檢視。

properties.protectedSettings

object

此延伸模組可以包含 protectedSettings 或 protectedSettingsFromKeyVault 或完全沒有受保護的設定。

properties.protectedSettingsFromKeyVault

KeyVaultSecretReference

以傳址方式傳遞的延伸模組受保護設定,並從金鑰保存庫取用的擴充功能

properties.provisionAfterExtensions

string[]

延伸模組名稱的集合,之後必須布建此延伸模組。

properties.provisioningState

string

布建狀態,只會出現在回應中。

properties.publisher

string

擴充處理程序發行者的名稱。

properties.settings

object

擴充功能的 Json 格式化公用設定。

properties.suppressFailures

boolean

指出延伸模組的失敗是否會隱藏 (作業失敗,例如不會連線到 VM,而不論此值) 為何。 預設值為 false。

properties.type

string

指定延伸模組的類型;範例為 「CustomScriptExtension」。。

properties.typeHandlerVersion

string

指定文稿處理程式的版本。

tags

object

資源標籤

type

string

資源類型

VirtualMachineExtensionHandlerInstanceView

虛擬機擴充功能處理程序實例檢視。

名稱 類型 Description
status

InstanceViewStatus

擴充處理程序狀態。

type

string

指定延伸模組的類型;範例為 「CustomScriptExtension」。。

typeHandlerVersion

string

指定文稿處理程式的版本。

VirtualMachineExtensionInstanceView

虛擬機擴充實例檢視。

名稱 類型 Description
name

string

虛擬機擴充功能名稱。

statuses

InstanceViewStatus[]

資源狀態資訊。

substatuses

InstanceViewStatus[]

資源狀態資訊。

type

string

指定延伸模組的類型;例如“CustomScriptExtension”。

typeHandlerVersion

string

指定文稿處理程式的版本。

VirtualMachineHealthStatus

VM 的健康情況狀態。

名稱 類型 Description
status

InstanceViewStatus

VM 的健康情況狀態資訊。

VirtualMachineIdentity

如果已設定,則為虛擬機的身分識別。

名稱 類型 Description
principalId

string

虛擬機身分識別的主體標識碼。 此屬性只會針對系統指派的身分識別提供。

tenantId

string

與虛擬機相關聯的租用戶標識碼。 此屬性只會針對系統指派的身分識別提供。

type

ResourceIdentityType

用於虛擬機的身分識別類型。 「SystemAssigned、UserAssigned」類型同時包含隱含建立的身分識別,和一組使用者指派的身分識別。 類型 『None』 會從虛擬機中移除任何身分識別。

userAssignedIdentities

UserAssignedIdentities

與虛擬機相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。

VirtualMachineInstanceView

虛擬機實例檢視。

名稱 類型 Description
assignedHost

string

當虛擬機與已啟用自動放置的專用主機群組相關聯時,會透過自動放置配置虛擬機的專用主機資源標識符。 API 版本下限:2020-06-01。

bootDiagnostics

BootDiagnosticsInstanceView

開機診斷是一項偵錯功能,可讓您檢視控制台輸出和螢幕快照以診斷 VM 狀態。 您可以輕鬆地檢視主控台記錄檔的輸出。 Azure 也可讓您從 Hypervisor 查看 VM 的螢幕快照。

computerName

string

指派給虛擬機的計算機名稱。

disks

DiskInstanceView[]

虛擬機磁碟資訊。

extensions

VirtualMachineExtensionInstanceView[]

延伸模組資訊。

hyperVGeneration

HyperVGenerationType

指定與資源相關聯的 HyperVGeneration 類型

isVMInStandbyPool

boolean

[預覽功能]指定 VM 目前在待命集區中或不在待命集區中。

maintenanceRedeployStatus

MaintenanceRedeployStatus

虛擬機上的維護作業狀態。

osName

string

在虛擬機上執行的作業系統。

osVersion

string

在虛擬機上執行的作業系統版本。

patchStatus

VirtualMachinePatchStatus

[預覽功能]虛擬機修補作業的狀態。

platformFaultDomain

integer

指定虛擬機器的容錯網域。

platformUpdateDomain

integer

指定虛擬機器的更新網域。

rdpThumbPrint

string

遠端桌面憑證指紋。

statuses

InstanceViewStatus[]

資源狀態資訊。

vmAgent

VirtualMachineAgentInstanceView

在虛擬機上執行的 VM 代理程式。

vmHealth

VirtualMachineHealthStatus

VM 的健康情況狀態。

VirtualMachineIpTag

與公用IP位址相關聯的IP標籤清單。

名稱 類型 Description
ipTagType

string

IP 標籤類型。 範例:FirstPartyUsage。

tag

string

與公用IP相關聯的IP標籤。 範例:SQL、記憶體等。

VirtualMachineNetworkInterfaceConfiguration

指定將用來建立虛擬機網路資源的網路設定。

名稱 類型 Description
name

string

網路介面組態名稱。

properties.auxiliaryMode

NetworkInterfaceAuxiliaryMode

指定是否啟用網路介面資源的輔助模式。

properties.auxiliarySku

NetworkInterfaceAuxiliarySku

指定是否為網路介面資源啟用輔助 SKU。

properties.deleteOption

DeleteOptions

指定刪除 VM 時網路介面會發生什麼情況

properties.disableTcpStateTracking

boolean

指定是否停用網路介面以進行 tcp 狀態追蹤。

properties.dnsSettings

VirtualMachineNetworkInterfaceDnsSettingsConfiguration

要套用在網路介面上的 DNS 設定。

properties.dscpConfiguration

SubResource

properties.enableAcceleratedNetworking

boolean

指定網路介面是否已啟用加速網路。

properties.enableFpga

boolean

指定網路介面是否已啟用 FPGA 網路功能。

properties.enableIPForwarding

boolean

是否在此 NIC 上啟用 IP 轉送。

properties.ipConfigurations

VirtualMachineNetworkInterfaceIPConfiguration[]

指定網路介面的IP組態。

properties.networkSecurityGroup

SubResource

網路安全組。

properties.primary

boolean

指定虛擬機有1個以上的網路介面時的主要網路介面。

VirtualMachineNetworkInterfaceDnsSettingsConfiguration

要套用在網路介面上的 DNS 設定。

名稱 類型 Description
dnsServers

string[]

DNS 伺服器 IP 位址清單

VirtualMachineNetworkInterfaceIPConfiguration

指定網路介面的IP組態。

名稱 類型 Description
name

string

IP 組態名稱。

properties.applicationGatewayBackendAddressPools

SubResource[]

指定應用程式閘道後端位址池的參考數位。 虛擬機可以參考多個應用程式閘道的後端位址池。 多部虛擬機無法使用相同的應用程式閘道。

properties.applicationSecurityGroups

SubResource[]

指定應用程式安全組的參考陣列。

properties.loadBalancerBackendAddressPools

SubResource[]

指定負載平衡器後端位址池參考的陣列。 虛擬機可以參考一個公用和一個內部負載平衡器的後端位址池。 [多部虛擬機無法使用相同的基本 SKU 負載平衡器]。

properties.primary

boolean

指定虛擬機有1個以上的網路介面時的主要網路介面。

properties.privateIPAddressVersion

IPVersions

從 Api-Version 2017-03-30 起提供,它代表特定 ipconfiguration 是 IPv4 或 IPv6。 預設值會視為 IPv4。 可能的值為:'IPv4' 和 'IPv6'。

properties.publicIPAddressConfiguration

VirtualMachinePublicIPAddressConfiguration

publicIPAddressConfiguration。

properties.subnet

SubResource

指定子網的識別碼。

VirtualMachinePatchStatus

[預覽功能]虛擬機修補作業的狀態。

名稱 類型 Description
availablePatchSummary

AvailablePatchSummary

虛擬機最新評量作業的可用修補程式摘要。

configurationStatuses

InstanceViewStatus[]

指定 patchMode 的啟用狀態

lastPatchInstallationSummary

LastPatchInstallationSummary

虛擬機最新安裝作業的安裝摘要。

VirtualMachinePriorityTypes

指定虛擬機的優先順序。 最低 api-version:2019-03-01

名稱 類型 Description
Low

string

Regular

string

Spot

string

VirtualMachinePublicIPAddressConfiguration

publicIPAddressConfiguration。

名稱 類型 Description
name

string

publicIP 位址組態名稱。

properties.deleteOption

DeleteOptions

指定刪除 VM 時,公用 IP 位址會發生什麼情況

properties.dnsSettings

VirtualMachinePublicIPAddressDnsSettingsConfiguration

要套用至 publicIP 位址的 DNS 設定。

properties.idleTimeoutInMinutes

integer

公用IP位址的閒置逾時。

properties.ipTags

VirtualMachineIpTag[]

與公用IP位址相關聯的IP標籤清單。

properties.publicIPAddressVersion

IPVersions

從 Api-Version 2019-07-01 起提供,它代表特定 ipconfiguration 是 IPv4 或 IPv6。 預設值會視為 IPv4。 可能的值為:'IPv4' 和 'IPv6'。

properties.publicIPAllocationMethod

PublicIPAllocationMethod

指定公用IP配置類型

properties.publicIPPrefix

SubResource

要從中配置 publicIP 位址的 PublicIPPrefix。

sku

PublicIPAddressSku

描述公用IP Sku。 它只能使用 OrchestrationMode 設定為彈性。

VirtualMachinePublicIPAddressDnsSettingsConfiguration

要套用在 publicIP 位址 上的 DNS 設定。

名稱 類型 Description
domainNameLabel

string

即將建立之 PublicIPAddress 資源的功能變數名稱標籤前置詞。 產生的名稱標籤是功能變數名稱標籤和 vm 網路設定檔唯一識別碼的串連。

domainNameLabelScope

DomainNameLabelScopeTypes

即將建立之 PublicIPAddress 資源的功能變數名稱標籤範圍。 產生的名稱標籤是根據功能變數名稱標籤範圍和 vm 網路配置檔唯一識別碼,與原則串連哈希功能變數名稱標籤。

VirtualMachineSizeTypes

指定虛擬機器的大小。 列舉數據類型目前已被取代,將於 2023 年 12 月 23 日移除。 取得可用大小清單的建議方式是使用這些 API: 列出可用性設定組中的所有可用虛擬機器大小列出區域中所有可用的虛擬機大小列出所有可用的虛擬機大小以重設大小。 如需虛擬機大小的詳細資訊,請參閱 虛擬機的大小。 可用的 VM 大小取決於區域和可用性設定組。

名稱 類型 Description
Basic_A0

string

Basic_A1

string

Basic_A2

string

Basic_A3

string

Basic_A4

string

Standard_A0

string

Standard_A1

string

Standard_A10

string

Standard_A11

string

Standard_A1_v2

string

Standard_A2

string

Standard_A2_v2

string

Standard_A2m_v2

string

Standard_A3

string

Standard_A4

string

Standard_A4_v2

string

Standard_A4m_v2

string

Standard_A5

string

Standard_A6

string

Standard_A7

string

Standard_A8

string

Standard_A8_v2

string

Standard_A8m_v2

string

Standard_A9

string

Standard_B1ms

string

Standard_B1s

string

Standard_B2ms

string

Standard_B2s

string

Standard_B4ms

string

Standard_B8ms

string

Standard_D1

string

Standard_D11

string

Standard_D11_v2

string

Standard_D12

string

Standard_D12_v2

string

Standard_D13

string

Standard_D13_v2

string

Standard_D14

string

Standard_D14_v2

string

Standard_D15_v2

string

Standard_D16_v3

string

Standard_D16s_v3

string

Standard_D1_v2

string

Standard_D2

string

Standard_D2_v2

string

Standard_D2_v3

string

Standard_D2s_v3

string

Standard_D3

string

Standard_D32_v3

string

Standard_D32s_v3

string

Standard_D3_v2

string

Standard_D4

string

Standard_D4_v2

string

Standard_D4_v3

string

Standard_D4s_v3

string

Standard_D5_v2

string

Standard_D64_v3

string

Standard_D64s_v3

string

Standard_D8_v3

string

Standard_D8s_v3

string

Standard_DS1

string

Standard_DS11

string

Standard_DS11_v2

string

Standard_DS12

string

Standard_DS12_v2

string

Standard_DS13

string

Standard_DS13-2_v2

string

Standard_DS13-4_v2

string

Standard_DS13_v2

string

Standard_DS14

string

Standard_DS14-4_v2

string

Standard_DS14-8_v2

string

Standard_DS14_v2

string

Standard_DS15_v2

string

Standard_DS1_v2

string

Standard_DS2

string

Standard_DS2_v2

string

Standard_DS3

string

Standard_DS3_v2

string

Standard_DS4

string

Standard_DS4_v2

string

Standard_DS5_v2

string

Standard_E16_v3

string

Standard_E16s_v3

string

Standard_E2_v3

string

Standard_E2s_v3

string

Standard_E32-16_v3

string

Standard_E32-8s_v3

string

Standard_E32_v3

string

Standard_E32s_v3

string

Standard_E4_v3

string

Standard_E4s_v3

string

Standard_E64-16s_v3

string

Standard_E64-32s_v3

string

Standard_E64_v3

string

Standard_E64s_v3

string

Standard_E8_v3

string

Standard_E8s_v3

string

Standard_F1

string

Standard_F16

string

Standard_F16s

string

Standard_F16s_v2

string

Standard_F1s

string

Standard_F2

string

Standard_F2s

string

Standard_F2s_v2

string

Standard_F32s_v2

string

Standard_F4

string

Standard_F4s

string

Standard_F4s_v2

string

Standard_F64s_v2

string

Standard_F72s_v2

string

Standard_F8

string

Standard_F8s

string

Standard_F8s_v2

string

Standard_G1

string

Standard_G2

string

Standard_G3

string

Standard_G4

string

Standard_G5

string

Standard_GS1

string

Standard_GS2

string

Standard_GS3

string

Standard_GS4

string

Standard_GS4-4

string

Standard_GS4-8

string

Standard_GS5

string

Standard_GS5-16

string

Standard_GS5-8

string

Standard_H16

string

Standard_H16m

string

Standard_H16mr

string

Standard_H16r

string

Standard_H8

string

Standard_H8m

string

Standard_L16s

string

Standard_L32s

string

Standard_L4s

string

Standard_L8s

string

Standard_M128-32ms

string

Standard_M128-64ms

string

Standard_M128ms

string

Standard_M128s

string

Standard_M64-16ms

string

Standard_M64-32ms

string

Standard_M64ms

string

Standard_M64s

string

Standard_NC12

string

Standard_NC12s_v2

string

Standard_NC12s_v3

string

Standard_NC24

string

Standard_NC24r

string

Standard_NC24rs_v2

string

Standard_NC24rs_v3

string

Standard_NC24s_v2

string

Standard_NC24s_v3

string

Standard_NC6

string

Standard_NC6s_v2

string

Standard_NC6s_v3

string

Standard_ND12s

string

Standard_ND24rs

string

Standard_ND24s

string

Standard_ND6s

string

Standard_NV12

string

Standard_NV24

string

Standard_NV6

string

VMDiskSecurityProfile

指定受控磁碟的安全性配置檔。

名稱 類型 Description
diskEncryptionSet

DiskEncryptionSetParameters

針對客戶受控密鑰加密的機密VM OS 磁碟和 VMGuest Blob,指定受控磁碟的客戶受控磁碟加密集資源識別碼。

securityEncryptionType

securityEncryptionTypes

指定受控磁碟的 EncryptionType。 它設定為 DiskWithVMGuestState 以加密受控磁碟以及 VMGuestState Blob、VMGuestStateOnly 只加密 VMGuestState Blob,以及 NonPersistedTPM 用於不保存 VMGuestState Blob 中的韌體狀態。 注意: 它只能設定為機密 VM。

VMGalleryApplication

指定應該提供給 VM/VMSS 使用的資源庫應用程式

名稱 類型 Description
configurationReference

string

選擇性,指定 Azure Blob 的 URI,以在提供時取代套件的預設組態

enableAutomaticUpgrade

boolean

如果設定為 true,當 PIR/SIG 中有新的資源庫應用程式版本可用時,VM/VMSS 會自動更新

order

integer

選擇性,指定必須安裝套件的順序

packageReferenceId

string

指定 /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/providers/Microsoft.Compute/gallerys/{galleryName}/applications/{application}/versions/{version} 形式的 GalleryApplicationVersion 資源標識符

tags

string

選擇性,指定更多泛型內容的傳遞值。

treatFailureAsDeploymentFailure

boolean

選擇性,如果為 true,VmApplication 中任何作業的任何失敗都會使部署失敗

VMSizeProperties

指定自定義虛擬機大小的屬性。 API 版本下限:2021-07-01。 此功能仍處於預覽模式,且 VirtualMachineScaleSet 不支援此功能。 如需詳細資訊,請遵循 VM 自定義 中的指示。

名稱 類型 Description
vCPUsAvailable

integer

指定 VM 可用的 vCPU 數目。 在要求本文中未指定這個屬性時,預設行為是將它設定為 API 回應中公開該 VM 大小的 vCPU 值, 以列出區域中所有可用的虛擬機大小

vCPUsPerCore

integer

指定 vCPU 與實體核心比率。 在要求本文中未指定這個屬性時,預設行為會針對在 API 回應中公開的 VM 大小設定為 vCPUPerCore 的值,以 列出區域中所有可用的虛擬機大小將此屬性設定為 1 也表示超線程已停用。

WindowsConfiguration

指定虛擬機器上的 Windows 作業系統設定。

名稱 類型 Description
additionalUnattendContent

AdditionalUnattendContent[]

指定可併入 Unattend.xml 檔案 (由 Windows 安裝程式使用) 的額外 Base-64 編碼 XML 格式資訊。

enableAutomaticUpdates

boolean

指出是否為 Windows 虛擬機啟用自動 匯報。 預設值為 true。 對於虛擬機擴展集,此屬性可以更新,更新將會在OS重新佈建上生效。

enableVMAgentPlatformUpdates

boolean

指出是否為 Windows 虛擬機啟用 VMAgent Platform 匯報。 預設值為 False。

patchSettings

PatchSettings

[預覽功能]指定與 Windows 上的 VM 客體修補相關的設定。

provisionVMAgent

boolean

指出是否應該在虛擬機器上佈建虛擬機器代理程式。 當要求本文中未指定這個屬性時,預設會將其設定為 true。 這可確保 VM 代理程式已安裝在 VM 上,以便稍後將擴充功能新增至 VM。

timeZone

string

指定虛擬機的時區。 例如“Pacific Standard Time”。 可能的值可以從 TimeZoneInfo.GetSystemTimeZones 傳回的時區 TimeZoneInfo.Id 值。

winRM

WinRMConfiguration

指定 Windows 遠端管理接聽程式。 藉此將啟用遠端 Windows PowerShell。

WindowsPatchAssessmentMode

指定 IaaS 虛擬機的 VM 客體修補評估模式。

可能的值包括:

ImageDefault - 您可以在虛擬機上控制修補程式評估的時間。

AutomaticByPlatform - 平臺會觸發定期修補評估。 屬性 provisionVMAgent 必須是 true。

名稱 類型 Description
AutomaticByPlatform

string

ImageDefault

string

WindowsVMGuestPatchAutomaticByPlatformRebootSetting

指定所有 AutomaticByPlatform 修補程式安裝作業的重新啟動設定。

名稱 類型 Description
Always

string

IfRequired

string

Never

string

Unknown

string

WindowsVMGuestPatchAutomaticByPlatformSettings

指定 Windows 上 VM 客體修補中的 Patch 模式 AutomaticByPlatform 的其他設定。

名稱 類型 Description
bypassPlatformSafetyChecksOnUserSchedule

boolean

讓客戶排程修補而不意外升級

rebootSetting

WindowsVMGuestPatchAutomaticByPlatformRebootSetting

指定所有 AutomaticByPlatform 修補程式安裝作業的重新啟動設定。

WindowsVMGuestPatchMode

指定 VM 客體修補至 IaaS 虛擬機的模式,或與 OrchestraMode 為彈性的虛擬機擴展集相關聯的虛擬機。

可能的值包括:

手動 - 您可以控制將修補程式應用程式套用至虛擬機。 您可以在 VM 內手動套用修補程式來執行此動作。 在此模式中,自動更新會停用;屬性 WindowsConfiguration.enableAutomaticUpdates 必須為 false

AutomaticByOS - 作業系統會自動更新虛擬機。 WindowsConfiguration.enableAutomaticUpdates 屬性必須是 true。

AutomaticByPlatform - 虛擬機將會由平台自動更新。 provisionVMAgent 和 WindowsConfiguration.enableAutomaticUpdates 屬性必須是 true

名稱 類型 Description
AutomaticByOS

string

AutomaticByPlatform

string

Manual

string

WinRMConfiguration

指定 Windows 遠端管理接聽程式。 藉此將啟用遠端 Windows PowerShell。

名稱 類型 Description
listeners

WinRMListener[]

Windows 遠端管理接聽程式清單

WinRMListener

Windows 遠端管理接聽程式清單

名稱 類型 Description
certificateUrl

string

這是已上傳至 金鑰保存庫 做為秘密的憑證 URL。 如需將秘密新增至 金鑰保存庫,請參閱將密鑰或秘密新增至密鑰保存庫。 在此情況下,您的憑證必須是以UTF-8編碼的下列 JSON 物件的Base64編碼:

{
“data”:“”,
“dataType”:“pfx”,
“password”:“”
}
若要在虛擬機上安裝憑證,建議您使用適用於Linux的 Azure 金鑰保存庫 虛擬機擴充功能適用於 Windows 的 Azure 金鑰保存庫 虛擬機擴充功能

protocol

ProtocolTypes

指定 WinRM 接聽程式的通訊協定。 可能的值為: HTTP、https。