Microsoft.VirtualMachineImages imageTemplates 2019-05-01-preview
Bicep 資源定義
imageTemplates 資源類型可以部署到:
- 資源群組 - 請參閱 資源群組部署命令
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄。
資源格式
若要建立 Microsoft.VirtualMachineImages/imageTemplates 資源,請將下列 Bicep 新增至您的範本。
resource symbolicname 'Microsoft.VirtualMachineImages/imageTemplates@2019-05-01-preview' = {
name: 'string'
location: 'string'
tags: {
tagName1: 'tagValue1'
tagName2: 'tagValue2'
}
identity: {
type: 'string'
userAssignedIdentities: {}
}
properties: {
buildTimeoutInMinutes: int
customize: [
{
name: 'string'
type: 'string'
// For remaining properties, see ImageTemplateCustomizer objects
}
]
distribute: [
{
artifactTags: {}
runOutputName: 'string'
type: 'string'
// For remaining properties, see ImageTemplateDistributor objects
}
]
source: {
type: 'string'
// For remaining properties, see ImageTemplateSource objects
}
vmProfile: {
vmSize: 'string'
}
}
}
ImageTemplateCustomizer 物件
設定 type 屬性以指定物件的類型。
針對 [檔案],請使用:
type: 'File'
destination: 'string'
sha256Checksum: 'string'
sourceUri: 'string'
針對 PowerShell,請使用:
type: 'PowerShell'
inline: [
'string'
]
runElevated: bool
scriptUri: 'string'
sha256Checksum: 'string'
validExitCodes: [
int
]
針對 Shell,請使用:
type: 'Shell'
inline: [
'string'
]
scriptUri: 'string'
sha256Checksum: 'string'
針對 WindowsRestart,請使用:
type: 'WindowsRestart'
restartCheckCommand: 'string'
restartCommand: 'string'
restartTimeout: 'string'
ImageTemplateDistributor 物件
設定 type 屬性以指定物件的類型。
針對 ManagedImage,請使用:
type: 'ManagedImage'
imageId: 'string'
location: 'string'
針對 SharedImage,請使用:
type: 'SharedImage'
galleryImageId: 'string'
replicationRegions: [
'string'
]
針對 VHD,請使用:
type: 'VHD'
ImageTemplateSource 物件
設定 type 屬性以指定物件的類型。
針對 ISO,請使用:
type: 'ISO'
sha256Checksum: 'string'
sourceUri: 'string'
針對 ManagedImage,請使用:
type: 'ManagedImage'
imageId: 'string'
針對 PlatformImage,請使用:
type: 'PlatformImage'
offer: 'string'
publisher: 'string'
sku: 'string'
version: 'string'
針對 SharedImageVersion,請使用:
type: 'SharedImageVersion'
imageVersionId: 'string'
屬性值
imageTemplates
名稱 | 描述 | 值 |
---|---|---|
NAME | 資源名稱 | 字串 (必要) |
location | 資源位置 | 字串 (必要) |
tags | 資源標籤 | 標記名稱和值的字典。 請參閱 範本中的標記 |
身分識別 | 如果已設定,映像範本的身分識別。 | ImageTemplateIdentity |
properties | 映像範本的屬性 | ImageTemplateProperties |
ImageTemplateIdentity
名稱 | 描述 | 值 |
---|---|---|
類型 | 用於映像範本的身分識別類型。 類型 『None』 會從映像範本中移除任何身分識別。 | 'None' 'UserAssigned' |
userAssignedIdentities | 與映像範本相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。 | 物件 (object) |
ImageTemplateProperties
名稱 | 描述 | 值 |
---|---|---|
buildTimeoutInMinutes | 建置映像範本時要等候的最大持續時間。 省略或指定 0 以使用預設 (4 小時) 。 | int |
自訂 | 指定用來描述影像自定義步驟的屬性,例如影像來源等 | ImageTemplateCustomizer[] |
散發 (distribute) | 映像輸出必須移至其中的散發目標。 | ImageTemplateDistributor[] (必要) |
來源 | 指定用來描述來源影像的屬性。 | ImageTemplateSource (必要) |
vmProfile | 描述如何設定虛擬機以建置映像 | ImageTemplateVmProfile |
ImageTemplateCustomizer
名稱 | 描述 | 值 |
---|---|---|
NAME | 易記名稱,提供此自定義步驟的內容 | 字串 |
type | 設定物件類型 | 檔案 PowerShell Shell 需要 WindowsRestart () |
ImageTemplateFileCustomizer
名稱 | 描述 | 值 |
---|---|---|
類型 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 需要 『File』 () |
目的地 | 已建立巢狀目錄結構的檔案 (絕對路徑,) 來源Uri) 檔案 (上傳至 VM 中 | 字串 |
sha256Checksum | 上述 sourceUri 字段中提供的檔案 SHA256 總和檢查碼 | 字串 |
sourceUri | 要上傳以自定義 VM 之檔案的 URI。 它可以是 Github 連結、適用於 Azure 記憶體的 SAS URI 等等 | 字串 |
ImageTemplatePowerShellCustomizer
名稱 | 描述 | 值 |
---|---|---|
類型 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 需要 『PowerShell』 () |
inline | 要執行的PowerShell命令陣列 | string[] |
runElevated | 如果指定,PowerShell 腳本將會以較高的許可權執行 | bool |
scriptUri | 要執行以進行自定義之 PowerShell 腳本的 URI。 它可以是 Github 連結、適用於 Azure 記憶體的 SAS URI 等等 | 字串 |
sha256Checksum | 上述 scriptUri 字段中提供的 Power Shell 腳本 SHA256 總和檢查碼 | 字串 |
validExitCodes | PowerShell 腳本的有效結束代碼。 [預設值: 0] | int[] |
ImageTemplateShellCustomizer
名稱 | 描述 | 值 |
---|---|---|
類型 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 需要 『Shell』 () |
inline | 要執行的殼層命令陣列 | string[] |
scriptUri | 要執行以自定義之殼層腳本的 URI。 它可以是 Github 連結、適用於 Azure 記憶體的 SAS URI 等等 | 字串 |
sha256Checksum | scriptUri 字段中提供的殼層腳本 SHA256 總和檢查碼 | 字串 |
ImageTemplateRestartCustomizer
名稱 | 描述 | 值 |
---|---|---|
類型 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 'WindowsRestart' (必要) |
restartCheckCommand | 檢查重新啟動是否成功的命令 [預設: ''] | 字串 |
restartCommand | 執行重新啟動的命令 [預設值:'shutdown /r /f /t 0 /c “packer restart”'] | 字串 |
restartTimeout | 以大小和單位字串指定的重新啟動逾時,例如 '5m' (5 分鐘) 或 '2h' (2 小時) [預設值:'5m'] | 字串 |
ImageTemplateDistributor
名稱 | 描述 | 值 |
---|---|---|
artifactTags | 散發者建立/更新成品后,將會套用至成品的標記。 | 物件 (object) |
runOutputName | 要用於相關聯 RunOutput 的名稱。 | 需要字串 () |
類型 | 設定物件類型 | ManagedImage SharedImage 需要 VHD () |
ImageTemplateManagedImageDistributor
名稱 | 描述 | 值 |
---|---|---|
類型 | 分佈類型。 | 需要 『ManagedImage』 () |
imageId | 受控磁碟映像的資源標識碼 | 字串 (必要) |
location | 映射的 Azure 位置,如果映射已經存在,則應該符合 | 字串 (必要) |
ImageTemplateSharedImageDistributor
名稱 | 描述 | 值 |
---|---|---|
類型 | 散發類型。 | 'SharedImage' (必要) |
galleryImageId | 共用映像庫 映像的資源標識碼 | 字串 (必要) |
replicationRegions | 將複寫映像的區域清單 | string[] (必要) |
ImageTemplateVhdDistributor
名稱 | 描述 | 值 |
---|---|---|
類型 | 散發類型。 | 需要 『VHD』 () |
ImageTemplateSource
名稱 | 描述 | 值 |
---|---|---|
類型 | 設定物件類型 | ISO ManagedImage PlatformImage SharedImageVersion (必要) |
ImageTemplateIsoSource
名稱 | 描述 | 值 |
---|---|---|
類型 | 指定您想要開頭的來源影像類型。 | 'ISO' (必要) |
sha256Checksum | ISO 映射的SHA256總和檢查碼。 | 字串 (必要) |
sourceUri | 用來取得 ISO 映像的 URI。 建立映像範本時,資源提供者必須能夠存取此 URI。 | 字串 (必要) |
ImageTemplateManagedImageSource
名稱 | 描述 | 值 |
---|---|---|
類型 | 指定您想要開頭的來源影像類型。 | 需要 『ManagedImage』 () |
imageId | 客戶訂用帳戶中受控映像的 ARM 資源識別碼 | 字串 (必要) |
ImageTemplatePlatformImageSource
名稱 | 描述 | 值 |
---|---|---|
類型 | 指定您想要開頭的來源影像類型。 | 'PlatformImage' (必要) |
供應項目 | Azure 資源庫映射的映像供應專案。 | 字串 |
publisher | Azure 資源庫映射中的映像發行者。 | 字串 |
sku | Azure 資源庫映射中的映射 SKU。 | 字串 |
version | Azure 資源庫映射的映射版本。 | 字串 |
ImageTemplateSharedImageVersionSource
名稱 | 描述 | 值 |
---|---|---|
類型 | 指定您想要開頭的來源影像類型。 | 'SharedImageVersion' (必要) |
imageVersionId | 共用映像庫中映像版本的 ARM 資源識別碼 | 字串 (必要) |
ImageTemplateVmProfile
名稱 | 描述 | 值 |
---|---|---|
vmSize | 用來建置、自定義和擷取映像的虛擬機大小。 省略或指定空字串以使用預設 (Standard_D1_v2) 。 | 字串 |
快速入門範本
下列快速入門範本會部署此資源類型。
範本 | 描述 |
---|---|
使用 Azure Windows 基準的 Azure Image Builder |
建立 Azure Image Builder 環境,並建置 Windows Server 映射,並套用最新的 Windows 匯報 和 Azure Windows 基準。 |
設定開發箱服務 |
此範本會根據 Dev Box 快速入門指南建立所有 Dev Box 系統管理員資源。 您可以檢視所有已建立的資源,或直接移至 DevPortal.microsoft.com,以建立您的第一個開發箱。 |
ARM 範本資源定義
imageTemplates 資源類型可以部署到:
- 資源群組 - 請參閱 資源群組部署命令
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄。
資源格式
若要建立 Microsoft.VirtualMachineImages/imageTemplates 資源,請將下列 JSON 新增至您的範本。
{
"type": "Microsoft.VirtualMachineImages/imageTemplates",
"apiVersion": "2019-05-01-preview",
"name": "string",
"location": "string",
"tags": {
"tagName1": "tagValue1",
"tagName2": "tagValue2"
},
"identity": {
"type": "string",
"userAssignedIdentities": {}
},
"properties": {
"buildTimeoutInMinutes": "int",
"customize": [
{
"name": "string",
"type": "string"
// For remaining properties, see ImageTemplateCustomizer objects
}
],
"distribute": [
{
"artifactTags": {},
"runOutputName": "string",
"type": "string"
// For remaining properties, see ImageTemplateDistributor objects
}
],
"source": {
"type": "string"
// For remaining properties, see ImageTemplateSource objects
},
"vmProfile": {
"vmSize": "string"
}
}
}
ImageTemplateCustomizer 物件
設定 type 屬性以指定物件的類型。
針對 [檔案],請使用:
"type": "File",
"destination": "string",
"sha256Checksum": "string",
"sourceUri": "string"
針對 PowerShell,請使用:
"type": "PowerShell",
"inline": [ "string" ],
"runElevated": "bool",
"scriptUri": "string",
"sha256Checksum": "string",
"validExitCodes": [ "int" ]
針對 Shell,請使用:
"type": "Shell",
"inline": [ "string" ],
"scriptUri": "string",
"sha256Checksum": "string"
針對 WindowsRestart,請使用:
"type": "WindowsRestart",
"restartCheckCommand": "string",
"restartCommand": "string",
"restartTimeout": "string"
ImageTemplateDistributor 物件
設定 type 屬性以指定物件的類型。
針對 ManagedImage,請使用:
"type": "ManagedImage",
"imageId": "string",
"location": "string"
針對 SharedImage,請使用:
"type": "SharedImage",
"galleryImageId": "string",
"replicationRegions": [ "string" ]
針對 VHD,請使用:
"type": "VHD"
ImageTemplateSource 物件
設定 type 屬性以指定物件的類型。
針對 ISO,請使用:
"type": "ISO",
"sha256Checksum": "string",
"sourceUri": "string"
針對 ManagedImage,請使用:
"type": "ManagedImage",
"imageId": "string"
針對 PlatformImage,請使用:
"type": "PlatformImage",
"offer": "string",
"publisher": "string",
"sku": "string",
"version": "string"
針對 SharedImageVersion,請使用:
"type": "SharedImageVersion",
"imageVersionId": "string"
屬性值
imageTemplates
名稱 | 描述 | 值 |
---|---|---|
類型 | 資源類型 | 'Microsoft.VirtualMachineImages/imageTemplates' |
apiVersion | 資源 API 版本 | '2019-05-01-preview' |
NAME | 資源名稱 | 字串 (必要) |
location | 資源位置 | 字串 (必要) |
tags | 資源標籤 | 標記名稱和值的字典。 請參閱 範本中的標記 |
身分識別 | 如果已設定,映像範本的身分識別。 | ImageTemplateIdentity |
properties | 映像範本的屬性 | ImageTemplateProperties |
ImageTemplateIdentity
名稱 | 描述 | 值 |
---|---|---|
類型 | 用於映像範本的身分識別類型。 類型 『None』 會從映像範本中移除任何身分識別。 | 'None' 'UserAssigned' |
userAssignedIdentities | 與映像範本相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。 | 物件 (object) |
ImageTemplateProperties
名稱 | 描述 | 值 |
---|---|---|
buildTimeoutInMinutes | 建置映像範本時要等候的最大持續時間。 省略或指定 0 以使用預設 (4 小時) 。 | int |
自訂 | 指定用來描述影像自定義步驟的屬性,例如影像來源等 | ImageTemplateCustomizer[] |
散發 (distribute) | 映像輸出必須移至其中的散發目標。 | ImageTemplateDistributor[] (必要) |
來源 | 指定用來描述來源影像的屬性。 | ImageTemplateSource (必要) |
vmProfile | 描述如何設定虛擬機以建置映像 | ImageTemplateVmProfile |
ImageTemplateCustomizer
名稱 | 描述 | 值 |
---|---|---|
NAME | 易記名稱,提供此自定義步驟的內容 | 字串 |
type | 設定物件類型 | 檔案 PowerShell Shell 需要 WindowsRestart () |
ImageTemplateFileCustomizer
名稱 | 描述 | 值 |
---|---|---|
類型 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 需要 『File』 () |
目的地 | 已建立巢狀目錄結構的檔案 (絕對路徑,) 來源Uri) 檔案 (上傳至 VM 中 | 字串 |
sha256Checksum | 上述 sourceUri 字段中提供的檔案 SHA256 總和檢查碼 | 字串 |
sourceUri | 要上傳以自定義 VM 之檔案的 URI。 它可以是 Github 連結、適用於 Azure 記憶體的 SAS URI 等等 | 字串 |
ImageTemplatePowerShellCustomizer
名稱 | 描述 | 值 |
---|---|---|
類型 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 需要 『PowerShell』 () |
inline | 要執行的PowerShell命令陣列 | string[] |
runElevated | 如果指定,PowerShell 腳本將會以較高的許可權執行 | bool |
scriptUri | 要執行以進行自定義之 PowerShell 腳本的 URI。 它可以是 Github 連結、適用於 Azure 記憶體的 SAS URI 等等 | 字串 |
sha256Checksum | 上述 scriptUri 字段中提供的 Power Shell 腳本 SHA256 總和檢查碼 | 字串 |
validExitCodes | PowerShell 腳本的有效結束代碼。 [預設值: 0] | int[] |
ImageTemplateShellCustomizer
名稱 | 描述 | 值 |
---|---|---|
類型 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 需要 『Shell』 () |
inline | 要執行的殼層命令陣列 | string[] |
scriptUri | 要執行以自定義之殼層腳本的 URI。 它可以是 Github 連結、適用於 Azure 記憶體的 SAS URI 等等 | 字串 |
sha256Checksum | scriptUri 字段中提供的殼層腳本 SHA256 總和檢查碼 | 字串 |
ImageTemplateRestartCustomizer
名稱 | 描述 | 值 |
---|---|---|
類型 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 'WindowsRestart' (必要) |
restartCheckCommand | 檢查重新啟動是否成功的命令 [預設: ''] | 字串 |
restartCommand | 執行重新啟動的命令 [預設值:'shutdown /r /f /t 0 /c “packer restart”'] | 字串 |
restartTimeout | 以大小和單位字串指定的重新啟動逾時,例如 '5m' (5 分鐘) 或 '2h' (2 小時) [預設值:'5m'] | 字串 |
ImageTemplateDistributor
名稱 | 描述 | 值 |
---|---|---|
artifactTags | 散發者建立/更新成品后,將會套用至成品的標記。 | 物件 (object) |
runOutputName | 要用於相關聯 RunOutput 的名稱。 | 需要字串 () |
類型 | 設定物件類型 | ManagedImage SharedImage 需要 VHD () |
ImageTemplateManagedImageDistributor
名稱 | 描述 | 值 |
---|---|---|
類型 | 分佈類型。 | 需要 『ManagedImage』 () |
imageId | 受控磁碟映像的資源標識碼 | 需要字串 () |
location | 映射的 Azure 位置,如果映射已存在,則應該符合 | 需要字串 () |
ImageTemplateSharedImageDistributor
名稱 | 描述 | 值 |
---|---|---|
類型 | 分佈類型。 | 'SharedImage' (必要) |
galleryImageId | 共用映像庫 映像的資源標識碼 | 需要字串 () |
replicationRegions | 將複寫映像的區域清單 | string[] (必要) |
ImageTemplateVhdDistributor
名稱 | 描述 | 值 |
---|---|---|
類型 | 分佈類型。 | 需要 『VHD』 () |
ImageTemplateSource
名稱 | 描述 | 值 |
---|---|---|
類型 | 設定物件類型 | ISO ManagedImage PlatformImage 需要 SharedImageVersion () |
ImageTemplateIsoSource
名稱 | 描述 | 值 |
---|---|---|
類型 | 指定您想要開頭的來源影像類型。 | 需要 『ISO』 () |
sha256Checksum | ISO 映射的SHA256總和檢查碼。 | 需要字串 () |
sourceUri | 用來取得 ISO 映像的 URI。 建立映像範本時,資源提供者必須能夠存取此 URI。 | 需要字串 () |
ImageTemplateManagedImageSource
名稱 | 描述 | 值 |
---|---|---|
類型 | 指定您想要開頭的來源影像類型。 | 需要 『ManagedImage』 () |
imageId | 客戶訂用帳戶中受控映像的 ARM 資源識別碼 | 需要字串 () |
ImageTemplatePlatformImageSource
名稱 | 描述 | 值 |
---|---|---|
類型 | 指定您想要開頭的來源影像類型。 | 'PlatformImage' (必要) |
供應項目 | 來自 Azure 資源庫映射的映像供應專案。 | 字串 |
publisher | Azure 資源庫映射中的映像發行者。 | 字串 |
sku | 來自 Azure 資源庫映像的映像 SKU。 | 字串 |
version | 來自 Azure 資源庫映像的映像版本。 | 字串 |
ImageTemplateSharedImageVersionSource
名稱 | 描述 | 值 |
---|---|---|
類型 | 指定您想要開頭的來源影像類型。 | 'SharedImageVersion' (必要) |
imageVersionId | 共用映像資源庫中映像版本的 ARM 資源識別碼 | 需要字串 () |
ImageTemplateVmProfile
名稱 | 描述 | 值 |
---|---|---|
vmSize | 用來建置、自定義和擷取映像的虛擬機大小。 省略或指定空字串以使用預設 (Standard_D1_v2) 。 | 字串 |
快速入門範本
下列快速入門範本會部署此資源類型。
範本 | 描述 |
---|---|
使用 Azure Windows 基準的 Azure Image Builder |
建立 Azure Image Builder 環境並建置 Windows Server 映射,並套用最新的 Windows 匯報 和 Azure Windows 基準。 |
設定開發箱服務 |
此範本會根據 Dev Box 快速入門指南建立所有 Dev Box 系統管理員資源。 您可以檢視所有已建立的資源,或直接移至 DevPortal.microsoft.com,以建立您的第一個開發箱。 |
Terraform (AzAPI 提供者) 資源定義
imageTemplates 資源類型可以部署到:
- 資源群組
如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄。
資源格式
若要建立 Microsoft.VirtualMachineImages/imageTemplates 資源,請將下列 Terraform 新增至您的範本。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.VirtualMachineImages/imageTemplates@2019-05-01-preview"
name = "string"
location = "string"
parent_id = "string"
tags = {
tagName1 = "tagValue1"
tagName2 = "tagValue2"
}
identity {
type = "UserAssigned"
identity_ids = []
}
body = jsonencode({
properties = {
buildTimeoutInMinutes = int
customize = [
{
name = "string"
type = "string"
// For remaining properties, see ImageTemplateCustomizer objects
}
]
distribute = [
{
artifactTags = {}
runOutputName = "string"
type = "string"
// For remaining properties, see ImageTemplateDistributor objects
}
]
source = {
type = "string"
// For remaining properties, see ImageTemplateSource objects
}
vmProfile = {
vmSize = "string"
}
}
})
}
ImageTemplateCustomizer 物件
設定 type 屬性以指定物件的類型。
針對 [檔案],請使用:
type = "File"
destination = "string"
sha256Checksum = "string"
sourceUri = "string"
針對 PowerShell,請使用:
type = "PowerShell"
inline = [
"string"
]
runElevated = bool
scriptUri = "string"
sha256Checksum = "string"
validExitCodes = [
int
]
針對 Shell,請使用:
type = "Shell"
inline = [
"string"
]
scriptUri = "string"
sha256Checksum = "string"
針對 WindowsRestart,請使用:
type = "WindowsRestart"
restartCheckCommand = "string"
restartCommand = "string"
restartTimeout = "string"
ImageTemplateDistributor 物件
設定 type 屬性以指定物件的類型。
針對 ManagedImage,請使用:
type = "ManagedImage"
imageId = "string"
location = "string"
針對 SharedImage,請使用:
type = "SharedImage"
galleryImageId = "string"
replicationRegions = [
"string"
]
針對 VHD,請使用:
type = "VHD"
ImageTemplateSource 物件
設定 type 屬性以指定物件的類型。
針對 ISO,請使用:
type = "ISO"
sha256Checksum = "string"
sourceUri = "string"
針對 ManagedImage,請使用:
type = "ManagedImage"
imageId = "string"
針對 PlatformImage,請使用:
type = "PlatformImage"
offer = "string"
publisher = "string"
sku = "string"
version = "string"
針對 SharedImageVersion,請使用:
type = "SharedImageVersion"
imageVersionId = "string"
屬性值
imageTemplates
名稱 | 描述 | 值 |
---|---|---|
類型 | 資源類型 | “Microsoft.VirtualMachineImages/imageTemplates@2019-05-01-preview” |
NAME | 資源名稱 | 字串 (必要) |
location | 資源位置 | 字串 (必要) |
parent_id | 若要部署至資源群組,請使用該資源群組的標識碼。 | 字串 (必要) |
tags | 資源標籤 | 標記名稱和值的字典。 |
身分識別 | 如果已設定,映像範本的身分識別。 | ImageTemplateIdentity |
properties | 映像範本的屬性 | ImageTemplateProperties |
ImageTemplateIdentity
名稱 | 描述 | 值 |
---|---|---|
類型 | 用於映像範本的身分識別類型。 類型 『None』 會從映像範本中移除任何身分識別。 | “UserAssigned” |
identity_ids | 與映像範本相關聯的使用者身分識別清單。 使用者身分識別字典索引鍵參考的格式為 ARM 資源標識符:'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'。 | 使用者身分識別標識碼的陣列。 |
ImageTemplateProperties
名稱 | 描述 | 值 |
---|---|---|
buildTimeoutInMinutes | 建置映像範本時要等候的最大持續時間。 省略或指定 0 以使用預設 (4 小時) 。 | int |
自訂 | 指定用來描述影像自定義步驟的屬性,例如影像來源等 | ImageTemplateCustomizer[] |
散發 (distribute) | 映像輸出必須移至其中的散發目標。 | ImageTemplateDistributor[] (必要) |
來源 | 指定用來描述來源影像的屬性。 | ImageTemplateSource (必要) |
vmProfile | 描述如何設定虛擬機以建置映像 | ImageTemplateVmProfile |
ImageTemplateCustomizer
名稱 | 描述 | 值 |
---|---|---|
NAME | 易記名稱,提供此自定義步驟的內容 | 字串 |
type | 設定物件類型 | 檔案 PowerShell Shell 需要 WindowsRestart () |
ImageTemplateFileCustomizer
名稱 | 描述 | 值 |
---|---|---|
類型 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 「檔案」 (必要) |
目的地 | 已建立巢狀目錄結構的檔案 (絕對路徑,) 來源Uri) 檔案 (上傳至 VM | 字串 |
sha256Checksum | 上述 sourceUri 字段中提供的檔案 SHA256 總和檢查碼 | 字串 |
sourceUri | 要上傳以自定義 VM 之檔案的 URI。 它可以是 github 連結、適用於 Azure 記憶體的 SAS URI 等等 | 字串 |
ImageTemplatePowerShellCustomizer
名稱 | 描述 | 值 |
---|---|---|
類型 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 「PowerShell」 (必要) |
inline | 要執行的PowerShell命令陣列 | string[] |
runElevated | 如果指定,PowerShell 腳本將會以提高的許可權執行 | bool |
scriptUri | 要執行的PowerShell腳本 URI 以進行自定義。 它可以是 github 連結、適用於 Azure 記憶體的 SAS URI 等等 | 字串 |
sha256Checksum | 上述 scriptUri 字段中提供的 Power Shell 腳本 SHA256 總和檢查碼 | 字串 |
validExitCodes | PowerShell 腳本的有效結束代碼。 [預設值: 0] | int[] |
ImageTemplateShellCustomizer
名稱 | 描述 | 值 |
---|---|---|
類型 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | 「殼層」 (必要) |
inline | 要執行的殼層命令陣列 | string[] |
scriptUri | 要執行以進行自定義的殼層腳本 URI。 它可以是 github 連結、適用於 Azure 記憶體的 SAS URI 等等 | 字串 |
sha256Checksum | scriptUri 字段中提供的殼層腳本 SHA256 總和檢查碼 | 字串 |
ImageTemplateRestartCustomizer
名稱 | 描述 | 值 |
---|---|---|
類型 | 您想要在映像上使用的自訂工具類型。 例如,“Shell” 可以是殼層自定義工具 | “WindowsRestart” (必要) |
restartCheckCommand | 檢查重新啟動是否成功的命令 [預設值: ''] | 字串 |
restartCommand | 執行重新啟動的命令 [預設值: 'shutdown /r /f /t 0 /c “packer restart”'] | 字串 |
restartTimeout | 指定為大小和單位字串的重新啟動逾時,例如 '5m' (5 分鐘) 或 '2h' (2 小時) [預設值: '5m'] | 字串 |
ImageTemplateDistributor
名稱 | 描述 | 值 |
---|---|---|
artifactTags | 散發者建立/更新成品后,將套用至成品的標記。 | 物件 (object) |
runOutputName | 要用於相關聯 RunOutput 的名稱。 | 字串 (必要) |
類型 | 設定物件類型 | ManagedImage SharedImage 需要 VHD () |
ImageTemplateManagedImageDistributor
名稱 | 描述 | 值 |
---|---|---|
類型 | 分佈類型。 | “ManagedImage” (必要) |
imageId | 受控磁碟映像的資源標識碼 | 需要字串 () |
location | 映射的 Azure 位置,如果映射已存在,則應該符合 | 需要字串 () |
ImageTemplateSharedImageDistributor
名稱 | 描述 | 值 |
---|---|---|
類型 | 分佈類型。 | “SharedImage” (必要) |
galleryImageId | 共用映像庫 映像的資源標識碼 | 需要字串 () |
replicationRegions | 將複寫映像的區域清單 | string[] (必要) |
ImageTemplateVhdDistributor
名稱 | 描述 | 值 |
---|---|---|
類型 | 分佈類型。 | “VHD” (必要) |
ImageTemplateSource
名稱 | 描述 | 值 |
---|---|---|
類型 | 設定物件類型 | ISO ManagedImage PlatformImage 需要 SharedImageVersion () |
ImageTemplateIsoSource
名稱 | 描述 | 值 |
---|---|---|
類型 | 指定您想要開頭的來源影像類型。 | “ISO” (必要) |
sha256Checksum | ISO 映射的SHA256總和檢查碼。 | 需要字串 () |
sourceUri | 用來取得 ISO 映像的 URI。 建立映像範本時,資源提供者必須能夠存取此 URI。 | 需要字串 () |
ImageTemplateManagedImageSource
名稱 | 描述 | 值 |
---|---|---|
類型 | 指定您想要開頭的來源影像類型。 | “ManagedImage” (必要) |
imageId | 客戶訂用帳戶中受控映像的 ARM 資源識別碼 | 需要字串 () |
ImageTemplatePlatformImageSource
名稱 | 描述 | 值 |
---|---|---|
類型 | 指定您想要開頭的來源影像類型。 | “PlatformImage” (必要) |
供應項目 | 來自 Azure 資源庫映射的映像供應專案。 | 字串 |
publisher | Azure 資源庫映射中的映像發行者。 | 字串 |
sku | 來自 Azure 資源庫映像的映像 SKU。 | 字串 |
version | 來自 Azure 資源庫映像的映像版本。 | 字串 |
ImageTemplateSharedImageVersionSource
名稱 | 描述 | 值 |
---|---|---|
類型 | 指定您想要開頭的來源影像類型。 | “SharedImageVersion” (必要) |
imageVersionId | 共用映像資源庫中映像版本的 ARM 資源識別碼 | 需要字串 () |
ImageTemplateVmProfile
名稱 | 描述 | 值 |
---|---|---|
vmSize | 用來建置、自定義和擷取映像的虛擬機大小。 省略或指定空字串以使用預設 (Standard_D1_v2) 。 | 字串 |