你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Microsoft.Compute gallerys/images/versions 2021-10-01

Bicep 资源定义

库/映像/版本资源类型可以通过针对以下操作进行部署:

有关每个 API 版本中更改的属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Compute/gallerys/images/versions 资源,请将以下 Bicep 添加到模板。

resource symbolicname 'Microsoft.Compute/galleries/images/versions@2021-10-01' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  parent: resourceSymbolicName
  properties: {
    publishingProfile: {
      endOfLifeDate: 'string'
      excludeFromLatest: bool
      replicaCount: int
      replicationMode: 'string'
      storageAccountType: 'string'
      targetExtendedLocations: [
        {
          encryption: {
            dataDiskImages: [
              {
                diskEncryptionSetId: 'string'
                lun: int
              }
            ]
            osDiskImage: {
              diskEncryptionSetId: 'string'
              securityProfile: {
                confidentialVMEncryptionType: 'string'
                secureVMDiskEncryptionSetId: 'string'
              }
            }
          }
          extendedLocation: {
            name: 'string'
            type: 'string'
          }
          extendedLocationReplicaCount: int
          name: 'string'
          storageAccountType: 'string'
        }
      ]
      targetRegions: [
        {
          encryption: {
            dataDiskImages: [
              {
                diskEncryptionSetId: 'string'
                lun: int
              }
            ]
            osDiskImage: {
              diskEncryptionSetId: 'string'
              securityProfile: {
                confidentialVMEncryptionType: 'string'
                secureVMDiskEncryptionSetId: 'string'
              }
            }
          }
          name: 'string'
          regionalReplicaCount: int
          storageAccountType: 'string'
        }
      ]
    }
    storageProfile: {
      dataDiskImages: [
        {
          hostCaching: 'string'
          lun: int
          source: {
            id: 'string'
            uri: 'string'
          }
        }
      ]
      osDiskImage: {
        hostCaching: 'string'
        source: {
          id: 'string'
          uri: 'string'
        }
      }
      source: {
        id: 'string'
        uri: 'string'
      }
    }
  }
}

属性值

galleries/images/versions

名称 说明
name 资源名称

了解如何在 Bicep 中为子资源设置名称和类型。
字符串 (必需)

字符限制:32 位整数

有效字符:
数字和句点。
(每段都转换为 int32。因此,每段的最大值为 2,147,483,647。)
location 资源位置 字符串 (必需)
标记 资源标记 标记名称和值的字典。 请参阅 模板中的标记
父级 (parent) 在 Bicep 中,可以为子资源指定父资源。 仅当子资源在父资源外部声明时,才需要添加此属性。

有关详细信息,请参阅 父资源之外的子资源
类型为资源的符号名称: 图像
properties 描述库映像版本的属性。 GalleryImageVersionProperties

GalleryImageVersionProperties

名称 说明
publishingProfile 库映像版本的发布配置文件。 GalleryImageVersionPublishingProfile
storageProfile 这是库映像版本的存储配置文件。 需要 GalleryImageVersionStorageProfile ()

GalleryImageVersionPublishingProfile

名称 说明
endOfLifeDate 库映像版本的生命周期结束日期。 此属性可用于解除授权。 此属性可更新。 字符串
excludeFromLatest 如果设置为 true,则从最新版本的映像定义部署虚拟机将不使用此映像版本。 bool
replicaCount 每个区域要创建的映像版本的副本数。 如果未指定 regionReplicaCount,此属性将对区域生效。 此属性可更新。 int
replicationMode 可选参数,用于指定要用于复制的模式。 此属性不可更新。 'Full'
“浅层”
storageAccountType 指定要用于存储映像的存储帐户类型。 此属性不可更新。 “Premium_LRS”
“StandardSSD_LRS”
“Standard_LRS”
“Standard_ZRS”
targetExtendedLocations 映像版本要复制到的目标扩展位置。 此属性可更新。 GalleryTargetExtendedLocation[]
targetRegions 映像版本要复制到的目标区域。 此属性可更新。 TargetRegion[]

