共用方式為


Microsoft.Compute images 2023-09-01

Bicep 資源定義

映射資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔

資源格式

若要建立 Microsoft.Compute/images 資源,請將下列 Bicep 新增至範本。

resource symbolicname 'Microsoft.Compute/images@2023-09-01' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  extendedLocation: {
    name: 'string'
    type: 'EdgeZone'
  }
  properties: {
    hyperVGeneration: 'string'
    sourceVirtualMachine: {
      id: 'string'
    }
    storageProfile: {
      dataDisks: [
        {
          blobUri: 'string'
          caching: 'string'
          diskEncryptionSet: {
            id: 'string'
          }
          diskSizeGB: int
          lun: int
          managedDisk: {
            id: 'string'
          }
          snapshot: {
            id: 'string'
          }
          storageAccountType: 'string'
        }
      ]
      osDisk: {
        blobUri: 'string'
        caching: 'string'
        diskEncryptionSet: {
          id: 'string'
        }
        diskSizeGB: int
        managedDisk: {
          id: 'string'
        }
        osState: 'string'
        osType: 'string'
        snapshot: {
          id: 'string'
        }
        storageAccountType: 'string'
      }
      zoneResilient: bool
    }
  }
}

屬性值

圖像

名字 描述 價值
名字 資源名稱 字串 (必要)

字元限制:1-80

合法字元:
英數位元、底線、句號和連字元。

從英數位元開始。 以英數位元或底線結尾。
位置 資源位置 字串 (必要)
標籤 資源標籤 標記名稱和值的字典。 請參閱範本中的 標籤
extendedLocation Image 的擴充位置。 ExtendedLocation
性能 描述 Image 的屬性。 ImageProperties

ExtendedLocation

名字 描述 價值
名字 擴充位置的名稱。 字串
類型 擴充位置的類型。 'EdgeZone'

ImageProperties

名字 描述 價值
hyperVGeneration 指定從映像建立之 VirtualMachine 的 HyperVGenerationType。 如果映射來源是 Blob,則從 API 版本 2019-03-01,然後我們需要使用者指定值,如果來源是磁碟或快照集等受控資源,我們可能會要求使用者指定 屬性,如果我們無法從來源受控資源推斷它。 'V1'
'V2'
sourceVirtualMachine 建立映像的來源虛擬機。 SubResource
storageProfile 指定虛擬機磁碟的記憶體設定。 ImageStorageProfile

SubResource

名字 描述 價值
id 資源標識碼 字串

ImageStorageProfile

名字 描述 價值
dataDisks 指定用來將數據磁碟新增至虛擬機的參數。

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

如需磁碟的詳細資訊,請參閱 關於 Azure 虛擬機器的磁碟和 VHD
ImageOSDisk
zoneResilient 指定映像是否具有區域復原性。 默認值為 false。 區域復原映像只能在提供區域備援記憶體 (ZRS) 的區域建立。 bool

ImageDataDisk

名字 描述 價值
blobUri 虛擬硬碟。 字串
緩存 指定快取需求。 可能的值為:None、ReadOnly、ReadWrite。 預設值為:標準記憶體的 None。進階記憶體的 ReadOnly。 'None'
'ReadOnly'
'ReadWrite'
diskEncryptionSet 指定受控映像磁碟的客戶受控磁碟加密集資源標識碼。 DiskEncryptionSetParameters
diskSizeGB 指定以 GB 為單位的空白資料磁碟大小。 這個元素可用來覆寫虛擬機映像中的磁碟名稱。 此值不能大於 1023 GB。 int
指定數據磁碟的邏輯單元編號。 這個值是用來識別 VM 內的數據磁碟,因此對於連結至 VM 的每個數據磁碟而言都必須是唯一的。 int (必要)
managedDisk managedDisk。 SubResource
快照 快照集。 SubResource
storageAccountType 指定受控磁碟的記憶體帳戶類型。 注意:UltraSSD_LRS只能與數據磁碟搭配使用,因此無法與OS磁碟搭配使用。 'PremiumV2_LRS'
'Premium_LRS'
'Premium_ZRS'
'StandardSSD_LRS'
'StandardSSD_ZRS'
'Standard_LRS'
'UltraSSD_LRS'

