Bicep 資源定義
imageTemplates 資源類型可以使用目標作業來部署:
- 資源群組 - 請參閱 資源群組部署命令
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
資源格式
若要建立 Microsoft.VirtualMachineImages/imageTemplates 資源,請將下列 Bicep 新增至範本。
resource symbolicname 'Microsoft.VirtualMachineImages/imageTemplates@2024-02-01' = {
identity: {
type: 'string'
userAssignedIdentities: {
{customized property}: {}
}
}
location: 'string'
name: 'string'
properties: {
autoRun: {
state: 'string'
}
buildTimeoutInMinutes: int
customize: [
{
name: 'string'
type: 'string'
// For remaining properties, see ImageTemplateCustomizer objects
}
]
distribute: [
{
artifactTags: {
{customized property}: 'string'
}
runOutputName: 'string'
type: 'string'
// For remaining properties, see ImageTemplateDistributor objects
}
]
errorHandling: {
onCustomizerError: 'string'
onValidationError: 'string'
}
managedResourceTags: {
{customized property}: 'string'
}
optimize: {
vmBoot: {
state: 'string'
}
}
source: {
type: 'string'
// For remaining properties, see ImageTemplateSource objects
}
stagingResourceGroup: 'string'
validate: {
continueDistributeOnFailure: bool
inVMValidations: [
{
name: 'string'
type: 'string'
// For remaining properties, see ImageTemplateInVMValidator objects
}
]
sourceValidationOnly: bool
}
vmProfile: {
osDiskSizeGB: int
userAssignedIdentities: [
'string'
]
vmSize: 'string'
vnetConfig: {
containerInstanceSubnetId: 'string'
proxyVmSize: 'string'
subnetId: 'string'
}
}
}
tags: {
{customized property}: 'string'
}
}
ImageTemplateSource 物件
設定 類型 屬性,以指定物件的類型。
針對 ManagedImage,請使用:
{
imageId: 'string'
type: 'ManagedImage'
}
針對 PlatformImage,請使用:
{
offer: 'string'
planInfo: {
planName: 'string'
planProduct: 'string'
planPublisher: 'string'
}
publisher: 'string'
sku: 'string'
type: 'PlatformImage'
version: 'string'
}
針對 SharedImageVersion,請使用:
{
imageVersionId: 'string'
type: 'SharedImageVersion'
}
ImageTemplateCustomizer 物件
設定 類型 屬性,以指定物件的類型。
針對 [檔案],請使用:
{
destination: 'string'
sha256Checksum: 'string'
sourceUri: 'string'
type: 'File'
}
針對 PowerShell,請使用:
{
inline: [
'string'
]
runAsSystem: bool
runElevated: bool
scriptUri: 'string'
sha256Checksum: 'string'
type: 'PowerShell'
validExitCodes: [
int
]
}
針對 Shell,請使用:
{
inline: [
'string'
]
scriptUri: 'string'
sha256Checksum: 'string'
type: 'Shell'
}
針對 windowsRestart
{
restartCheckCommand: 'string'
restartCommand: 'string'
restartTimeout: 'string'
type: 'WindowsRestart'
}
針對 WindowsUpdate,請使用:
{
filters: [
'string'
]
searchCriteria: 'string'
type: 'WindowsUpdate'
updateLimit: int
}
DistributeVersioner 物件
設定 scheme 屬性以指定 物件的類型。
針對 最新版,請使用:
{
major: int
scheme: 'Latest'
}
針對 Source,請使用:
{
scheme: 'Source'
}
ImageTemplateDistributor 物件
設定 類型 屬性,以指定物件的類型。
針對 ManagedImage,請使用:
{
imageId: 'string'
location: 'string'
type: 'ManagedImage'
}
針對 SharedImage,請使用:
{
excludeFromLatest: bool
galleryImageId: 'string'
replicationRegions: [
'string'
]
storageAccountType: 'string'
targetRegions: [
{
name: 'string'
replicaCount: int
storageAccountType: 'string'
}
]
type: 'SharedImage'
versioning: {
scheme: 'string'
// For remaining properties, see DistributeVersioner objects
}
}
針對 VHD,請使用:
{
type: 'VHD'
uri: 'string'
}
ImageTemplateInVMValidator 物件
設定 類型 屬性,以指定物件的類型。
針對 [檔案],請使用:
{
destination: 'string'
sha256Checksum: 'string'
sourceUri: 'string'
type: 'File'
}
針對 PowerShell,請使用:
{
inline: [
'string'
]
runAsSystem: bool
runElevated: bool
scriptUri: 'string'
sha256Checksum: 'string'
type: 'PowerShell'
validExitCodes: [
int
]
}
針對 Shell,請使用:
{
inline: [
'string'
]
scriptUri: 'string'
sha256Checksum: 'string'
type: 'Shell'
}
屬性值
Microsoft.VirtualMachineImages/imageTemplates
名稱 | 說明 | 價值觀 |
---|---|---|
身分識別 | 如果已設定,則為映像範本的身分識別。 | ImageTemplateIdentity (必要) |
位置 | 資源所在的地理位置 | 字串 (必要) |
名稱 | 資源名稱 | 字串 約束: 模式 = ^[A-Za-z0-9-_.]{1,64}$ (必要) |
屬性 | 映像範本的屬性 | ImageTemplate屬性 |
標記 | 資源標籤 | 標記名稱和值的字典。 請參閱範本中的 標籤 |
DistributeVersioner
名稱 | 說明 | 價值觀 |
---|---|---|
方案 | 針對 DistributeVersionerLatest 類型,設定為 'Latest'。 針對 DistributeVersionerSource 類型,設定為 'Source'。 | “最新” 'Source' (必要) |
DistributeVersionerLatest
名稱 | 說明 | 價值觀 |
---|---|---|
主要 | 所產生版本號碼的主要版本。 根據以此值作為主要版本的版本,判斷什麼是「最新」。 -1 相當於將它取消設定。 | int 約束: 最小值 = -1 |
方案 | 要使用的版本編號配置。 | 'Latest' (必要) |
DistributeVersionerSource
名稱 | 說明 | 價值觀 |
---|---|---|
方案 | 要使用的版本編號配置。 | 'Source' (必要) |
ImageTemplate自動運行
名稱 | 說明 | 價值觀 |
---|---|---|
狀態 | 啟用此欄位將會在映像範本建立或更新時觸發自動建置。 | “已禁用” “已啟用” |
ImageTemplate定製器
名稱 | 說明 | 價值觀 |
---|---|---|
名稱 | 易記名稱,提供此自定義步驟的內容 | 字串 |
型別 | 設定為 ImageTemplateFileCustomizer 類型的 'File'。 設定為 ImageTemplatePowerShellCustomizer 類型的 'PowerShell'。 設定為 ImageTemplateShellCustomizer 類型的 'Shell'。 針對 imageTemplateRestartCustomizer類型 |
“檔” “PowerShell” “殼” “Windows重啟” 'WindowsUpdate' (必要) |
ImageTemplateDistributor
名稱 | 說明 | 價值觀 |
---|---|---|
artifact標籤 | 散發者建立/更新成品后,將會套用至成品的標記。 | ImageTemplateDistributorArtifact標籤 |
runOutputName (運行輸出名稱) | 要用於相關聯 RunOutput 的名稱。 | 字串 約束: 模式 = ^[A-Za-z0-9-_.]{1,64}$ (必要) |
型別 | 設定為 ImageTemplateManagedImageDistributor 類型的 『ManagedImage』。 設定為 ImageTemplateSharedImageDistributor 類型的 'SharedImage'。 設定為 ImageTemplateVhdDistributor 類型的 'VHD'。 | “ManagedImage” “共用圖像” 'VHD' (必要) |
ImageTemplateDistributorArtifact標籤
名稱 | 說明 | 價值觀 |
---|
ImageTemplateFile定製器
名稱 | 說明 | 價值觀 |
---|---|---|
目的地 | 檔案的絕對路徑(已建立巢狀目錄結構),其中檔案 (from sourceUri) 會在 VM 中上傳至 | 字串 |
sha256校驗和 | 上述 sourceUri 字段中提供的檔案 SHA256 總和檢查碼 | 字串 |
sourceUri 的 | 要上傳以自定義 VM 之檔案的 URI。 它可以是 Github 連結、Azure 記憶體的 SAS URI 等等 | 字串 |
型別 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 'File' (必要) |
ImageTemplateFileValidator
名稱 | 說明 | 價值觀 |
---|---|---|
目的地 | 檔案的絕對路徑(已建立巢狀目錄結構),其中檔案 (from sourceUri) 會在 VM 中上傳至 | 字串 |
sha256校驗和 | 上述 sourceUri 字段中提供的檔案 SHA256 總和檢查碼 | 字串 |
sourceUri 的 | 要上傳至 VM 以進行驗證之檔案的 URI。 它可以是 github 連結、Azure 記憶體 URI(已授權或 SAS),等等 | 字串 |
型別 | 您想要在 Image 上使用的驗證類型。 例如,“Shell” 可以是殼層驗證 | 'File' (必要) |
ImageTemplateIdentity
名稱 | 說明 | 價值觀 |
---|---|---|
型別 | 用於映像範本的身分識別類型。 類型 『None』 會從映像範本中移除任何身分識別。 | “無” 'UserAssigned' |
使用者指派的身份 | 與資源相關聯的使用者指派身分識別集。 userAssignedIdentities 字典索引鍵的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}。 字典值可以是要求中的空白物件({})。 | UserAssignedIdentities |
ImageTemplateInVMValidator
名稱 | 說明 | 價值觀 |
---|---|---|
名稱 | 易記名稱,提供此驗證步驟的內容 | 字串 |
型別 | 設定為 ImageTemplateFileValidator 類型的 'File'。 設定為 ImageTemplatePowerShellValidator 類型的 'PowerShell'。 設定為 ImageTemplateShellValidator 類型的 『Shell』。 | “檔” “PowerShell” 'Shell' (必要) |
ImageTemplateManagedImageDistributor
名稱 | 說明 | 價值觀 |
---|---|---|
圖像ID | 受控磁碟映像的資源標識碼 | 字串 (必要) |
位置 | 映射的 Azure 位置,如果映射已經存在,則應該相符 | 字串 (必要) |
型別 | 分佈類型。 | 'ManagedImage' (必要) |
ImageTemplateManagedImageSource (英文)
名稱 | 說明 | 價值觀 |
---|---|---|
圖像ID | 客戶訂用帳戶中受控映像的 ARM 資源識別碼 | 字串 (必要) |
型別 | 指定您想要開頭的來源影像類型。 | 'ManagedImage' (必要) |
ImageTemplatePlatformImageSource
名稱 | 說明 | 價值觀 |
---|---|---|
供應項目 | azure 資源庫映像 |
字串 |
計劃資訊 | 平臺映像的選擇性購買方案設定。 | 平臺圖片購買計劃 |
發行者 | Azure 資源庫映射中的映像發行者。 | 字串 |
SKU | 來自 Azure 資源庫映像的映像 SKU。 | 字串 |
型別 | 指定您想要開頭的來源影像類型。 | 'PlatformImage' (必要) |
版本 | 來自 Azure 資源庫映像的映像版本。 如果在這裡指定了 'latest',則會在映射組建發生時評估版本,而不是在提交範本時評估。 | 字串 |
ImageTemplatePowerShellCustomizer
名稱 | 說明 | 價值觀 |
---|---|---|
內嵌 | 要執行的PowerShell命令陣列 | 字串[] |
runAsSystem | 如果指定,PowerShell 腳本將會使用本機系統使用者提高的許可權來執行。 只有當上述 runElevated 字段設定為 true 時,才能為 true。 | 布爾 (bool) |
runElevated 的 | 如果指定,PowerShell 腳本將會以更高的許可權執行 | 布爾 (bool) |
scriptUri 的 | 要執行以進行自定義之 PowerShell 腳本的 URI。 它可以是 Github 連結、Azure 記憶體的 SAS URI 等等 | 字串 |
sha256校驗和 | 上述 scriptUri 字段中提供的 Power Shell 腳本 SHA256 總和檢查碼 | 字串 |
型別 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 'PowerShell' (必要) |
有效退出代碼 | PowerShell 腳本的有效結束代碼。 [預設值: 0] | int[] |
ImageTemplatePowerShellValidator
名稱 | 說明 | 價值觀 |
---|---|---|
內嵌 | 要執行的PowerShell命令陣列 | 字串[] |
runAsSystem | 如果指定,PowerShell 腳本將會使用本機系統使用者提高的許可權來執行。 只有當上述 runElevated 字段設定為 true 時,才能為 true。 | 布爾 (bool) |
runElevated 的 | 如果指定,PowerShell 腳本將會以更高的許可權執行 | 布爾 (bool) |
scriptUri 的 | 要執行以進行驗證的PowerShell腳本 URI。 它可以是 github 連結、Azure 記憶體 URI 等 | 字串 |
sha256校驗和 | 上述 scriptUri 字段中提供的 Power Shell 腳本 SHA256 總和檢查碼 | 字串 |
型別 | 您想要在 Image 上使用的驗證類型。 例如,“Shell” 可以是殼層驗證 | 'PowerShell' (必要) |
有效退出代碼 | PowerShell 腳本的有效結束代碼。 [預設值: 0] | int[] |
ImageTemplate屬性
名稱 | 說明 | 價值觀 |
---|---|---|
自動運行 | 指出是否要在範本建立或更新時自動執行映像範本組建。 | ImageTemplate自動運行 |
buildTimeoutInMinutes | 建置映像範本時要等候的最大持續時間(包括所有自定義專案、優化、驗證和散發套件)。 省略或指定 0 以使用預設值 (4 小時)。 | int 約束: 最小值 = 0 最大值 = 960 |
自訂 | 指定用來描述映像自定義步驟的屬性,例如影像來源等 | ImageTemplateCustomizer[] |
散發 | 影像輸出需要前往的散發目標。 | ImageTemplateDistributor[] (必要) |
錯誤處理 | 建置失敗時的錯誤處理選項 | ImageTemplatePropertiesErrorHandling |
managedResource標籤 | 將套用至服務所建立之資源群組和/或資源的標記。 | ImageTemplatePropertiesManagedResourceTags |
最佳化 | 指定要在映像上執行的優化。 | ImageTemplateProperties優化 |
來源 | 指定用來描述來源影像的屬性。 | ImageTemplateSource (必要) |
stagingResourceGroup 的 | 與用來建置映像之映像範本相同訂用帳戶中的預備資源群組標識碼。 如果此欄位是空的,將會建立具有隨機名稱的資源群組。 如果此欄位中指定的資源群組不存在,則會以相同的名稱建立。 如果指定的資源群組存在,它必須是空的,且位於與映像範本相同的區域中。 如果此欄位是空的,或指定的資源群組不存在,則會在範本刪除期間刪除建立的資源群組,但如果指定的資源群組存在,則會在範本刪除期間刪除資源群組,而且資源群組本身將會保留。 | 字串 |
確認 | 要對產生的映像執行的組態選項和驗證清單。 | ImageTemplateProperties驗證 |
vm配置檔 | 描述虛擬機如何設定以建置映像 | ImageTemplateVmProfile |
ImageTemplatePropertiesErrorHandling
名稱 | 說明 | 價值觀 |
---|---|---|
onCustomizerError | 如果自定義工具發生錯誤,且此字段設定為 「清除」,則會清除組建 VM 和相關聯的網路資源。 此為預設行為。 如果自定義工具發生錯誤,且此字段設定為 「中止」,則會保留組建 VM。 | 'abort' '清理' |
onValidationError | 如果發生驗證錯誤,且此字段設定為 「清除」,則會清除組建 VM 和相關聯的網路資源。 此為預設行為。 如果發生驗證錯誤,且此字段設定為 『abort』,則會保留組建 VM。 | 'abort' '清理' |
ImageTemplatePropertiesManagedResourceTags
名稱 | 說明 | 價值觀 |
---|
ImageTemplateProperties優化
名稱 | 說明 | 價值觀 |
---|---|---|
vm引導 | 優化會在映像上套用,以加快 VM 開機速度。 | ImageTemplatePropertiesOptimizeVmBoot |
ImageTemplatePropertiesOptimizeVmBoot
名稱 | 說明 | 價值觀 |
---|---|---|
狀態 | 啟用此欄位可藉由優化最終自定義映像輸出來改善 VM 開機時間。 | “已禁用” “已啟用” |
ImageTemplateProperties驗證
名稱 | 說明 | 價值觀 |
---|---|---|
continueDistributeOnFailure | 如果驗證失敗,且此字段設定為 false,則不會散發輸出影像。 此為預設行為。 如果驗證失敗,且此字段設定為 true,輸出影像仍會散發。 請謹慎使用此選項,因為它可能會導致散發不正確的映像以供使用。 不論是哪一種情況(true 或 false),端對端映射執行都會回報為在驗證失敗時失敗。 [注意:如果驗證成功,此字段就沒有作用。] | 布爾 (bool) |
inVMValidations | 要執行的驗證清單。 | ImageTemplateInVMValidator[] |
sourceValidationOnly | 如果此欄位設定為 true,則會直接驗證 'source' 區段中指定的影像。 不會執行個別的組建來產生,然後驗證自定義映像。 | 布爾 (bool) |
ImageTemplateRestartCustomizer
名稱 | 說明 | 價值觀 |
---|---|---|
restartCheck命令 | 檢查重新啟動是否成功的命令 [預設值: ''] | 字串 |
restart命令 | 執行重新啟動的命令 [預設值: 'shutdown /r /f /t 0 /c “packer restart”'] | 字串 |
restart超時 | 指定為大小和單位字串的重新啟動逾時,例如 '5m' (5 分鐘) 或 '2h' (2 小時) [預設值: '5m'] | 字串 |
型別 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 'WindowsRestart' (必要) |
ImageTemplateSharedImageDistributor
名稱 | 說明 | 價值觀 |
---|---|---|
從最新排除 | 旗標,指出是否應該從最新版本中排除已建立的映像版本。 請省略以使用預設值 (false)。 | 布爾 (bool) |
galleryImageId | Azure 計算資源庫映像的資源標識碼 | 字串 (必要) |
replication區域 | [已淘汰]將複寫映像的區域清單。 只有在未指定 targetRegions 時,才能指定此列表。 此欄位已被取代 - 請改用 targetRegions。 | 字串[] |
儲存帳戶類型 | [已淘汰]用來儲存共用映像的記憶體帳戶類型。 請省略以使用預設值 (Standard_LRS)。 只有在指定 replicationRegions 時,才能指定此字段。 此欄位已被取代 - 請改用 targetRegions。 | “Premium_LRS” “Standard_LRS” “Standard_ZRS” |
目標區域 | 要復寫分散式映像版本的目標區域。 這個物件會取代 replicationRegions,而且只有在未指定 replicationRegions 時才可指定。 | 目標區域 |
型別 | 分佈類型。 | 'SharedImage' (必要) |
版本設定 | 描述如何為散發產生新的 x.y.z 版本號碼。 | DistributeVersioner |
ImageTemplateSharedImageVersionSource
名稱 | 說明 | 價值觀 |
---|---|---|
imageVersionId (圖片版本標識) | 映像版本的 ARM 資源識別碼。 映射版本名稱為「最新」時,映射組建發生時會評估版本。 | 字串 (必要) |
型別 | 指定您想要開頭的來源影像類型。 | 'SharedImageVersion' (必要) |
ImageTemplateShellCustomizer
名稱 | 說明 | 價值觀 |
---|---|---|
內嵌 | 要執行的殼層命令陣列 | 字串[] |
scriptUri 的 | 要執行以進行自定義之殼層腳本的 URI。 它可以是 Github 連結、Azure 記憶體的 SAS URI 等等 | 字串 |
sha256校驗和 | scriptUri 字段中提供的Shell腳本 SHA256 總和檢查碼 | 字串 |
型別 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 'Shell' (必要) |
ImageTemplateShellValidator
名稱 | 說明 | 價值觀 |
---|---|---|
內嵌 | 要執行的殼層命令陣列 | 字串[] |
scriptUri 的 | 要執行以進行驗證的殼層腳本 URI。 它可以是 github 連結、Azure 記憶體 URI 等 | 字串 |
sha256校驗和 | scriptUri 字段中提供的Shell腳本 SHA256 總和檢查碼 | 字串 |
型別 | 您想要在 Image 上使用的驗證類型。 例如,“Shell” 可以是殼層驗證 | 'Shell' (必要) |
ImageTemplateSource (影像樣本源)
名稱 | 說明 | 價值觀 |
---|---|---|
型別 | 設定為 ImageTemplateManagedImageSource 類型的 'ManagedImage'。 設定為 ImageTemplatePlatformImageSource 類型的 'PlatformImage'。 設定為 ImageTemplateSharedImageVersionSource 類型的 'SharedImageVersion'。 | “ManagedImage” '平臺圖像' 'SharedImageVersion' (必要) |
ImageTemplateVhdDistributor
名稱 | 說明 | 價值觀 |
---|---|---|
型別 | 分佈類型。 | 'VHD' (必要) |
統一資源識別碼 (URI) | 分散式 VHD Blob 的選擇性 Azure 記憶體 URI。 省略以使用預設的 (空字串),在此情況下,VHD 會發佈至預備資源群組中的記憶體帳戶。 | 字串 |
ImageTemplateVmProfile
名稱 | 說明 | 價值觀 |
---|---|---|
osDiskSizeGB | 以 GB 為單位的 OS 磁碟大小。 省略或指定 0 以使用 Azure 的預設 OS 磁碟大小。 | int 約束: 最小值 = 0 |
使用者指派的身份 | 在組建 VM 和驗證 VM 上設定的使用者指派受控識別資源標識碼的選擇性數位。 這可能包括映像範本的身分識別。 | 字串[] |
vmSize | 用來建置、自定義和擷取映像的虛擬機大小。 省略或指定空字串,以使用 Gen1 映像的預設值 (Standard_D1_v2,以及 Gen2 映射的Standard_D2ds_v4)。 | 字串 |
vnetConfig | 用來部署組建 VM 和驗證 VM 的虛擬網路選擇性設定。 如果不需要使用任何特定的虛擬網路,請省略 。 | 虛擬網路配置 |
ImageTemplateWindowsUpdateCustomizer
名稱 | 說明 | 價值觀 |
---|---|---|
過濾器 | 要選取要套用之更新的篩選陣列。 省略或指定空陣列以使用預設值 (沒有篩選條件)。 如需此欄位的範例和詳細描述,請參閱上述連結。 | 字串[] |
搜索條件 | 搜尋更新的準則。 省略或指定空字串以使用預設值(全部搜尋)。 如需此欄位的範例和詳細描述,請參閱上述連結。 | 字串 |
型別 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 'WindowsUpdate' (必要) |
updateLimit | 一次要套用的更新數目上限。 省略或指定 0 以使用預設值 (1000) | int 約束: 最小值 = 0 |
平臺圖片購買計劃
名稱 | 說明 | 價值觀 |
---|---|---|
計畫名稱 | 購買方案的名稱。 | 字串 (必要) |
計劃產品 | 購買方案的產品。 | 字串 (必要) |
planPublisher | 購買方案的發行者。 | 字串 (必要) |
目標區域
名稱 | 說明 | 價值觀 |
---|---|---|
名稱 | 區域的名稱。 | 字串 (必要) |
副本數量 | 要在此區域中建立之映像版本的複本數目。 省略以使用預設值 (1)。 | int 約束: 最小值 = 1 |
儲存帳戶類型 | 指定要用來在此區域中儲存映像的記憶體帳戶類型。 請省略以使用預設值 (Standard_LRS)。 | “Premium_LRS” “Standard_LRS” “Standard_ZRS” |
TrackedResourceTags
名稱 | 說明 | 價值觀 |
---|
UserAssignedIdentities
名稱 | 說明 | 價值觀 |
---|
UserAssignedIdentity
名稱 | 說明 | 價值觀 |
---|
虛擬網路配置
名稱 | 說明 | 價值觀 |
---|---|---|
containerInstanceSubnetId | 將針對隔離組建部署 Azure 容器實例之預先存在的子網資源標識碼。 只有在subnetId 同時指定且必須與 中指定的subnetId 子網位於相同的 虛擬網絡 時,才能指定此欄位。 |
字串 |
proxyVm大小 | 用來將流量傳遞至組建 VM 和驗證 VM 的 Proxy 虛擬機大小。 如果未 containerInstanceSubnetId 指定,則不得指定此項目,因為在此情況下不會部署 Proxy 虛擬機。 省略或指定空字串以使用預設值 (Standard_A1_v2)。 |
字串 |
子網ID | 將部署組建 VM 和驗證 VM 之預先存在的子網資源識別碼 | 字串 |
使用範例
Azure 已驗證的模組
下列 Azure 驗證模組 可用來部署此資源類型。
模組 | 說明 |
---|---|
虛擬機映像範本 | 虛擬機映像範本的AVM資源模組 |
Azure 快速入門範例
下列 Azure 快速入門範本 包含用於部署此資源類型的 Bicep 範例。
Bicep 檔案 | 說明 |
---|---|
使用 Azure Windows 基準 |
建立 Azure Image Builder 環境,並建置已套用最新 Windows Update 和 Azure Windows 基準的 Windows Server 映射。 |
設定開發箱服務 | 此範本會根據 Dev Box 快速入門指南 (/azure/dev-box/quickstart-create-dev-box) 建立所有 Dev Box 管理員資源。 您可以檢視所有建立的資源,或直接移至 DevPortal.microsoft.com 來建立您的第一個開發方塊。 |
ARM 樣本資源定義
imageTemplates 資源類型可以使用目標作業來部署:
- 資源群組 - 請參閱 資源群組部署命令
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
資源格式
若要建立 Microsoft.VirtualMachineImages/imageTemplates 資源,請將下列 JSON 新增至範本。
{
"type": "Microsoft.VirtualMachineImages/imageTemplates",
"apiVersion": "2024-02-01",
"name": "string",
"identity": {
"type": "string",
"userAssignedIdentities": {
"{customized property}": {
}
}
},
"location": "string",
"properties": {
"autoRun": {
"state": "string"
},
"buildTimeoutInMinutes": "int",
"customize": [ {
"name": "string",
"type": "string"
// For remaining properties, see ImageTemplateCustomizer objects
} ],
"distribute": [ {
"artifactTags": {
"{customized property}": "string"
},
"runOutputName": "string",
"type": "string"
// For remaining properties, see ImageTemplateDistributor objects
} ],
"errorHandling": {
"onCustomizerError": "string",
"onValidationError": "string"
},
"managedResourceTags": {
"{customized property}": "string"
},
"optimize": {
"vmBoot": {
"state": "string"
}
},
"source": {
"type": "string"
// For remaining properties, see ImageTemplateSource objects
},
"stagingResourceGroup": "string",
"validate": {
"continueDistributeOnFailure": "bool",
"inVMValidations": [ {
"name": "string",
"type": "string"
// For remaining properties, see ImageTemplateInVMValidator objects
} ],
"sourceValidationOnly": "bool"
},
"vmProfile": {
"osDiskSizeGB": "int",
"userAssignedIdentities": [ "string" ],
"vmSize": "string",
"vnetConfig": {
"containerInstanceSubnetId": "string",
"proxyVmSize": "string",
"subnetId": "string"
}
}
},
"tags": {
"{customized property}": "string"
}
}
ImageTemplateSource 物件
設定 類型 屬性,以指定物件的類型。
針對 ManagedImage,請使用:
{
"imageId": "string",
"type": "ManagedImage"
}
針對 PlatformImage,請使用:
{
"offer": "string",
"planInfo": {
"planName": "string",
"planProduct": "string",
"planPublisher": "string"
},
"publisher": "string",
"sku": "string",
"type": "PlatformImage",
"version": "string"
}
針對 SharedImageVersion,請使用:
{
"imageVersionId": "string",
"type": "SharedImageVersion"
}
ImageTemplateCustomizer 物件
設定 類型 屬性,以指定物件的類型。
針對 [檔案],請使用:
{
"destination": "string",
"sha256Checksum": "string",
"sourceUri": "string",
"type": "File"
}
針對 PowerShell,請使用:
{
"inline": [ "string" ],
"runAsSystem": "bool",
"runElevated": "bool",
"scriptUri": "string",
"sha256Checksum": "string",
"type": "PowerShell",
"validExitCodes": [ "int" ]
}
針對 Shell,請使用:
{
"inline": [ "string" ],
"scriptUri": "string",
"sha256Checksum": "string",
"type": "Shell"
}
針對 windowsRestart
{
"restartCheckCommand": "string",
"restartCommand": "string",
"restartTimeout": "string",
"type": "WindowsRestart"
}
針對 WindowsUpdate,請使用:
{
"filters": [ "string" ],
"searchCriteria": "string",
"type": "WindowsUpdate",
"updateLimit": "int"
}
DistributeVersioner 物件
設定 scheme 屬性以指定 物件的類型。
針對 最新版,請使用:
{
"major": "int",
"scheme": "Latest"
}
針對 Source,請使用:
{
"scheme": "Source"
}
ImageTemplateDistributor 物件
設定 類型 屬性,以指定物件的類型。
針對 ManagedImage,請使用:
{
"imageId": "string",
"location": "string",
"type": "ManagedImage"
}
針對 SharedImage,請使用:
{
"excludeFromLatest": "bool",
"galleryImageId": "string",
"replicationRegions": [ "string" ],
"storageAccountType": "string",
"targetRegions": [
{
"name": "string",
"replicaCount": "int",
"storageAccountType": "string"
}
],
"type": "SharedImage",
"versioning": {
"scheme": "string"
// For remaining properties, see DistributeVersioner objects
}
}
針對 VHD,請使用:
{
"type": "VHD",
"uri": "string"
}
ImageTemplateInVMValidator 物件
設定 類型 屬性,以指定物件的類型。
針對 [檔案],請使用:
{
"destination": "string",
"sha256Checksum": "string",
"sourceUri": "string",
"type": "File"
}
針對 PowerShell,請使用:
{
"inline": [ "string" ],
"runAsSystem": "bool",
"runElevated": "bool",
"scriptUri": "string",
"sha256Checksum": "string",
"type": "PowerShell",
"validExitCodes": [ "int" ]
}
針對 Shell,請使用:
{
"inline": [ "string" ],
"scriptUri": "string",
"sha256Checksum": "string",
"type": "Shell"
}
屬性值
Microsoft.VirtualMachineImages/imageTemplates
名稱 | 說明 | 價值觀 |
---|---|---|
apiVersion | API 版本 | '2024-02-01' |
身分識別 | 如果已設定,則為映像範本的身分識別。 | ImageTemplateIdentity (必要) |
位置 | 資源所在的地理位置 | 字串 (必要) |
名稱 | 資源名稱 | 字串 約束: 模式 = ^[A-Za-z0-9-_.]{1,64}$ (必要) |
屬性 | 映像範本的屬性 | ImageTemplate屬性 |
標記 | 資源標籤 | 標記名稱和值的字典。 請參閱範本中的 標籤 |
型別 | 資源類型 | “Microsoft.VirtualMachineImages/imageTemplates” |
DistributeVersioner
名稱 | 說明 | 價值觀 |
---|---|---|
方案 | 針對 DistributeVersionerLatest 類型,設定為 'Latest'。 針對 DistributeVersionerSource 類型,設定為 'Source'。 | “最新” 'Source' (必要) |
DistributeVersionerLatest
名稱 | 說明 | 價值觀 |
---|---|---|
主要 | 所產生版本號碼的主要版本。 根據以此值作為主要版本的版本,判斷什麼是「最新」。 -1 相當於將它取消設定。 | int 約束: 最小值 = -1 |
方案 | 要使用的版本編號配置。 | 'Latest' (必要) |
DistributeVersionerSource
名稱 | 說明 | 價值觀 |
---|---|---|
方案 | 要使用的版本編號配置。 | 'Source' (必要) |
ImageTemplate自動運行
名稱 | 說明 | 價值觀 |
---|---|---|
狀態 | 啟用此欄位將會在映像範本建立或更新時觸發自動建置。 | “已禁用” “已啟用” |
ImageTemplate定製器
名稱 | 說明 | 價值觀 |
---|---|---|
名稱 | 易記名稱,提供此自定義步驟的內容 | 字串 |
型別 | 設定為 ImageTemplateFileCustomizer 類型的 'File'。 設定為 ImageTemplatePowerShellCustomizer 類型的 'PowerShell'。 設定為 ImageTemplateShellCustomizer 類型的 'Shell'。 針對 imageTemplateRestartCustomizer類型 |
“檔” “PowerShell” “殼” “Windows重啟” 'WindowsUpdate' (必要) |
ImageTemplateDistributor
名稱 | 說明 | 價值觀 |
---|---|---|
artifact標籤 | 散發者建立/更新成品后,將會套用至成品的標記。 | ImageTemplateDistributorArtifact標籤 |
runOutputName (運行輸出名稱) | 要用於相關聯 RunOutput 的名稱。 | 字串 約束: 模式 = ^[A-Za-z0-9-_.]{1,64}$ (必要) |
型別 | 設定為 ImageTemplateManagedImageDistributor 類型的 『ManagedImage』。 設定為 ImageTemplateSharedImageDistributor 類型的 'SharedImage'。 設定為 ImageTemplateVhdDistributor 類型的 'VHD'。 | “ManagedImage” “共用圖像” 'VHD' (必要) |
ImageTemplateDistributorArtifact標籤
名稱 | 說明 | 價值觀 |
---|
ImageTemplateFile定製器
名稱 | 說明 | 價值觀 |
---|---|---|
目的地 | 檔案的絕對路徑(已建立巢狀目錄結構),其中檔案 (from sourceUri) 會在 VM 中上傳至 | 字串 |
sha256校驗和 | 上述 sourceUri 字段中提供的檔案 SHA256 總和檢查碼 | 字串 |
sourceUri 的 | 要上傳以自定義 VM 之檔案的 URI。 它可以是 Github 連結、Azure 記憶體的 SAS URI 等等 | 字串 |
型別 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 'File' (必要) |
ImageTemplateFileValidator
名稱 | 說明 | 價值觀 |
---|---|---|
目的地 | 檔案的絕對路徑(已建立巢狀目錄結構),其中檔案 (from sourceUri) 會在 VM 中上傳至 | 字串 |
sha256校驗和 | 上述 sourceUri 字段中提供的檔案 SHA256 總和檢查碼 | 字串 |
sourceUri 的 | 要上傳至 VM 以進行驗證之檔案的 URI。 它可以是 github 連結、Azure 記憶體 URI(已授權或 SAS),等等 | 字串 |
型別 | 您想要在 Image 上使用的驗證類型。 例如,“Shell” 可以是殼層驗證 | 'File' (必要) |
ImageTemplateIdentity
名稱 | 說明 | 價值觀 |
---|---|---|
型別 | 用於映像範本的身分識別類型。 類型 『None』 會從映像範本中移除任何身分識別。 | “無” 'UserAssigned' |
使用者指派的身份 | 與資源相關聯的使用者指派身分識別集。 userAssignedIdentities 字典索引鍵的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}。 字典值可以是要求中的空白物件({})。 | UserAssignedIdentities |
ImageTemplateInVMValidator
名稱 | 說明 | 價值觀 |
---|---|---|
名稱 | 易記名稱,提供此驗證步驟的內容 | 字串 |
型別 | 設定為 ImageTemplateFileValidator 類型的 'File'。 設定為 ImageTemplatePowerShellValidator 類型的 'PowerShell'。 設定為 ImageTemplateShellValidator 類型的 『Shell』。 | “檔” “PowerShell” 'Shell' (必要) |
ImageTemplateManagedImageDistributor
名稱 | 說明 | 價值觀 |
---|---|---|
圖像ID | 受控磁碟映像的資源標識碼 | 字串 (必要) |
位置 | 映射的 Azure 位置,如果映射已經存在,則應該相符 | 字串 (必要) |
型別 | 分佈類型。 | 'ManagedImage' (必要) |
ImageTemplateManagedImageSource (英文)
名稱 | 說明 | 價值觀 |
---|---|---|
圖像ID | 客戶訂用帳戶中受控映像的 ARM 資源識別碼 | 字串 (必要) |
型別 | 指定您想要開頭的來源影像類型。 | 'ManagedImage' (必要) |
ImageTemplatePlatformImageSource
名稱 | 說明 | 價值觀 |
---|---|---|
供應項目 | azure 資源庫映像 |
字串 |
計劃資訊 | 平臺映像的選擇性購買方案設定。 | 平臺圖片購買計劃 |
發行者 | Azure 資源庫映射中的映像發行者。 | 字串 |
SKU | 來自 Azure 資源庫映像的映像 SKU。 | 字串 |
型別 | 指定您想要開頭的來源影像類型。 | 'PlatformImage' (必要) |
版本 | 來自 Azure 資源庫映像的映像版本。 如果在這裡指定了 'latest',則會在映射組建發生時評估版本,而不是在提交範本時評估。 | 字串 |
ImageTemplatePowerShellCustomizer
名稱 | 說明 | 價值觀 |
---|---|---|
內嵌 | 要執行的PowerShell命令陣列 | 字串[] |
runAsSystem | 如果指定,PowerShell 腳本將會使用本機系統使用者提高的許可權來執行。 只有當上述 runElevated 字段設定為 true 時,才能為 true。 | 布爾 (bool) |
runElevated 的 | 如果指定,PowerShell 腳本將會以更高的許可權執行 | 布爾 (bool) |
scriptUri 的 | 要執行以進行自定義之 PowerShell 腳本的 URI。 它可以是 Github 連結、Azure 記憶體的 SAS URI 等等 | 字串 |
sha256校驗和 | 上述 scriptUri 字段中提供的 Power Shell 腳本 SHA256 總和檢查碼 | 字串 |
型別 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 'PowerShell' (必要) |
有效退出代碼 | PowerShell 腳本的有效結束代碼。 [預設值: 0] | int[] |
ImageTemplatePowerShellValidator
名稱 | 說明 | 價值觀 |
---|---|---|
內嵌 | 要執行的PowerShell命令陣列 | 字串[] |
runAsSystem | 如果指定,PowerShell 腳本將會使用本機系統使用者提高的許可權來執行。 只有當上述 runElevated 字段設定為 true 時,才能為 true。 | 布爾 (bool) |
runElevated 的 | 如果指定,PowerShell 腳本將會以更高的許可權執行 | 布爾 (bool) |
scriptUri 的 | 要執行以進行驗證的PowerShell腳本 URI。 它可以是 github 連結、Azure 記憶體 URI 等 | 字串 |
sha256校驗和 | 上述 scriptUri 字段中提供的 Power Shell 腳本 SHA256 總和檢查碼 | 字串 |
型別 | 您想要在 Image 上使用的驗證類型。 例如,“Shell” 可以是殼層驗證 | 'PowerShell' (必要) |
有效退出代碼 | PowerShell 腳本的有效結束代碼。 [預設值: 0] | int[] |
ImageTemplate屬性
名稱 | 說明 | 價值觀 |
---|---|---|
自動運行 | 指出是否要在範本建立或更新時自動執行映像範本組建。 | ImageTemplate自動運行 |
buildTimeoutInMinutes | 建置映像範本時要等候的最大持續時間(包括所有自定義專案、優化、驗證和散發套件)。 省略或指定 0 以使用預設值 (4 小時)。 | int 約束: 最小值 = 0 最大值 = 960 |
自訂 | 指定用來描述映像自定義步驟的屬性,例如影像來源等 | ImageTemplateCustomizer[] |
散發 | 影像輸出需要前往的散發目標。 | ImageTemplateDistributor[] (必要) |
錯誤處理 | 建置失敗時的錯誤處理選項 | ImageTemplatePropertiesErrorHandling |
managedResource標籤 | 將套用至服務所建立之資源群組和/或資源的標記。 | ImageTemplatePropertiesManagedResourceTags |
最佳化 | 指定要在映像上執行的優化。 | ImageTemplateProperties優化 |
來源 | 指定用來描述來源影像的屬性。 | ImageTemplateSource (必要) |
stagingResourceGroup 的 | 與用來建置映像之映像範本相同訂用帳戶中的預備資源群組標識碼。 如果此欄位是空的,將會建立具有隨機名稱的資源群組。 如果此欄位中指定的資源群組不存在,則會以相同的名稱建立。 如果指定的資源群組存在,它必須是空的,且位於與映像範本相同的區域中。 如果此欄位是空的,或指定的資源群組不存在,則會在範本刪除期間刪除建立的資源群組,但如果指定的資源群組存在,則會在範本刪除期間刪除資源群組,而且資源群組本身將會保留。 | 字串 |
確認 | 要對產生的映像執行的組態選項和驗證清單。 | ImageTemplateProperties驗證 |
vm配置檔 | 描述虛擬機如何設定以建置映像 | ImageTemplateVmProfile |
ImageTemplatePropertiesErrorHandling
名稱 | 說明 | 價值觀 |
---|---|---|
onCustomizerError | 如果自定義工具發生錯誤,且此字段設定為 「清除」,則會清除組建 VM 和相關聯的網路資源。 此為預設行為。 如果自定義工具發生錯誤,且此字段設定為 「中止」,則會保留組建 VM。 | 'abort' '清理' |
onValidationError | 如果發生驗證錯誤,且此字段設定為 「清除」,則會清除組建 VM 和相關聯的網路資源。 此為預設行為。 如果發生驗證錯誤,且此字段設定為 『abort』,則會保留組建 VM。 | 'abort' '清理' |
ImageTemplatePropertiesManagedResourceTags
名稱 | 說明 | 價值觀 |
---|
ImageTemplateProperties優化
名稱 | 說明 | 價值觀 |
---|---|---|
vm引導 | 優化會在映像上套用,以加快 VM 開機速度。 | ImageTemplatePropertiesOptimizeVmBoot |
ImageTemplatePropertiesOptimizeVmBoot
名稱 | 說明 | 價值觀 |
---|---|---|
狀態 | 啟用此欄位可藉由優化最終自定義映像輸出來改善 VM 開機時間。 | “已禁用” “已啟用” |
ImageTemplateProperties驗證
名稱 | 說明 | 價值觀 |
---|---|---|
continueDistributeOnFailure | 如果驗證失敗,且此字段設定為 false,則不會散發輸出影像。 此為預設行為。 如果驗證失敗,且此字段設定為 true,輸出影像仍會散發。 請謹慎使用此選項,因為它可能會導致散發不正確的映像以供使用。 不論是哪一種情況(true 或 false),端對端映射執行都會回報為在驗證失敗時失敗。 [注意:如果驗證成功,此字段就沒有作用。] | 布爾 (bool) |
inVMValidations | 要執行的驗證清單。 | ImageTemplateInVMValidator[] |
sourceValidationOnly | 如果此欄位設定為 true,則會直接驗證 'source' 區段中指定的影像。 不會執行個別的組建來產生,然後驗證自定義映像。 | 布爾 (bool) |
ImageTemplateRestartCustomizer
名稱 | 說明 | 價值觀 |
---|---|---|
restartCheck命令 | 檢查重新啟動是否成功的命令 [預設值: ''] | 字串 |
restart命令 | 執行重新啟動的命令 [預設值: 'shutdown /r /f /t 0 /c “packer restart”'] | 字串 |
restart超時 | 指定為大小和單位字串的重新啟動逾時,例如 '5m' (5 分鐘) 或 '2h' (2 小時) [預設值: '5m'] | 字串 |
型別 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 'WindowsRestart' (必要) |
ImageTemplateSharedImageDistributor
名稱 | 說明 | 價值觀 |
---|---|---|
從最新排除 | 旗標,指出是否應該從最新版本中排除已建立的映像版本。 請省略以使用預設值 (false)。 | 布爾 (bool) |
galleryImageId | Azure 計算資源庫映像的資源標識碼 | 字串 (必要) |
replication區域 | [已淘汰]將複寫映像的區域清單。 只有在未指定 targetRegions 時,才能指定此列表。 此欄位已被取代 - 請改用 targetRegions。 | 字串[] |
儲存帳戶類型 | [已淘汰]用來儲存共用映像的記憶體帳戶類型。 請省略以使用預設值 (Standard_LRS)。 只有在指定 replicationRegions 時,才能指定此字段。 此欄位已被取代 - 請改用 targetRegions。 | “Premium_LRS” “Standard_LRS” “Standard_ZRS” |
目標區域 | 要復寫分散式映像版本的目標區域。 這個物件會取代 replicationRegions,而且只有在未指定 replicationRegions 時才可指定。 | 目標區域 |
型別 | 分佈類型。 | 'SharedImage' (必要) |
版本設定 | 描述如何為散發產生新的 x.y.z 版本號碼。 | DistributeVersioner |
ImageTemplateSharedImageVersionSource
名稱 | 說明 | 價值觀 |
---|---|---|
imageVersionId (圖片版本標識) | 映像版本的 ARM 資源識別碼。 映射版本名稱為「最新」時,映射組建發生時會評估版本。 | 字串 (必要) |
型別 | 指定您想要開頭的來源影像類型。 | 'SharedImageVersion' (必要) |
ImageTemplateShellCustomizer
名稱 | 說明 | 價值觀 |
---|---|---|
內嵌 | 要執行的殼層命令陣列 | 字串[] |
scriptUri 的 | 要執行以進行自定義之殼層腳本的 URI。 它可以是 Github 連結、Azure 記憶體的 SAS URI 等等 | 字串 |
sha256校驗和 | scriptUri 字段中提供的Shell腳本 SHA256 總和檢查碼 | 字串 |
型別 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 'Shell' (必要) |
ImageTemplateShellValidator
名稱 | 說明 | 價值觀 |
---|---|---|
內嵌 | 要執行的殼層命令陣列 | 字串[] |
scriptUri 的 | 要執行以進行驗證的殼層腳本 URI。 它可以是 github 連結、Azure 記憶體 URI 等 | 字串 |
sha256校驗和 | scriptUri 字段中提供的Shell腳本 SHA256 總和檢查碼 | 字串 |
型別 | 您想要在 Image 上使用的驗證類型。 例如,“Shell” 可以是殼層驗證 | 'Shell' (必要) |
ImageTemplateSource (影像樣本源)
名稱 | 說明 | 價值觀 |
---|---|---|
型別 | 設定為 ImageTemplateManagedImageSource 類型的 'ManagedImage'。 設定為 ImageTemplatePlatformImageSource 類型的 'PlatformImage'。 設定為 ImageTemplateSharedImageVersionSource 類型的 'SharedImageVersion'。 | “ManagedImage” '平臺圖像' 'SharedImageVersion' (必要) |
ImageTemplateVhdDistributor
名稱 | 說明 | 價值觀 |
---|---|---|
型別 | 分佈類型。 | 'VHD' (必要) |
統一資源識別碼 (URI) | 分散式 VHD Blob 的選擇性 Azure 記憶體 URI。 省略以使用預設的 (空字串),在此情況下,VHD 會發佈至預備資源群組中的記憶體帳戶。 | 字串 |
ImageTemplateVmProfile
名稱 | 說明 | 價值觀 |
---|---|---|
osDiskSizeGB | 以 GB 為單位的 OS 磁碟大小。 省略或指定 0 以使用 Azure 的預設 OS 磁碟大小。 | int 約束: 最小值 = 0 |
使用者指派的身份 | 在組建 VM 和驗證 VM 上設定的使用者指派受控識別資源標識碼的選擇性數位。 這可能包括映像範本的身分識別。 | 字串[] |
vmSize | 用來建置、自定義和擷取映像的虛擬機大小。 省略或指定空字串,以使用 Gen1 映像的預設值 (Standard_D1_v2,以及 Gen2 映射的Standard_D2ds_v4)。 | 字串 |
vnetConfig | 用來部署組建 VM 和驗證 VM 的虛擬網路選擇性設定。 如果不需要使用任何特定的虛擬網路,請省略 。 | 虛擬網路配置 |
ImageTemplateWindowsUpdateCustomizer
名稱 | 說明 | 價值觀 |
---|---|---|
過濾器 | 要選取要套用之更新的篩選陣列。 省略或指定空陣列以使用預設值 (沒有篩選條件)。 如需此欄位的範例和詳細描述,請參閱上述連結。 | 字串[] |
搜索條件 | 搜尋更新的準則。 省略或指定空字串以使用預設值(全部搜尋)。 如需此欄位的範例和詳細描述,請參閱上述連結。 | 字串 |
型別 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 'WindowsUpdate' (必要) |
updateLimit | 一次要套用的更新數目上限。 省略或指定 0 以使用預設值 (1000) | int 約束: 最小值 = 0 |
平臺圖片購買計劃
名稱 | 說明 | 價值觀 |
---|---|---|
計畫名稱 | 購買方案的名稱。 | 字串 (必要) |
計劃產品 | 購買方案的產品。 | 字串 (必要) |
planPublisher | 購買方案的發行者。 | 字串 (必要) |
目標區域
名稱 | 說明 | 價值觀 |
---|---|---|
名稱 | 區域的名稱。 | 字串 (必要) |
副本數量 | 要在此區域中建立之映像版本的複本數目。 省略以使用預設值 (1)。 | int 約束: 最小值 = 1 |
儲存帳戶類型 | 指定要用來在此區域中儲存映像的記憶體帳戶類型。 請省略以使用預設值 (Standard_LRS)。 | “Premium_LRS” “Standard_LRS” “Standard_ZRS” |
TrackedResourceTags
名稱 | 說明 | 價值觀 |
---|
UserAssignedIdentities
名稱 | 說明 | 價值觀 |
---|
UserAssignedIdentity
名稱 | 說明 | 價值觀 |
---|
虛擬網路配置
名稱 | 說明 | 價值觀 |
---|---|---|
containerInstanceSubnetId | 將針對隔離組建部署 Azure 容器實例之預先存在的子網資源標識碼。 只有在subnetId 同時指定且必須與 中指定的subnetId 子網位於相同的 虛擬網絡 時,才能指定此欄位。 |
字串 |
proxyVm大小 | 用來將流量傳遞至組建 VM 和驗證 VM 的 Proxy 虛擬機大小。 如果未 containerInstanceSubnetId 指定,則不得指定此項目,因為在此情況下不會部署 Proxy 虛擬機。 省略或指定空字串以使用預設值 (Standard_A1_v2)。 |
字串 |
子網ID | 將部署組建 VM 和驗證 VM 之預先存在的子網資源識別碼 | 字串 |
使用範例
Azure 快速入門範本
下列 Azure 快速入門範本 部署此資源類型。
範本 | 說明 |
---|---|
使用 Azure Windows 基準 |
建立 Azure Image Builder 環境,並建置已套用最新 Windows Update 和 Azure Windows 基準的 Windows Server 映射。 |
設定開發箱服務 |
此範本會根據 Dev Box 快速入門指南 (/azure/dev-box/quickstart-create-dev-box) 建立所有 Dev Box 管理員資源。 您可以檢視所有建立的資源,或直接移至 DevPortal.microsoft.com 來建立您的第一個開發方塊。 |
Terraform (AzAPI 提供者) 資源定義
imageTemplates 資源類型可以使用目標作業來部署:
- 資源群組
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。
資源格式
若要建立 Microsoft.VirtualMachineImages/imageTemplates 資源,請將下列 Terraform 新增至範本。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.VirtualMachineImages/imageTemplates@2024-02-01"
name = "string"
parent_id = "string"
identity {
type = "string"
identity_ids = [
"string"
]
}
location = "string"
tags = {
{customized property} = "string"
}
body = {
properties = {
autoRun = {
state = "string"
}
buildTimeoutInMinutes = int
customize = [
{
name = "string"
type = "string"
// For remaining properties, see ImageTemplateCustomizer objects
}
]
distribute = [
{
artifactTags = {
{customized property} = "string"
}
runOutputName = "string"
type = "string"
// For remaining properties, see ImageTemplateDistributor objects
}
]
errorHandling = {
onCustomizerError = "string"
onValidationError = "string"
}
managedResourceTags = {
{customized property} = "string"
}
optimize = {
vmBoot = {
state = "string"
}
}
source = {
type = "string"
// For remaining properties, see ImageTemplateSource objects
}
stagingResourceGroup = "string"
validate = {
continueDistributeOnFailure = bool
inVMValidations = [
{
name = "string"
type = "string"
// For remaining properties, see ImageTemplateInVMValidator objects
}
]
sourceValidationOnly = bool
}
vmProfile = {
osDiskSizeGB = int
userAssignedIdentities = [
"string"
]
vmSize = "string"
vnetConfig = {
containerInstanceSubnetId = "string"
proxyVmSize = "string"
subnetId = "string"
}
}
}
}
}
ImageTemplateSource 物件
設定 類型 屬性,以指定物件的類型。
針對 ManagedImage,請使用:
{
imageId = "string"
type = "ManagedImage"
}
針對 PlatformImage,請使用:
{
offer = "string"
planInfo = {
planName = "string"
planProduct = "string"
planPublisher = "string"
}
publisher = "string"
sku = "string"
type = "PlatformImage"
version = "string"
}
針對 SharedImageVersion,請使用:
{
imageVersionId = "string"
type = "SharedImageVersion"
}
ImageTemplateCustomizer 物件
設定 類型 屬性,以指定物件的類型。
針對 [檔案],請使用:
{
destination = "string"
sha256Checksum = "string"
sourceUri = "string"
type = "File"
}
針對 PowerShell,請使用:
{
inline = [
"string"
]
runAsSystem = bool
runElevated = bool
scriptUri = "string"
sha256Checksum = "string"
type = "PowerShell"
validExitCodes = [
int
]
}
針對 Shell,請使用:
{
inline = [
"string"
]
scriptUri = "string"
sha256Checksum = "string"
type = "Shell"
}
針對 windowsRestart
{
restartCheckCommand = "string"
restartCommand = "string"
restartTimeout = "string"
type = "WindowsRestart"
}
針對 WindowsUpdate,請使用:
{
filters = [
"string"
]
searchCriteria = "string"
type = "WindowsUpdate"
updateLimit = int
}
DistributeVersioner 物件
設定 scheme 屬性以指定 物件的類型。
針對 最新版,請使用:
{
major = int
scheme = "Latest"
}
針對 Source,請使用:
{
scheme = "Source"
}
ImageTemplateDistributor 物件
設定 類型 屬性,以指定物件的類型。
針對 ManagedImage,請使用:
{
imageId = "string"
location = "string"
type = "ManagedImage"
}
針對 SharedImage,請使用:
{
excludeFromLatest = bool
galleryImageId = "string"
replicationRegions = [
"string"
]
storageAccountType = "string"
targetRegions = [
{
name = "string"
replicaCount = int
storageAccountType = "string"
}
]
type = "SharedImage"
versioning = {
scheme = "string"
// For remaining properties, see DistributeVersioner objects
}
}
針對 VHD,請使用:
{
type = "VHD"
uri = "string"
}
ImageTemplateInVMValidator 物件
設定 類型 屬性,以指定物件的類型。
針對 [檔案],請使用:
{
destination = "string"
sha256Checksum = "string"
sourceUri = "string"
type = "File"
}
針對 PowerShell,請使用:
{
inline = [
"string"
]
runAsSystem = bool
runElevated = bool
scriptUri = "string"
sha256Checksum = "string"
type = "PowerShell"
validExitCodes = [
int
]
}
針對 Shell,請使用:
{
inline = [
"string"
]
scriptUri = "string"
sha256Checksum = "string"
type = "Shell"
}
屬性值
Microsoft.VirtualMachineImages/imageTemplates
名稱 | 說明 | 價值觀 |
---|---|---|
身分識別 | 如果已設定,則為映像範本的身分識別。 | ImageTemplateIdentity (必要) |
位置 | 資源所在的地理位置 | 字串 (必要) |
名稱 | 資源名稱 | 字串 約束: 模式 = ^[A-Za-z0-9-_.]{1,64}$ (必要) |
屬性 | 映像範本的屬性 | ImageTemplate屬性 |
標記 | 資源標籤 | 標記名稱和值的字典。 |
型別 | 資源類型 | “Microsoft.VirtualMachineImages/imageTemplates@2024-02-01” |
DistributeVersioner
名稱 | 說明 | 價值觀 |
---|---|---|
方案 | 針對 DistributeVersionerLatest 類型,設定為 'Latest'。 針對 DistributeVersionerSource 類型,設定為 'Source'。 | “最新” 'Source' (必要) |
DistributeVersionerLatest
名稱 | 說明 | 價值觀 |
---|---|---|
主要 | 所產生版本號碼的主要版本。 根據以此值作為主要版本的版本,判斷什麼是「最新」。 -1 相當於將它取消設定。 | int 約束: 最小值 = -1 |
方案 | 要使用的版本編號配置。 | 'Latest' (必要) |
DistributeVersionerSource
名稱 | 說明 | 價值觀 |
---|---|---|
方案 | 要使用的版本編號配置。 | 'Source' (必要) |
ImageTemplate自動運行
名稱 | 說明 | 價值觀 |
---|---|---|
狀態 | 啟用此欄位將會在映像範本建立或更新時觸發自動建置。 | “已禁用” “已啟用” |
ImageTemplate定製器
名稱 | 說明 | 價值觀 |
---|---|---|
名稱 | 易記名稱,提供此自定義步驟的內容 | 字串 |
型別 | 設定為 ImageTemplateFileCustomizer 類型的 'File'。 設定為 ImageTemplatePowerShellCustomizer 類型的 'PowerShell'。 設定為 ImageTemplateShellCustomizer 類型的 'Shell'。 針對 imageTemplateRestartCustomizer類型 |
“檔” “PowerShell” “殼” “Windows重啟” 'WindowsUpdate' (必要) |
ImageTemplateDistributor
名稱 | 說明 | 價值觀 |
---|---|---|
artifact標籤 | 散發者建立/更新成品后,將會套用至成品的標記。 | ImageTemplateDistributorArtifact標籤 |
runOutputName (運行輸出名稱) | 要用於相關聯 RunOutput 的名稱。 | 字串 約束: 模式 = ^[A-Za-z0-9-_.]{1,64}$ (必要) |
型別 | 設定為 ImageTemplateManagedImageDistributor 類型的 『ManagedImage』。 設定為 ImageTemplateSharedImageDistributor 類型的 'SharedImage'。 設定為 ImageTemplateVhdDistributor 類型的 'VHD'。 | “ManagedImage” “共用圖像” 'VHD' (必要) |
ImageTemplateDistributorArtifact標籤
名稱 | 說明 | 價值觀 |
---|
ImageTemplateFile定製器
名稱 | 說明 | 價值觀 |
---|---|---|
目的地 | 檔案的絕對路徑(已建立巢狀目錄結構),其中檔案 (from sourceUri) 會在 VM 中上傳至 | 字串 |
sha256校驗和 | 上述 sourceUri 字段中提供的檔案 SHA256 總和檢查碼 | 字串 |
sourceUri 的 | 要上傳以自定義 VM 之檔案的 URI。 它可以是 Github 連結、Azure 記憶體的 SAS URI 等等 | 字串 |
型別 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 'File' (必要) |
ImageTemplateFileValidator
名稱 | 說明 | 價值觀 |
---|---|---|
目的地 | 檔案的絕對路徑(已建立巢狀目錄結構),其中檔案 (from sourceUri) 會在 VM 中上傳至 | 字串 |
sha256校驗和 | 上述 sourceUri 字段中提供的檔案 SHA256 總和檢查碼 | 字串 |
sourceUri 的 | 要上傳至 VM 以進行驗證之檔案的 URI。 它可以是 github 連結、Azure 記憶體 URI(已授權或 SAS),等等 | 字串 |
型別 | 您想要在 Image 上使用的驗證類型。 例如,“Shell” 可以是殼層驗證 | 'File' (必要) |
ImageTemplateIdentity
名稱 | 說明 | 價值觀 |
---|---|---|
型別 | 用於映像範本的身分識別類型。 類型 『None』 會從映像範本中移除任何身分識別。 | “無” 'UserAssigned' |
使用者指派的身份 | 與資源相關聯的使用者指派身分識別集。 userAssignedIdentities 字典索引鍵的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}。 字典值可以是要求中的空白物件({})。 | UserAssignedIdentities |
ImageTemplateInVMValidator
名稱 | 說明 | 價值觀 |
---|---|---|
名稱 | 易記名稱,提供此驗證步驟的內容 | 字串 |
型別 | 設定為 ImageTemplateFileValidator 類型的 'File'。 設定為 ImageTemplatePowerShellValidator 類型的 'PowerShell'。 設定為 ImageTemplateShellValidator 類型的 『Shell』。 | “檔” “PowerShell” 'Shell' (必要) |
ImageTemplateManagedImageDistributor
名稱 | 說明 | 價值觀 |
---|---|---|
圖像ID | 受控磁碟映像的資源標識碼 | 字串 (必要) |
位置 | 映射的 Azure 位置,如果映射已經存在,則應該相符 | 字串 (必要) |
型別 | 分佈類型。 | 'ManagedImage' (必要) |
ImageTemplateManagedImageSource (英文)
名稱 | 說明 | 價值觀 |
---|---|---|
圖像ID | 客戶訂用帳戶中受控映像的 ARM 資源識別碼 | 字串 (必要) |
型別 | 指定您想要開頭的來源影像類型。 | 'ManagedImage' (必要) |
ImageTemplatePlatformImageSource
名稱 | 說明 | 價值觀 |
---|---|---|
供應項目 | azure 資源庫映像 |
字串 |
計劃資訊 | 平臺映像的選擇性購買方案設定。 | 平臺圖片購買計劃 |
發行者 | Azure 資源庫映射中的映像發行者。 | 字串 |
SKU | 來自 Azure 資源庫映像的映像 SKU。 | 字串 |
型別 | 指定您想要開頭的來源影像類型。 | 'PlatformImage' (必要) |
版本 | 來自 Azure 資源庫映像的映像版本。 如果在這裡指定了 'latest',則會在映射組建發生時評估版本,而不是在提交範本時評估。 | 字串 |
ImageTemplatePowerShellCustomizer
名稱 | 說明 | 價值觀 |
---|---|---|
內嵌 | 要執行的PowerShell命令陣列 | 字串[] |
runAsSystem | 如果指定,PowerShell 腳本將會使用本機系統使用者提高的許可權來執行。 只有當上述 runElevated 字段設定為 true 時,才能為 true。 | 布爾 (bool) |
runElevated 的 | 如果指定,PowerShell 腳本將會以更高的許可權執行 | 布爾 (bool) |
scriptUri 的 | 要執行以進行自定義之 PowerShell 腳本的 URI。 它可以是 Github 連結、Azure 記憶體的 SAS URI 等等 | 字串 |
sha256校驗和 | 上述 scriptUri 字段中提供的 Power Shell 腳本 SHA256 總和檢查碼 | 字串 |
型別 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 'PowerShell' (必要) |
有效退出代碼 | PowerShell 腳本的有效結束代碼。 [預設值: 0] | int[] |
ImageTemplatePowerShellValidator
名稱 | 說明 | 價值觀 |
---|---|---|
內嵌 | 要執行的PowerShell命令陣列 | 字串[] |
runAsSystem | 如果指定,PowerShell 腳本將會使用本機系統使用者提高的許可權來執行。 只有當上述 runElevated 字段設定為 true 時,才能為 true。 | 布爾 (bool) |
runElevated 的 | 如果指定,PowerShell 腳本將會以更高的許可權執行 | 布爾 (bool) |
scriptUri 的 | 要執行以進行驗證的PowerShell腳本 URI。 它可以是 github 連結、Azure 記憶體 URI 等 | 字串 |
sha256校驗和 | 上述 scriptUri 字段中提供的 Power Shell 腳本 SHA256 總和檢查碼 | 字串 |
型別 | 您想要在 Image 上使用的驗證類型。 例如,“Shell” 可以是殼層驗證 | 'PowerShell' (必要) |
有效退出代碼 | PowerShell 腳本的有效結束代碼。 [預設值: 0] | int[] |
ImageTemplate屬性
名稱 | 說明 | 價值觀 |
---|---|---|
自動運行 | 指出是否要在範本建立或更新時自動執行映像範本組建。 | ImageTemplate自動運行 |
buildTimeoutInMinutes | 建置映像範本時要等候的最大持續時間(包括所有自定義專案、優化、驗證和散發套件)。 省略或指定 0 以使用預設值 (4 小時)。 | int 約束: 最小值 = 0 最大值 = 960 |
自訂 | 指定用來描述映像自定義步驟的屬性,例如影像來源等 | ImageTemplateCustomizer[] |
散發 | 影像輸出需要前往的散發目標。 | ImageTemplateDistributor[] (必要) |
錯誤處理 | 建置失敗時的錯誤處理選項 | ImageTemplatePropertiesErrorHandling |
managedResource標籤 | 將套用至服務所建立之資源群組和/或資源的標記。 | ImageTemplatePropertiesManagedResourceTags |
最佳化 | 指定要在映像上執行的優化。 | ImageTemplateProperties優化 |
來源 | 指定用來描述來源影像的屬性。 | ImageTemplateSource (必要) |
stagingResourceGroup 的 | 與用來建置映像之映像範本相同訂用帳戶中的預備資源群組標識碼。 如果此欄位是空的,將會建立具有隨機名稱的資源群組。 如果此欄位中指定的資源群組不存在,則會以相同的名稱建立。 如果指定的資源群組存在,它必須是空的,且位於與映像範本相同的區域中。 如果此欄位是空的,或指定的資源群組不存在,則會在範本刪除期間刪除建立的資源群組,但如果指定的資源群組存在,則會在範本刪除期間刪除資源群組,而且資源群組本身將會保留。 | 字串 |
確認 | 要對產生的映像執行的組態選項和驗證清單。 | ImageTemplateProperties驗證 |
vm配置檔 | 描述虛擬機如何設定以建置映像 | ImageTemplateVmProfile |
ImageTemplatePropertiesErrorHandling
名稱 | 說明 | 價值觀 |
---|---|---|
onCustomizerError | 如果自定義工具發生錯誤,且此字段設定為 「清除」,則會清除組建 VM 和相關聯的網路資源。 此為預設行為。 如果自定義工具發生錯誤,且此字段設定為 「中止」,則會保留組建 VM。 | 'abort' '清理' |
onValidationError | 如果發生驗證錯誤,且此字段設定為 「清除」,則會清除組建 VM 和相關聯的網路資源。 此為預設行為。 如果發生驗證錯誤,且此字段設定為 『abort』,則會保留組建 VM。 | 'abort' '清理' |
ImageTemplatePropertiesManagedResourceTags
名稱 | 說明 | 價值觀 |
---|
ImageTemplateProperties優化
名稱 | 說明 | 價值觀 |
---|---|---|
vm引導 | 優化會在映像上套用,以加快 VM 開機速度。 | ImageTemplatePropertiesOptimizeVmBoot |
ImageTemplatePropertiesOptimizeVmBoot
名稱 | 說明 | 價值觀 |
---|---|---|
狀態 | 啟用此欄位可藉由優化最終自定義映像輸出來改善 VM 開機時間。 | “已禁用” “已啟用” |
ImageTemplateProperties驗證
名稱 | 說明 | 價值觀 |
---|---|---|
continueDistributeOnFailure | 如果驗證失敗,且此字段設定為 false,則不會散發輸出影像。 此為預設行為。 如果驗證失敗,且此字段設定為 true,輸出影像仍會散發。 請謹慎使用此選項,因為它可能會導致散發不正確的映像以供使用。 不論是哪一種情況(true 或 false),端對端映射執行都會回報為在驗證失敗時失敗。 [注意:如果驗證成功,此字段就沒有作用。] | 布爾 (bool) |
inVMValidations | 要執行的驗證清單。 | ImageTemplateInVMValidator[] |
sourceValidationOnly | 如果此欄位設定為 true,則會直接驗證 'source' 區段中指定的影像。 不會執行個別的組建來產生,然後驗證自定義映像。 | 布爾 (bool) |
ImageTemplateRestartCustomizer
名稱 | 說明 | 價值觀 |
---|---|---|
restartCheck命令 | 檢查重新啟動是否成功的命令 [預設值: ''] | 字串 |
restart命令 | 執行重新啟動的命令 [預設值: 'shutdown /r /f /t 0 /c “packer restart”'] | 字串 |
restart超時 | 指定為大小和單位字串的重新啟動逾時,例如 '5m' (5 分鐘) 或 '2h' (2 小時) [預設值: '5m'] | 字串 |
型別 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 'WindowsRestart' (必要) |
ImageTemplateSharedImageDistributor
名稱 | 說明 | 價值觀 |
---|---|---|
從最新排除 | 旗標,指出是否應該從最新版本中排除已建立的映像版本。 請省略以使用預設值 (false)。 | 布爾 (bool) |
galleryImageId | Azure 計算資源庫映像的資源標識碼 | 字串 (必要) |
replication區域 | [已淘汰]將複寫映像的區域清單。 只有在未指定 targetRegions 時,才能指定此列表。 此欄位已被取代 - 請改用 targetRegions。 | 字串[] |
儲存帳戶類型 | [已淘汰]用來儲存共用映像的記憶體帳戶類型。 請省略以使用預設值 (Standard_LRS)。 只有在指定 replicationRegions 時,才能指定此字段。 此欄位已被取代 - 請改用 targetRegions。 | “Premium_LRS” “Standard_LRS” “Standard_ZRS” |
目標區域 | 要復寫分散式映像版本的目標區域。 這個物件會取代 replicationRegions,而且只有在未指定 replicationRegions 時才可指定。 | 目標區域 |
型別 | 分佈類型。 | 'SharedImage' (必要) |
版本設定 | 描述如何為散發產生新的 x.y.z 版本號碼。 | DistributeVersioner |
ImageTemplateSharedImageVersionSource
名稱 | 說明 | 價值觀 |
---|---|---|
imageVersionId (圖片版本標識) | 映像版本的 ARM 資源識別碼。 映射版本名稱為「最新」時,映射組建發生時會評估版本。 | 字串 (必要) |
型別 | 指定您想要開頭的來源影像類型。 | 'SharedImageVersion' (必要) |
ImageTemplateShellCustomizer
名稱 | 說明 | 價值觀 |
---|---|---|
內嵌 | 要執行的殼層命令陣列 | 字串[] |
scriptUri 的 | 要執行以進行自定義之殼層腳本的 URI。 它可以是 Github 連結、Azure 記憶體的 SAS URI 等等 | 字串 |
sha256校驗和 | scriptUri 字段中提供的Shell腳本 SHA256 總和檢查碼 | 字串 |
型別 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 'Shell' (必要) |
ImageTemplateShellValidator
名稱 | 說明 | 價值觀 |
---|---|---|
內嵌 | 要執行的殼層命令陣列 | 字串[] |
scriptUri 的 | 要執行以進行驗證的殼層腳本 URI。 它可以是 github 連結、Azure 記憶體 URI 等 | 字串 |
sha256校驗和 | scriptUri 字段中提供的Shell腳本 SHA256 總和檢查碼 | 字串 |
型別 | 您想要在 Image 上使用的驗證類型。 例如,“Shell” 可以是殼層驗證 | 'Shell' (必要) |
ImageTemplateSource (影像樣本源)
名稱 | 說明 | 價值觀 |
---|---|---|
型別 | 設定為 ImageTemplateManagedImageSource 類型的 'ManagedImage'。 設定為 ImageTemplatePlatformImageSource 類型的 'PlatformImage'。 設定為 ImageTemplateSharedImageVersionSource 類型的 'SharedImageVersion'。 | “ManagedImage” '平臺圖像' 'SharedImageVersion' (必要) |
ImageTemplateVhdDistributor
名稱 | 說明 | 價值觀 |
---|---|---|
型別 | 分佈類型。 | 'VHD' (必要) |
統一資源識別碼 (URI) | 分散式 VHD Blob 的選擇性 Azure 記憶體 URI。 省略以使用預設的 (空字串),在此情況下,VHD 會發佈至預備資源群組中的記憶體帳戶。 | 字串 |
ImageTemplateVmProfile
名稱 | 說明 | 價值觀 |
---|---|---|
osDiskSizeGB | 以 GB 為單位的 OS 磁碟大小。 省略或指定 0 以使用 Azure 的預設 OS 磁碟大小。 | int 約束: 最小值 = 0 |
使用者指派的身份 | 在組建 VM 和驗證 VM 上設定的使用者指派受控識別資源標識碼的選擇性數位。 這可能包括映像範本的身分識別。 | 字串[] |
vmSize | 用來建置、自定義和擷取映像的虛擬機大小。 省略或指定空字串,以使用 Gen1 映像的預設值 (Standard_D1_v2,以及 Gen2 映射的Standard_D2ds_v4)。 | 字串 |
vnetConfig | 用來部署組建 VM 和驗證 VM 的虛擬網路選擇性設定。 如果不需要使用任何特定的虛擬網路,請省略 。 | 虛擬網路配置 |
ImageTemplateWindowsUpdateCustomizer
名稱 | 說明 | 價值觀 |
---|---|---|
過濾器 | 要選取要套用之更新的篩選陣列。 省略或指定空陣列以使用預設值 (沒有篩選條件)。 如需此欄位的範例和詳細描述,請參閱上述連結。 | 字串[] |
搜索條件 | 搜尋更新的準則。 省略或指定空字串以使用預設值(全部搜尋)。 如需此欄位的範例和詳細描述,請參閱上述連結。 | 字串 |
型別 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 'WindowsUpdate' (必要) |
updateLimit | 一次要套用的更新數目上限。 省略或指定 0 以使用預設值 (1000) | int 約束: 最小值 = 0 |
平臺圖片購買計劃
名稱 | 說明 | 價值觀 |
---|---|---|
計畫名稱 | 購買方案的名稱。 | 字串 (必要) |
計劃產品 | 購買方案的產品。 | 字串 (必要) |
planPublisher | 購買方案的發行者。 | 字串 (必要) |
目標區域
名稱 | 說明 | 價值觀 |
---|---|---|
名稱 | 區域的名稱。 | 字串 (必要) |
副本數量 | 要在此區域中建立之映像版本的複本數目。 省略以使用預設值 (1)。 | int 約束: 最小值 = 1 |
儲存帳戶類型 | 指定要用來在此區域中儲存映像的記憶體帳戶類型。 請省略以使用預設值 (Standard_LRS)。 | “Premium_LRS” “Standard_LRS” “Standard_ZRS” |
TrackedResourceTags
名稱 | 說明 | 價值觀 |
---|
UserAssignedIdentities
名稱 | 說明 | 價值觀 |
---|
UserAssignedIdentity
名稱 | 說明 | 價值觀 |
---|
虛擬網路配置
名稱 | 說明 | 價值觀 |
---|---|---|
containerInstanceSubnetId | 將針對隔離組建部署 Azure 容器實例之預先存在的子網資源標識碼。 只有在subnetId 同時指定且必須與 中指定的subnetId 子網位於相同的 虛擬網絡 時,才能指定此欄位。 |
字串 |
proxyVm大小 | 用來將流量傳遞至組建 VM 和驗證 VM 的 Proxy 虛擬機大小。 如果未 containerInstanceSubnetId 指定,則不得指定此項目,因為在此情況下不會部署 Proxy 虛擬機。 省略或指定空字串以使用預設值 (Standard_A1_v2)。 |
字串 |
子網ID | 將部署組建 VM 和驗證 VM 之預先存在的子網資源識別碼 | 字串 |