GalleryTargetExtendedLocation

名称 说明
加密 可选。 允许用户提供客户托管密钥来加密库项目中的 OS 和数据磁盘。 EncryptionImages
extendedLocation 扩展位置的名称。 GalleryExtendedLocation
extendedLocationReplicaCount 每个扩展位置要创建的映像版本的副本数。 此属性可更新。 int
name 区域的名称。 字符串
storageAccountType 指定要用于存储映像的存储帐户类型。 此属性不可更新。 “Premium_LRS”
“StandardSSD_LRS”
“Standard_LRS”
“Standard_ZRS”

EncryptionImages

名称 说明
dataDiskImages 数据磁盘映像的加密规范列表。 DataDiskImageEncryption[]
osDiskImage 包含 OS 磁盘映像的加密设置。 OSDiskImageEncryption

DataDiskImageEncryption

名称 说明
diskEncryptionSetId 包含磁盘加密集的资源 ID 的相对 URI。 字符串
lun 此属性指定数据磁盘的逻辑单元号。 此值用于标识虚拟机中的数据磁盘,因此对于附加到虚拟机的每个数据磁盘必须是唯一的。 int (必需)

OSDiskImageEncryption

名称 说明
diskEncryptionSetId 包含磁盘加密集的资源 ID 的相对 URI。 字符串
securityProfile 此属性指定 OS 磁盘映像的安全配置文件。 OSDiskImageSecurityProfile

OSDiskImageSecurityProfile

名称 说明
confidentialVMEncryptionType 机密 VM 加密类型 “EncryptedVMGuestStateOnlyWithPmk”
“EncryptedWithCmk”
“EncryptedWithPmk”
secureVMDiskEncryptionSetId 安全 VM 磁盘加密集 ID 字符串

GalleryExtendedLocation

名称 说明
name 字符串
type 它是扩展位置的类型。 “EdgeZone”
“未知”

TargetRegion

名称 说明
加密 可选。 允许用户提供客户托管密钥来加密库项目中的 OS 和数据磁盘。 EncryptionImages
name 区域的名称。 字符串 (必需)
regionalReplicaCount 每个区域要创建的映像版本的副本数。 此属性可更新。 int
storageAccountType 指定要用于存储映像的存储帐户类型。 此属性不可更新。 “Premium_LRS”
“StandardSSD_LRS”
“Standard_LRS”
“Standard_ZRS”

GalleryImageVersionStorageProfile

名称 说明
dataDiskImages 数据磁盘映像的列表。 GalleryDataDiskImage[]
osDiskImage 这是 OS 磁盘映像。 GalleryOSDiskImage
source 库项目版本源。 GalleryArtifactVersionSource

GalleryDataDiskImage

名称 说明
hostCaching 磁盘的主机缓存。 有效值为“None”、“ReadOnly”和“ReadWrite” “None”
“ReadOnly”
“ReadWrite”
lun 此属性指定数据磁盘的逻辑单元号。 此值用于标识虚拟机中的数据磁盘,因此对于附加到虚拟机的每个数据磁盘必须是唯一的。 int (必需)
source 库项目版本源。 GalleryArtifactVersionSource

GalleryArtifactVersionSource

名称 说明 Value
id 库项目版本源的 ID。 可以指定磁盘 uri、快照 uri、用户映像或存储帐户资源。 字符串
uri 库项目版本源的 URI。 当前用于指定 vhd/blob 源。 字符串

GalleryOSDiskImage

名称 说明
hostCaching 磁盘的主机缓存。 有效值为“None”、“ReadOnly”和“ReadWrite” “None”
“ReadOnly”
“ReadWrite”
source 库项目版本源。 GalleryArtifactVersionSource

快速入门模板

以下快速入门模板部署此资源类型。

模板 说明
在 Azure Compute Gallery 中创建映像版本