DiskEncryptionSetParameters

名字 描述 價值
id 資源標識碼 字串

ImageOSDisk

名字 描述 價值
blobUri 虛擬硬碟。 字串
緩存 指定快取需求。 可能的值為:None、ReadOnly、ReadWrite。 預設值為:標準記憶體的 None。進階記憶體的 ReadOnly。 'None'
'ReadOnly'
'ReadWrite'
diskEncryptionSet 指定受控映像磁碟的客戶受控磁碟加密集資源標識碼。 DiskEncryptionSetParameters
diskSizeGB 指定以 GB 為單位的空白資料磁碟大小。 這個元素可用來覆寫虛擬機映像中的磁碟名稱。 此值不能大於 1023 GB。 int
managedDisk managedDisk。 SubResource
osState OS 狀態。 針對受控映像,請使用一般化。 'Generalized'
'特製化' (必要)
osType 此屬性可讓您指定從自定義映像建立 VM 時包含在磁碟上的 OS 類型。 可能的值為:Windows、Linux。 'Linux'
'Windows' (必要)
快照 快照集。 SubResource
storageAccountType 指定受控磁碟的記憶體帳戶類型。 注意:UltraSSD_LRS只能與數據磁碟搭配使用,因此無法與OS磁碟搭配使用。 'PremiumV2_LRS'
'Premium_LRS'
'Premium_ZRS'
'StandardSSD_LRS'
'StandardSSD_ZRS'
'Standard_LRS'
'UltraSSD_LRS'

快速入門範本

下列快速入門範本會部署此資源類型。

範本 描述
從使用者映像建立 VM

部署至 Azure
此範本可讓您從使用者映像建立虛擬機。 此範本也會部署虛擬網路、公用IP位址和網路介面。
從一般化 VHD 在新的或現有的 vnet 中建立 VM

部署至 Azure
此範本會從一般化 VHD 建立 VM,並讓您將其連線到新的或現有的 VNET,該 VNET 可以位於虛擬機以外的另一個資源群組中
使用Linux自定義映像部署 VM 擴展集

部署至 Azure
此範本可讓您在擴展集內部署自訂 VM Linux 映像。 這些 VM 位於具有 HTTP 負載平衡的負載平衡器後方(根據預設在埠 80 上)。 此範例會使用自定義腳本來執行應用程式部署和更新,您可能必須為自己的更新程式提供自定義腳本。 您必須在建立 VMSS 的相同訂用帳戶和區域中,提供 VM 的一般化映像。
使用 Windows 自定義映像部署 VM 擴展集

部署至 Azure
此範本可讓您部署簡單的 VM 擴展集,以使用自訂 Windows 映像。 這些 VM 位於具有 HTTP 負載平衡的負載平衡器後方(根據預設埠 80)

ARM 樣本資源定義

映射資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔

資源格式

若要建立 Microsoft.Compute/images 資源,請將下列 JSON 新增至範本。

{
  "type": "Microsoft.Compute/images",
  "apiVersion": "2023-09-01",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "extendedLocation": {
    "name": "string",
    "type": "EdgeZone"
  },
  "properties": {
    "hyperVGeneration": "string",
    "sourceVirtualMachine": {
      "id": "string"
    },
    "storageProfile": {
      "dataDisks": [
        {
          "blobUri": "string",
          "caching": "string",
          "diskEncryptionSet": {
            "id": "string"
          },
          "diskSizeGB": "int",
          "lun": "int",
          "managedDisk": {
            "id": "string"
          },
          "snapshot": {
            "id": "string"
          },
          "storageAccountType": "string"
        }
      ],
      "osDisk": {
        "blobUri": "string",
        "caching": "string",
        "diskEncryptionSet": {
          "id": "string"
        },
        "diskSizeGB": "int",
        "managedDisk": {
          "id": "string"
        },
        "osState": "string",
        "osType": "string",
        "snapshot": {
          "id": "string"
        },
        "storageAccountType": "string"
      },
      "zoneResilient": "bool"
    }
  }
}

屬性值

圖像

名字 描述 價值
類型 資源類型 'Microsoft.Compute/images'
apiVersion 資源 API 版本 '2023-09-01'
名字 資源名稱 字串 (必要)

字元限制:1-80

合法字元:
英數位元、底線、句號和連字元。

從英數位元開始。 以英數位元或底線結尾。
位置 資源位置 字串 (必要)
標籤 資源標籤 標記名稱和值的字典。 請參閱範本中的 標籤
extendedLocation Image 的擴充位置。 ExtendedLocation
性能 描述 Image 的屬性。 ImageProperties

ExtendedLocation

名字 描述 價值
名字 擴充位置的名稱。 字串
類型 擴充位置的類型。 'EdgeZone'

ImageProperties

名字 描述 價值
hyperVGeneration 指定從映像建立之 VirtualMachine 的 HyperVGenerationType。 如果映射來源是 Blob,則從 API 版本 2019-03-01,然後我們需要使用者指定值,如果來源是磁碟或快照集等受控資源,我們可能會要求使用者指定 屬性,如果我們無法從來源受控資源推斷它。 'V1'
'V2'
sourceVirtualMachine 建立映像的來源虛擬機。 SubResource
storageProfile 指定虛擬機磁碟的記憶體設定。 ImageStorageProfile

SubResource

名字 描述 價值
id 資源標識碼 字串

ImageStorageProfile

名字 描述 價值
dataDisks 指定用來將數據磁碟新增至虛擬機的參數。

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

如需磁碟的詳細資訊,請參閱 關於 Azure 虛擬機器的磁碟和 VHD
ImageOSDisk
zoneResilient 指定映像是否具有區域復原性。 默認值為 false。 區域復原映像只能在提供區域備援記憶體 (ZRS) 的區域建立。 bool

ImageDataDisk

名字 描述 價值
blobUri 虛擬硬碟。 字串
緩存 指定快取需求。 可能的值為:None、ReadOnly、ReadWrite。 預設值為:標準記憶體的 None。進階記憶體的 ReadOnly。 'None'
'ReadOnly'
'ReadWrite'
diskEncryptionSet 指定受控映像磁碟的客戶受控磁碟加密集資源標識碼。 DiskEncryptionSetParameters
diskSizeGB 指定以 GB 為單位的空白資料磁碟大小。 這個元素可用來覆寫虛擬機映像中的磁碟名稱。 此值不能大於 1023 GB。 int
指定數據磁碟的邏輯單元編號。 這個值是用來識別 VM 內的數據磁碟,因此對於連結至 VM 的每個數據磁碟而言都必須是唯一的。 int (必要)
managedDisk managedDisk。 SubResource
快照 快照集。 SubResource
storageAccountType 指定受控磁碟的記憶體帳戶類型。 注意:UltraSSD_LRS只能與數據磁碟搭配使用,因此無法與OS磁碟搭配使用。 'PremiumV2_LRS'
'Premium_LRS'
'Premium_ZRS'
'StandardSSD_LRS'
'StandardSSD_ZRS'
'Standard_LRS'
'UltraSSD_LRS'

DiskEncryptionSetParameters

名字 描述 價值
id 資源標識碼 字串

ImageOSDisk