部署到 Azure
此模板允许在 Azure Compute Gallery 中创建简单的映像版本。 在部署之前,请确保已运行 Azure Compute Gallery 101 模板和映像定义 101 模板。

ARM 模板资源定义

库/映像/版本资源类型可以通过针对以下操作进行部署:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Compute/galleries/images/versions 资源,请将以下 JSON 添加到模板。

{
  "type": "Microsoft.Compute/galleries/images/versions",
  "apiVersion": "2021-10-01",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "properties": {
    "publishingProfile": {
      "endOfLifeDate": "string",
      "excludeFromLatest": "bool",
      "replicaCount": "int",
      "replicationMode": "string",
      "storageAccountType": "string",
      "targetExtendedLocations": [
        {
          "encryption": {
            "dataDiskImages": [
              {
                "diskEncryptionSetId": "string",
                "lun": "int"
              }
            ],
            "osDiskImage": {
              "diskEncryptionSetId": "string",
              "securityProfile": {
                "confidentialVMEncryptionType": "string",
                "secureVMDiskEncryptionSetId": "string"
              }
            }
          },
          "extendedLocation": {
            "name": "string",
            "type": "string"
          },
          "extendedLocationReplicaCount": "int",
          "name": "string",
          "storageAccountType": "string"
        }
      ],
      "targetRegions": [
        {
          "encryption": {
            "dataDiskImages": [
              {
                "diskEncryptionSetId": "string",
                "lun": "int"
              }
            ],
            "osDiskImage": {
              "diskEncryptionSetId": "string",
              "securityProfile": {
                "confidentialVMEncryptionType": "string",
                "secureVMDiskEncryptionSetId": "string"
              }
            }
          },
          "name": "string",
          "regionalReplicaCount": "int",
          "storageAccountType": "string"
        }
      ]
    },
    "storageProfile": {
      "dataDiskImages": [
        {
          "hostCaching": "string",
          "lun": "int",
          "source": {
            "id": "string",
            "uri": "string"
          }
        }
      ],
      "osDiskImage": {
        "hostCaching": "string",
        "source": {
          "id": "string",
          "uri": "string"
        }
      },
      "source": {
        "id": "string",
        "uri": "string"
      }
    }
  }
}

属性值

galleries/images/versions

名称 说明 Value
type 资源类型 “Microsoft.Compute/galleries/images/versions”
apiVersion 资源 API 版本 '2021-10-01'
name 资源名称

了解如何在 JSON ARM 模板中设置子资源的名称和类型。
字符串 (必需)

字符限制:32 位整数

有效字符:
数字和句点。
(每段都转换为 int32。因此,每段的最大值为 2,147,483,647。)
location 资源位置 字符串 (必需)
标记 资源标记 标记名称和值的字典。 请参阅 模板中的标记
properties 描述库映像版本的属性。 GalleryImageVersionProperties

GalleryImageVersionProperties

名称 说明
publishingProfile 库映像版本的发布配置文件。 GalleryImageVersionPublishingProfile
storageProfile 这是库映像版本的存储配置文件。 GalleryImageVersionStorageProfile (必需)

GalleryImageVersionPublishingProfile

名称 说明
endOfLifeDate 库映像版本的生命周期结束日期。 此属性可用于解除授权目的。 此属性可更新。 字符串
excludeFromLatest 如果设置为 true,则从最新版本的映像定义部署虚拟机不会使用此映像版本。 bool
replicaCount 每个区域要创建的映像版本的副本数。 如果未指定 regionalReplicaCount,此属性将对区域生效。 此属性可更新。 int
replicationMode 可选参数,指定用于复制的模式。 此属性不可更新。 'Full'
'Shallow'
storageAccountType 指定要用于存储映像的存储帐户类型。 此属性不可更新。 “Premium_LRS”
“StandardSSD_LRS”
“Standard_LRS”
“Standard_ZRS”
targetExtendedLocations 映像版本要复制到的目标扩展位置。 此属性可更新。 GalleryTargetExtendedLocation[]
targetRegions 映像版本要复制到的目标区域。 此属性可更新。 TargetRegion[]