名字 描述 價值
blobUri 虛擬硬碟。 字串
緩存 指定快取需求。 可能的值為:None、ReadOnly、ReadWrite。 預設值為:標準記憶體的 None。進階記憶體的 ReadOnly。 'None'
'ReadOnly'
'ReadWrite'
diskEncryptionSet 指定受控映像磁碟的客戶受控磁碟加密集資源標識碼。 DiskEncryptionSetParameters
diskSizeGB 指定以 GB 為單位的空白資料磁碟大小。 這個元素可用來覆寫虛擬機映像中的磁碟名稱。 此值不能大於 1023 GB。 int
managedDisk managedDisk。 SubResource
osState OS 狀態。 針對受控映像,請使用一般化。 'Generalized'
'特製化' (必要)
osType 此屬性可讓您指定從自定義映像建立 VM 時包含在磁碟上的 OS 類型。 可能的值為:Windows、Linux。 'Linux'
'Windows' (必要)
快照 快照集。 SubResource
storageAccountType 指定受控磁碟的記憶體帳戶類型。 注意:UltraSSD_LRS只能與數據磁碟搭配使用,因此無法與OS磁碟搭配使用。 'PremiumV2_LRS'
'Premium_LRS'
'Premium_ZRS'
'StandardSSD_LRS'
'StandardSSD_ZRS'
'Standard_LRS'
'UltraSSD_LRS'

快速入門範本

下列快速入門範本會部署此資源類型。

範本 描述
從使用者映像建立 VM

部署至 Azure
此範本可讓您從使用者映像建立虛擬機。 此範本也會部署虛擬網路、公用IP位址和網路介面。
從一般化 VHD 在新的或現有的 vnet 中建立 VM

部署至 Azure
此範本會從一般化 VHD 建立 VM,並讓您將其連線到新的或現有的 VNET,該 VNET 可以位於虛擬機以外的另一個資源群組中
使用Linux自定義映像部署 VM 擴展集

部署至 Azure
此範本可讓您在擴展集內部署自訂 VM Linux 映像。 這些 VM 位於具有 HTTP 負載平衡的負載平衡器後方(根據預設在埠 80 上)。 此範例會使用自定義腳本來執行應用程式部署和更新,您可能必須為自己的更新程式提供自定義腳本。 您必須在建立 VMSS 的相同訂用帳戶和區域中,提供 VM 的一般化映像。
使用 Windows 自定義映像部署 VM 擴展集

部署至 Azure
此範本可讓您部署簡單的 VM 擴展集,以使用自訂 Windows 映像。 這些 VM 位於具有 HTTP 負載平衡的負載平衡器後方(根據預設埠 80)

Terraform (AzAPI 提供者) 資源定義

映射資源類型可以使用目標作業來部署:

  • 資源群組

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔

資源格式

若要建立 Microsoft.Compute/images 資源,請將下列 Terraform 新增至範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Compute/images@2023-09-01"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  body = jsonencode({
    properties = {
      hyperVGeneration = "string"
      sourceVirtualMachine = {
        id = "string"
      }
      storageProfile = {
        dataDisks = [
          {
            blobUri = "string"
            caching = "string"
            diskEncryptionSet = {
              id = "string"
            }
            diskSizeGB = int
            lun = int
            managedDisk = {
              id = "string"
            }
            snapshot = {
              id = "string"
            }
            storageAccountType = "string"
          }
        ]
        osDisk = {
          blobUri = "string"
          caching = "string"
          diskEncryptionSet = {
            id = "string"
          }
          diskSizeGB = int
          managedDisk = {
            id = "string"
          }
          osState = "string"
          osType = "string"
          snapshot = {
            id = "string"
          }
          storageAccountType = "string"
        }
        zoneResilient = bool
      }
    }
    extendedLocation = {
      name = "string"
      type = "EdgeZone"
    }
  })
}

屬性值

圖像

名字 描述 價值
類型 資源類型 “Microsoft.Compute/images@2023-09-01”
名字 資源名稱 字串 (必要)

字元限制:1-80

合法字元:
英數位元、底線、句號和連字元。

從英數位元開始。 以英數位元或底線結尾。
位置 資源位置 字串 (必要)
parent_id 若要部署至資源群組,請使用該資源群組的標識碼。 字串 (必要)
標籤 資源標籤 標記名稱和值的字典。
extendedLocation Image 的擴充位置。 ExtendedLocation
性能 描述 Image 的屬性。 ImageProperties

ExtendedLocation