GalleryTargetExtendedLocation

名称 说明
加密 可选。 允许用户提供客户管理的密钥,用于加密库项目中的 OS 和数据磁盘。 EncryptionImages
extendedLocation 扩展位置的名称。 GalleryExtendedLocation
extendedLocationReplicaCount 每个扩展位置要创建的映像版本的副本数。 此属性可更新。 int
name 区域的名称。 字符串
storageAccountType 指定要用于存储映像的存储帐户类型。 此属性不可更新。 “Premium_LRS”
“StandardSSD_LRS”
“Standard_LRS”
“Standard_ZRS”

EncryptionImages

名称 说明
dataDiskImages 数据磁盘映像的加密规范列表。 DataDiskImageEncryption[]
osDiskImage 包含 OS 磁盘映像的加密设置。 OSDiskImageEncryption

DataDiskImageEncryption

名称 说明
diskEncryptionSetId 包含磁盘加密集的资源 ID 的相对 URI。 字符串
lun 此属性指定数据磁盘的逻辑单元号。 此值用于标识虚拟机中的数据磁盘,因此对于附加到虚拟机的每个数据磁盘必须是唯一的。 int (必需)

OSDiskImageEncryption

名称 说明
diskEncryptionSetId 包含磁盘加密集的资源 ID 的相对 URI。 字符串
securityProfile 此属性指定 OS 磁盘映像的安全配置文件。 OSDiskImageSecurityProfile

OSDiskImageSecurityProfile

名称 说明
confidentialVMEncryptionType 机密 VM 加密类型 “EncryptedVMGuestStateOnlyWithPmk”
“EncryptedWithCmk”
“EncryptedWithPmk”
secureVMDiskEncryptionSetId 安全 VM 磁盘加密集 ID 字符串

GalleryExtendedLocation

名称 说明
name 字符串
type 它是扩展位置的类型。 “EdgeZone”
“未知”

TargetRegion

名称 说明
加密 可选。 允许用户提供客户管理的密钥,用于加密库项目中的 OS 和数据磁盘。 EncryptionImages
name 区域的名称。 字符串 (必需)
regionalReplicaCount 每个区域要创建的映像版本的副本数。 此属性可更新。 int
storageAccountType 指定要用于存储映像的存储帐户类型。 此属性不可更新。 “Premium_LRS”
“StandardSSD_LRS”
“Standard_LRS”
“Standard_ZRS”

GalleryImageVersionStorageProfile

名称 说明
dataDiskImages 数据磁盘映像的列表。 GalleryDataDiskImage[]
osDiskImage 这是 OS 磁盘映像。 GalleryOSDiskImage
source 库项目版本源。 GalleryArtifactVersionSource

GalleryDataDiskImage

名称 说明
hostCaching 磁盘的主机缓存。 有效值为“None”、“ReadOnly”和“ReadWrite” “None”
“ReadOnly”
“ReadWrite”
lun 此属性指定数据磁盘的逻辑单元号。 此值用于标识虚拟机中的数据磁盘,因此对于附加到虚拟机的每个数据磁盘必须是唯一的。 int (必需)
source 库项目版本源。 GalleryArtifactVersionSource

GalleryArtifactVersionSource

名称 说明 Value
id 库项目版本源的 ID。 可以指定磁盘 uri、快照 uri、用户映像或存储帐户资源。 字符串
uri 库项目版本源的 URI。 当前用于指定 vhd/blob 源。 字符串

GalleryOSDiskImage

名称 说明
hostCaching 磁盘的主机缓存。 有效值为“None”、“ReadOnly”和“ReadWrite” “None”
“ReadOnly”
“ReadWrite”
source 库项目版本源。 GalleryArtifactVersionSource