名字 描述 價值
名字 擴充位置的名稱。 字串
類型 擴充位置的類型。 “EdgeZone”

ImageProperties

名字 描述 價值
hyperVGeneration 指定從映像建立之 VirtualMachine 的 HyperVGenerationType。 如果映射來源是 Blob,則從 API 版本 2019-03-01,然後我們需要使用者指定值,如果來源是磁碟或快照集等受控資源,我們可能會要求使用者指定 屬性,如果我們無法從來源受控資源推斷它。 “V1”
“V2”
sourceVirtualMachine 建立映像的來源虛擬機。 SubResource
storageProfile 指定虛擬機磁碟的記憶體設定。 ImageStorageProfile

SubResource

名字 描述 價值
id 資源標識碼 字串

ImageStorageProfile

名字 描述 價值
dataDisks 指定用來將數據磁碟新增至虛擬機的參數。

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

如需磁碟的詳細資訊,請參閱 關於 Azure 虛擬機器的磁碟和 VHD
ImageOSDisk
zoneResilient 指定映像是否具有區域復原性。 默認值為 false。 區域復原映像只能在提供區域備援記憶體 (ZRS) 的區域建立。 bool

ImageDataDisk

名字 描述 價值
blobUri 虛擬硬碟。 字串
緩存 指定快取需求。 可能的值為:None、ReadOnly、ReadWrite。 預設值為:標準記憶體的 None。進階記憶體的 ReadOnly。 “None”
“ReadOnly”
“ReadWrite”
diskEncryptionSet 指定受控映像磁碟的客戶受控磁碟加密集資源標識碼。 DiskEncryptionSetParameters
diskSizeGB 指定以 GB 為單位的空白資料磁碟大小。 這個元素可用來覆寫虛擬機映像中的磁碟名稱。 此值不能大於 1023 GB。 int
指定數據磁碟的邏輯單元編號。 這個值是用來識別 VM 內的數據磁碟,因此對於連結至 VM 的每個數據磁碟而言都必須是唯一的。 int (必要)
managedDisk managedDisk。 SubResource
快照 快照集。 SubResource
storageAccountType 指定受控磁碟的記憶體帳戶類型。 注意:UltraSSD_LRS只能與數據磁碟搭配使用,因此無法與OS磁碟搭配使用。 “PremiumV2_LRS”
“Premium_LRS”
“Premium_ZRS”
“StandardSSD_LRS”
“StandardSSD_ZRS”
“Standard_LRS”
“UltraSSD_LRS”

DiskEncryptionSetParameters

名字 描述 價值
id 資源標識碼 字串

ImageOSDisk

名字 描述 價值
blobUri 虛擬硬碟。 字串
緩存 指定快取需求。 可能的值為:None、ReadOnly、ReadWrite。 預設值為:標準記憶體的 None。進階記憶體的 ReadOnly。 “None”
“ReadOnly”
“ReadWrite”
diskEncryptionSet 指定受控映像磁碟的客戶受控磁碟加密集資源標識碼。 DiskEncryptionSetParameters
diskSizeGB 指定以 GB 為單位的空白資料磁碟大小。 這個元素可用來覆寫虛擬機映像中的磁碟名稱。 此值不能大於 1023 GB。 int
managedDisk managedDisk。 SubResource
osState OS 狀態。 針對受控映像,請使用一般化。 “一般化”
“特製化”(必要)
osType 此屬性可讓您指定從自定義映像建立 VM 時包含在磁碟上的 OS 類型。 可能的值為:Windows、Linux。 “Linux”
“Windows” (必要)
快照 快照集。 SubResource
storageAccountType 指定受控磁碟的記憶體帳戶類型。 注意:UltraSSD_LRS只能與數據磁碟搭配使用,因此無法與OS磁碟搭配使用。 “PremiumV2_LRS”
“Premium_LRS”
“Premium_ZRS”
“StandardSSD_LRS”
“StandardSSD_ZRS”
“Standard_LRS”
“UltraSSD_LRS”