快速入门模板

以下快速入门模板部署此资源类型。

模板 说明
在 Azure Compute Gallery 中创建映像版本

部署到 Azure
此模板允许在 Azure Compute Gallery 中创建简单的映像版本。 在部署之前,请确保已运行 Azure Compute Gallery 101 模板和映像定义 101 模板。

Terraform (AzAPI 提供程序) 资源定义

库/映像/版本资源类型可以通过针对以下操作进行部署:

  • 资源组

有关每个 API 版本中更改的属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.Compute/gallerys/images/versions 资源,请将以下 Terraform 添加到模板。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Compute/galleries/images/versions@2021-10-01"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  body = jsonencode({
    properties = {
      publishingProfile = {
        endOfLifeDate = "string"
        excludeFromLatest = bool
        replicaCount = int
        replicationMode = "string"
        storageAccountType = "string"
        targetExtendedLocations = [
          {
            encryption = {
              dataDiskImages = [
                {
                  diskEncryptionSetId = "string"
                  lun = int
                }
              ]
              osDiskImage = {
                diskEncryptionSetId = "string"
                securityProfile = {
                  confidentialVMEncryptionType = "string"
                  secureVMDiskEncryptionSetId = "string"
                }
              }
            }
            extendedLocation = {
              name = "string"
              type = "string"
            }
            extendedLocationReplicaCount = int
            name = "string"
            storageAccountType = "string"
          }
        ]
        targetRegions = [
          {
            encryption = {
              dataDiskImages = [
                {
                  diskEncryptionSetId = "string"
                  lun = int
                }
              ]
              osDiskImage = {
                diskEncryptionSetId = "string"
                securityProfile = {
                  confidentialVMEncryptionType = "string"
                  secureVMDiskEncryptionSetId = "string"
                }
              }
            }
            name = "string"
            regionalReplicaCount = int
            storageAccountType = "string"
          }
        ]
      }
      storageProfile = {
        dataDiskImages = [
          {
            hostCaching = "string"
            lun = int
            source = {
              id = "string"
              uri = "string"
            }
          }
        ]
        osDiskImage = {
          hostCaching = "string"
          source = {
            id = "string"
            uri = "string"
          }
        }
        source = {
          id = "string"
          uri = "string"
        }
      }
    }
  })
}

属性值

galleries/images/versions

名称 说明 Value
type 资源类型 “Microsoft.Compute/gallerys/images/versions@2021-10-01”
name 资源名称 字符串 (必需)

字符限制:32 位整数

有效字符:
数字和句点。
(每段都转换为 int32。因此,每段的最大值为 2,147,483,647。)
location 资源位置 字符串 (必需)
parent_id 此资源的父资源 ID。 类型为“图像”的资源的 ID
标记 资源标记 标记名称和值的字典。
properties 描述库映像版本的属性。 GalleryImageVersionProperties

GalleryImageVersionProperties

名称 说明
publishingProfile 库映像版本的发布配置文件。 GalleryImageVersionPublishingProfile
storageProfile 这是库映像版本的存储配置文件。 需要 GalleryImageVersionStorageProfile ()

GalleryImageVersionPublishingProfile

名称 说明
endOfLifeDate 库映像版本的生命周期结束日期。 此属性可用于解除授权。 此属性可更新。 字符串
excludeFromLatest 如果设置为 true,则从最新版本的映像定义部署虚拟机将不使用此映像版本。 bool
replicaCount 每个区域要创建的映像版本的副本数。 如果未指定 regionReplicaCount,此属性将对区域生效。 此属性可更新。 int
replicationMode 可选参数,用于指定要用于复制的模式。 此属性不可更新。 “Full”
“浅表”
storageAccountType 指定要用于存储映像的存储帐户类型。 此属性不可更新。 “Premium_LRS”
“StandardSSD_LRS”
“Standard_LRS”
“Standard_ZRS”
targetExtendedLocations 映像版本要复制到的目标扩展位置。 此属性可更新。 GalleryTargetExtendedLocation[]
targetRegions 映像版本要复制到的目标区域。 此属性可更新。 TargetRegion[]

GalleryTargetExtendedLocation

名称 说明
加密 可选。 允许用户提供客户托管密钥来加密库项目中的 OS 和数据磁盘。 EncryptionImages
extendedLocation 扩展位置的名称。 GalleryExtendedLocation
extendedLocationReplicaCount 每个扩展位置要创建的映像版本的副本数。 此属性可更新。 int
name 区域的名称。 字符串
storageAccountType 指定要用于存储映像的存储帐户类型。 此属性不可更新。 “Premium_LRS”
“StandardSSD_LRS”
“Standard_LRS”
“Standard_ZRS”

EncryptionImages

名称 说明
dataDiskImages 数据磁盘映像的加密规范列表。 DataDiskImageEncryption[]
osDiskImage 包含 OS 磁盘映像的加密设置。 OSDiskImageEncryption

DataDiskImageEncryption

名称 说明
diskEncryptionSetId 包含磁盘加密集的资源 ID 的相对 URI。 字符串
lun 此属性指定数据磁盘的逻辑单元号。 此值用于标识虚拟机中的数据磁盘,因此对于附加到虚拟机的每个数据磁盘必须是唯一的。 int (必需)

OSDiskImageEncryption

名称 说明
diskEncryptionSetId 包含磁盘加密集的资源 ID 的相对 URI。 字符串
securityProfile 此属性指定 OS 磁盘映像的安全配置文件。 OSDiskImageSecurityProfile

OSDiskImageSecurityProfile

名称 说明
confidentialVMEncryptionType 机密 VM 加密类型 “EncryptedVMGuestStateOnlyWithPmk”
“EncryptedWithCmk”
“EncryptedWithPmk”
secureVMDiskEncryptionSetId 安全 VM 磁盘加密集 ID 字符串

GalleryExtendedLocation

名称 说明
name 字符串
type 它是扩展位置的类型。 “EdgeZone”
"Unknown"

TargetRegion

名称 说明
加密 可选。 允许用户提供客户托管密钥来加密库项目中的 OS 和数据磁盘。 EncryptionImages
name 区域的名称。 字符串 (必需)
regionalReplicaCount 每个区域要创建的映像版本的副本数。 此属性可更新。 int
storageAccountType 指定要用于存储映像的存储帐户类型。 此属性不可更新。 “Premium_LRS”
“StandardSSD_LRS”
“Standard_LRS”
“Standard_ZRS”

GalleryImageVersionStorageProfile

名称 说明
dataDiskImages 数据磁盘映像的列表。 GalleryDataDiskImage[]
osDiskImage 这是 OS 磁盘映像。 GalleryOSDiskImage
source 库项目版本源。 GalleryArtifactVersionSource

GalleryDataDiskImage

名称 说明
hostCaching 磁盘的主机缓存。 有效值为“None”、“ReadOnly”和“ReadWrite” "None"
“ReadOnly”
“ReadWrite”
lun 此属性指定数据磁盘的逻辑单元号。 此值用于标识虚拟机中的数据磁盘,因此对于附加到虚拟机的每个数据磁盘必须是唯一的。 int (必需)
source 库项目版本源。 GalleryArtifactVersionSource

GalleryArtifactVersionSource

名称 说明 Value
id 库项目版本源的 ID。 可以指定磁盘 uri、快照 uri、用户映像或存储帐户资源。 字符串
uri 库项目版本源的 URI。 当前用于指定 vhd/blob 源。 字符串

GalleryOSDiskImage

名称 说明
hostCaching 磁盘的主机缓存。 有效值为“None”、“ReadOnly”和“ReadWrite” "None"
“ReadOnly”
“ReadWrite”
source 库项目版本源。 GalleryArtifactVersionSource