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 | リソース名 | string (必須) |
location | リソースの場所 | string (必須) |
tags | リソース タグ | タグ名と値のディクショナリ。 「テンプレートのタグ」を参照してください |
identity | イメージ テンプレートの ID (構成されている場合)。 | ImageTemplateIdentity |
properties | イメージ テンプレートのプロパティ | ImageTemplateProperties |
ImageTemplateIdentity
名前 | 説明 | 値 |
---|---|---|
type | イメージ テンプレートに使用される ID の種類。 型 'None' では、イメージ テンプレートから ID が削除されます。 | 'None' 'UserAssigned' |
userAssignedIdentities | イメージ テンプレートに関連付けられているユーザー ID の一覧。 ユーザー ID ディクショナリ キーの参照は、'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}' という形式の ARM リソース ID になります。 | object |
ImageTemplateProperties
名前 | 説明 | 値 |
---|---|---|
buildTimeoutInMinutes | イメージ テンプレートのビルド中に待機する最大時間。 既定値 (4 時間) を使用するには、0 を省略するか、指定します。 | INT |
カスタマイズ | イメージ ソースなど、イメージのカスタマイズ手順を記述するために使用されるプロパティを指定します | ImageTemplateCustomizer[] |
配布 (distribute) | イメージ出力を移動する必要がある配布ターゲット。 | ImageTemplateDistributor[] (必須) |
source | ソース イメージの説明に使用するプロパティを指定します。 | ImageTemplateSource (必須) |
vmProfile | イメージをビルドするように仮想マシンを設定する方法について説明します | ImageTemplateVmProfile |
ImageTemplateCustomizer
名前 | 説明 | 値 |
---|---|---|
name | このカスタマイズ手順の内容に関するコンテキストを提供するフレンドリ名 | string |
type | オブジェクトの種類を設定する | [最近使ったファイル] PowerShell Shell WindowsRestart (必須) |
ImageTemplateFileCustomizer
名前 | 説明 | 値 |
---|---|---|
type | イメージで使用するカスタマイズ ツールの種類。 たとえば、"Shell" はシェル カスタマイザーにすることができます | 'File' (必須) |
destination | ファイル (sourceUri から) が VM にアップロードされるファイルへの絶対パス (入れ子になったディレクトリ構造が既に作成されています) | string |
sha256Checksum | 上記の sourceUri フィールドに指定されたファイルの SHA256 チェックサム | string |
sourceUri | VM をカスタマイズするためにアップロードするファイルの URI。 GitHub リンク、Azure Storage の SAS URI などです。 | string |
ImageTemplatePowerShellCustomizer
名前 | 説明 | 値 |
---|---|---|
type | イメージで使用するカスタマイズ ツールの種類。 たとえば、"Shell" はシェル カスタマイザーにすることができます | 'PowerShell' (必須) |
inline | 実行する PowerShell コマンドの配列 | string[] |
runElevated | 指定した場合、PowerShell スクリプトは管理者特権で実行されます | [bool] |
scriptUri | カスタマイズのために実行する PowerShell スクリプトの URI。 GitHub リンク、Azure Storage の SAS URI などです。 | string |
sha256Checksum | 上の scriptUri フィールドに用意されている Power Shell スクリプトの SHA256 チェックサム | string |
validExitCodes | PowerShell スクリプトの有効な終了コード。 [既定値: 0] | int[] |
ImageTemplateShellCustomizer
名前 | 説明 | 値 |
---|---|---|
type | イメージで使用するカスタマイズ ツールの種類。 たとえば、"Shell" はシェル カスタマイザーにすることができます | 'Shell' (必須) |
inline | 実行するシェル コマンドの配列 | string[] |
scriptUri | カスタマイズのために実行するシェル スクリプトの URI。 GitHub リンク、Azure Storage の SAS URI などです。 | string |
sha256Checksum | scriptUri フィールドで提供されるシェル スクリプトの SHA256 チェックサム | string |
ImageTemplateRestartCustomizer
名前 | 説明 | 値 |
---|---|---|
type | イメージで使用するカスタマイズ ツールの種類。 たとえば、"Shell" はシェル カスタマイザーにすることができます | 'WindowsRestart' (必須) |
restartCheckCommand | 再起動に成功した場合にチェックするコマンド [既定値: ''] | string |
restartCommand | 再起動を実行するコマンド [既定値: 'shutdown /r /f /t 0 /c "packer restart"'] | string |
restartTimeout | "5m" (5 分) や '2h' (2 時間) など、大きさと単位の文字列として指定された再起動タイムアウト [既定値: '5m'] | string |
ImageTemplateDistributor
名前 | 説明 | 値 |
---|---|---|
artifactTags | ディストリビューターによって作成または更新されると、成果物に適用されるタグ。 | object |
runOutputName | 関連付けられた RunOutput に使用する名前。 | string (必須) |
型 | オブジェクトの種類を設定する | ManagedImage SharedImage VHD (必須) |
ImageTemplateManagedImageDistributor
名前 | 説明 | 値 |
---|---|---|
type | 分布の種類。 | 'ManagedImage' (必須) |
imageId | マネージド ディスク イメージのリソース ID | string (必須) |
location | イメージの Azure の場所は、イメージが既に存在する場合は一致する必要があります | string (必須) |
ImageTemplateSharedImageDistributor
名前 | 説明 | 値 |
---|---|---|
type | 分布の種類。 | 'SharedImage' (必須) |
galleryImageId | Shared Image Gallery イメージのリソース ID | string (必須) |
replicationRegions | イメージがレプリケートされるリージョンの一覧 | string[] (必須) |
ImageTemplateVhdDistributor
名前 | 説明 | 値 |
---|---|---|
type | 分布の種類。 | 'VHD' (必須) |
ImageTemplateSource
名前 | 説明 | 値 |
---|---|---|
type | オブジェクトの種類を設定する | ISO ManagedImage PlatformImage SharedImageVersion (必須) |
ImageTemplateIsoSource
名前 | 説明 | 値 |
---|---|---|
type | 開始するソース イメージの種類を指定します。 | 'ISO' (必須) |
sha256Checksum | ISO イメージの SHA256 チェックサム。 | string (必須) |
sourceUri | ISO イメージを取得する URI。 この URI は、イメージ テンプレートの作成時にリソース プロバイダーからアクセスできる必要があります。 | string (必須) |
ImageTemplateManagedImageSource
名前 | 説明 | 値 |
---|---|---|
type | 開始するソース イメージの種類を指定します。 | 'ManagedImage' (必須) |
imageId | 顧客サブスクリプション内のマネージド イメージの ARM リソース ID | string (必須) |
ImageTemplatePlatformImageSource
名前 | 説明 | 値 |
---|---|---|
type | 開始するソース イメージの種類を指定します。 | 'PlatformImage' (必須) |
offer | Azure ギャラリー イメージからのイメージ オファー。 | string |
publisher | Azure ギャラリー イメージの Image Publisher。 | string |
sku | Azure ギャラリー イメージのイメージ SKU。 | string |
version | Azure ギャラリー イメージのイメージ バージョン。 | string |
ImageTemplateSharedImageVersionSource
名前 | 説明 | 値 |
---|---|---|
type | 開始するソース イメージの種類を指定します。 | 'SharedImageVersion' (必須) |
imageVersionId | 共有イメージ ギャラリー内のイメージ バージョンの ARM リソース ID | string (必須) |
ImageTemplateVmProfile
名前 | 説明 | 値 |
---|---|---|
vmSize | イメージのビルド、カスタマイズ、キャプチャに使用される仮想マシンのサイズ。 既定の (Standard_D1_v2) を使用するには、空の文字列を省略または指定します。 | string |
クイック スタート テンプレート
次のクイックスタート テンプレートでは、このリソースの種類をデプロイします。
Template | 説明 |
---|---|
Azure Image Builder と Azure Windows ベースライン |
Azure Image Builder 環境を作成し、最新の Windows 更新と Azure Windows ベースラインが適用された Windows Server イメージを構築します。 |
Dev Box サービスを構成する |
このテンプレートでは、Dev Box クイック スタート ガイドに従って、すべての Dev Box 管理リソースが作成されます。 作成されたすべてのリソースを表示することも、DevPortal.microsoft.com に直接移動して最初の Dev Box を作成することもできます。 |
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
名前 | 説明 | 値 |
---|---|---|
type | リソースの種類 | 'Microsoft.VirtualMachineImages/imageTemplates' |
apiVersion | リソース API のバージョン | '2019-05-01-preview' |
name | リソース名 | string (必須) |
location | リソースの場所 | string (必須) |
tags | リソース タグ | タグの名前と値のディクショナリ。 「テンプレート内のタグ」を参照してください |
identity | イメージ テンプレートの ID (構成されている場合)。 | ImageTemplateIdentity |
properties | イメージ テンプレートのプロパティ | ImageTemplateProperties |
ImageTemplateIdentity
名前 | 説明 | 値 |
---|---|---|
type | イメージ テンプレートに使用される ID の種類。 型 'None' では、イメージ テンプレートから ID が削除されます。 | 'None' 'UserAssigned' |
userAssignedIdentities | イメージ テンプレートに関連付けられているユーザー ID の一覧。 ユーザー ID ディクショナリ キー参照は、"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}" という形式の ARM リソース ID になります。 | object |
ImageTemplateProperties
名前 | 説明 | 値 |
---|---|---|
buildTimeoutInMinutes | イメージ テンプレートのビルド中に待機する最大時間。 既定値 (4 時間) を使用するには、0 を省略または指定します。 | INT |
カスタマイズ | イメージ ソースなど、イメージのカスタマイズ手順を記述するために使用されるプロパティを指定します。 | ImageTemplateCustomizer[] |
配布 (distribute) | イメージ出力の移動先となる配布ターゲット。 | ImageTemplateDistributor[] (必須) |
source | ソース イメージの記述に使用するプロパティを指定します。 | ImageTemplateSource (必須) |
vmProfile | イメージをビルドするように仮想マシンを設定する方法について説明します | ImageTemplateVmProfile |
ImageTemplateCustomizer
名前 | 説明 | 値 |
---|---|---|
name | このカスタマイズ手順の内容に関するコンテキストを提供するフレンドリ名 | string |
type | オブジェクトの種類を設定する | [最近使ったファイル] PowerShell Shell WindowsRestart (必須) |
ImageTemplateFileCustomizer
名前 | 説明 | 値 |
---|---|---|
type | イメージで使用するカスタマイズ ツールの種類。 たとえば、"Shell" はシェル カスタマイザーにすることができます | 'File' (必須) |
destination | ファイル (sourceUri から) が VM にアップロードされるファイルへの絶対パス (入れ子になったディレクトリ構造が既に作成されています) | string |
sha256Checksum | 上記の sourceUri フィールドに指定されたファイルの SHA256 チェックサム | string |
sourceUri | VM をカスタマイズするためにアップロードするファイルの URI。 GitHub リンク、Azure Storage の SAS URI などです。 | string |
ImageTemplatePowerShellCustomizer
名前 | 説明 | 値 |
---|---|---|
type | イメージで使用するカスタマイズ ツールの種類。 たとえば、"Shell" はシェル カスタマイザーにすることができます | 'PowerShell' (必須) |
inline | 実行する PowerShell コマンドの配列 | string[] |
runElevated | 指定した場合、PowerShell スクリプトは管理者特権で実行されます | [bool] |
scriptUri | カスタマイズのために実行する PowerShell スクリプトの URI。 GitHub リンク、Azure Storage の SAS URI などです。 | string |
sha256Checksum | 上の scriptUri フィールドに用意されている Power Shell スクリプトの SHA256 チェックサム | string |
validExitCodes | PowerShell スクリプトの有効な終了コード。 [既定値: 0] | int[] |
ImageTemplateShellCustomizer
名前 | 説明 | 値 |
---|---|---|
type | イメージで使用するカスタマイズ ツールの種類。 たとえば、"Shell" はシェル カスタマイザーにすることができます | 'Shell' (必須) |
inline | 実行するシェル コマンドの配列 | string[] |
scriptUri | カスタマイズのために実行するシェル スクリプトの URI。 GitHub リンク、Azure Storage の SAS URI などです。 | string |
sha256Checksum | scriptUri フィールドで提供されるシェル スクリプトの SHA256 チェックサム | string |
ImageTemplateRestartCustomizer
名前 | 説明 | 値 |
---|---|---|
type | イメージで使用するカスタマイズ ツールの種類。 たとえば、"Shell" はシェル カスタマイザーにすることができます | 'WindowsRestart' (必須) |
restartCheckCommand | 再起動に成功した場合にチェックするコマンド [既定値: ''] | string |
restartCommand | 再起動を実行するコマンド [既定値: 'shutdown /r /f /t 0 /c "packer restart"'] | string |
restartTimeout | "5m" (5 分) や '2h' (2 時間) など、大きさと単位の文字列として指定された再起動タイムアウト [既定値: '5m'] | string |
ImageTemplateDistributor
名前 | 説明 | 値 |
---|---|---|
artifactTags | ディストリビューターによって作成または更新されると、成果物に適用されるタグ。 | object |
runOutputName | 関連付けられた RunOutput に使用する名前。 | string (必須) |
型 | オブジェクトの種類を設定する | ManagedImage SharedImage VHD (必須) |
ImageTemplateManagedImageDistributor
名前 | 説明 | 値 |
---|---|---|
type | 分布の種類。 | 'ManagedImage' (必須) |
imageId | マネージド ディスク イメージのリソース ID | string (必須) |
location | イメージの Azure の場所。イメージが既に存在する場合は一致する必要があります | string (必須) |
ImageTemplateSharedImageDistributor
名前 | 説明 | 値 |
---|---|---|
type | 分布の種類。 | 'SharedImage' (必須) |
galleryImageId | Shared Image Gallery イメージのリソース ID | string (必須) |
replicationRegions | イメージがレプリケートされるリージョンの一覧 | string[] (必須) |
ImageTemplateVhdDistributor
名前 | 説明 | 値 |
---|---|---|
type | 分布の種類。 | 'VHD' (必須) |
ImageTemplateSource
名前 | 説明 | 値 |
---|---|---|
type | オブジェクトの種類を設定する | ISO ManagedImage PlatformImage SharedImageVersion (必須) |
ImageTemplateIsoSource
名前 | 説明 | 値 |
---|---|---|
type | 開始するソース イメージの種類を指定します。 | 'ISO' (必須) |
sha256Checksum | SHA256 ISO イメージのチェックサム。 | string (必須) |
sourceUri | ISO イメージを取得する URI。 この URI は、イメージ テンプレートの作成時にリソース プロバイダーからアクセスできる必要があります。 | string (必須) |
ImageTemplateManagedImageSource
名前 | 説明 | 値 |
---|---|---|
type | 開始するソース イメージの種類を指定します。 | 'ManagedImage' (必須) |
imageId | 顧客サブスクリプションのマネージド イメージの ARM リソース ID | string (必須) |
ImageTemplatePlatformImageSource
名前 | 説明 | 値 |
---|---|---|
type | 開始するソース イメージの種類を指定します。 | 'PlatformImage' (必須) |
offer | Azure ギャラリー イメージからのイメージ オファー。 | string |
publisher | Azure ギャラリー イメージの Image Publisher。 | string |
sku | Azure ギャラリー イメージからのイメージ SKU。 | string |
version | Azure ギャラリー イメージのイメージ バージョン。 | string |
ImageTemplateSharedImageVersionSource
名前 | 説明 | 値 |
---|---|---|
type | 開始するソース イメージの種類を指定します。 | 'SharedImageVersion' (必須) |
imageVersionId | 共有イメージ ギャラリー内のイメージ バージョンの ARM リソース ID | string (必須) |
ImageTemplateVmProfile
名前 | 説明 | 値 |
---|---|---|
vmSize | イメージのビルド、カスタマイズ、キャプチャに使用される仮想マシンのサイズ。 既定の (Standard_D1_v2) を使用するには、空の文字列を省略または指定します。 | string |
クイック スタート テンプレート
次のクイックスタート テンプレートでは、このリソースの種類をデプロイします。
Template | 説明 |
---|---|
Azure Image Builder と Azure Windows ベースライン |
Azure Image Builder 環境を作成し、最新の Windows 更新と Azure Windows ベースラインが適用された Windows Server イメージを構築します。 |
Dev Box サービスを構成する |
このテンプレートでは、Dev Box クイック スタート ガイドに従って、すべての Dev Box 管理リソースが作成されます。 作成されたすべてのリソースを表示することも、DevPortal.microsoft.com に直接移動して最初の Dev Box を作成することもできます。 |
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
名前 | 説明 | 値 |
---|---|---|
type | リソースの種類 | "Microsoft.VirtualMachineImages/imageTemplates@2019-05-01-preview" |
name | リソース名 | string (必須) |
location | リソースの場所 | string (必須) |
parent_id | リソース グループにデプロイするには、そのリソース グループの ID を使用します。 | string (必須) |
tags | リソース タグ | タグの名前と値のディクショナリ。 |
identity | イメージ テンプレートの ID (構成されている場合)。 | ImageTemplateIdentity |
properties | イメージ テンプレートのプロパティ | ImageTemplateProperties |
ImageTemplateIdentity
名前 | 説明 | 値 |
---|---|---|
type | イメージ テンプレートに使用される ID の種類。 型 'None' では、イメージ テンプレートから ID が削除されます。 | "UserAssigned" |
identity_ids | イメージ テンプレートに関連付けられているユーザー ID の一覧。 ユーザー ID ディクショナリ キー参照は、"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}" という形式の ARM リソース ID になります。 | ユーザー ID ID の配列。 |
ImageTemplateProperties
名前 | 説明 | 値 |
---|---|---|
buildTimeoutInMinutes | イメージ テンプレートのビルド中に待機する最大時間。 既定値 (4 時間) を使用するには、0 を省略または指定します。 | INT |
カスタマイズ | イメージ ソースなど、イメージのカスタマイズ手順を記述するために使用されるプロパティを指定します。 | ImageTemplateCustomizer[] |
配布 (distribute) | イメージ出力の移動先となる配布ターゲット。 | ImageTemplateDistributor[] (必須) |
source | ソース イメージの記述に使用するプロパティを指定します。 | ImageTemplateSource (必須) |
vmProfile | イメージをビルドするように仮想マシンを設定する方法について説明します | ImageTemplateVmProfile |
ImageTemplateCustomizer
名前 | 説明 | 値 |
---|---|---|
name | このカスタマイズ手順の内容に関するコンテキストを提供するフレンドリ名 | string |
type | オブジェクトの種類を設定する | [最近使ったファイル] PowerShell Shell WindowsRestart (必須) |
ImageTemplateFileCustomizer
名前 | 説明 | 値 |
---|---|---|
type | イメージで使用するカスタマイズ ツールの種類。 たとえば、"Shell" はシェル カスタマイザーにすることができます | "File" (必須) |
destination | (入れ子になったディレクトリ構造が既に作成されている) ファイルへの絶対パス。このファイル (sourceUri から) が VM にアップロードされます | string |
sha256Checksum | 上記の sourceUri フィールドに指定されたファイルの SHA256 チェックサム | string |
sourceUri | VM をカスタマイズするためにアップロードするファイルの URI。 GitHub リンク、Azure Storage の SAS URI などです。 | string |
ImageTemplatePowerShellCustomizer
名前 | 説明 | 値 |
---|---|---|
type | イメージで使用するカスタマイズ ツールの種類。 たとえば、"Shell" はシェル カスタマイザーにすることができます | "PowerShell" (必須) |
inline | 実行する PowerShell コマンドの配列 | string[] |
runElevated | 指定した場合、PowerShell スクリプトは昇格された特権で実行されます | [bool] |
scriptUri | カスタマイズのために実行する PowerShell スクリプトの URI。 GitHub リンク、Azure Storage の SAS URI などです。 | string |
sha256Checksum | 上記の scriptUri フィールドで提供されている Power Shell スクリプトの SHA256 チェックサム | string |
validExitCodes | PowerShell スクリプトの有効な終了コード。 [既定値: 0] | int[] |
ImageTemplateShellCustomizer
名前 | 説明 | 値 |
---|---|---|
type | イメージで使用するカスタマイズ ツールの種類。 たとえば、"Shell" はシェル カスタマイザーにすることができます | "Shell" (必須) |
inline | 実行するシェル コマンドの配列 | string[] |
scriptUri | カスタマイズのために実行するシェル スクリプトの URI。 GitHub リンク、Azure Storage の SAS URI などです。 | string |
sha256Checksum | scriptUri フィールドで提供されるシェル スクリプトの SHA256 チェックサム | string |
ImageTemplateRestartCustomizer
名前 | 説明 | 値 |
---|---|---|
type | イメージで使用するカスタマイズ ツールの種類。 たとえば、"Shell" はシェル カスタマイザーにすることができます | "WindowsRestart" (必須) |
restartCheckCommand | 再起動が成功した場合にチェックするコマンド [既定値: ''] | string |
restartCommand | 再起動を実行するコマンド [既定値: 'shutdown /r /f /t 0 /c "packer restart"'] | string |
restartTimeout | 大きさと単位の文字列として指定された再起動タイムアウト (例: '5m' (5 分) または '2h' (2 時間) [既定値: '5m'] | string |
ImageTemplateDistributor
名前 | 説明 | 値 |
---|---|---|
artifactTags | ディストリビューターによって作成または更新された成果物に適用されるタグ。 | object |
runOutputName | 関連付けられた RunOutput に使用する名前。 | string (必須) |
型 | オブジェクトの種類を設定する | ManagedImage SharedImage VHD (必須) |
ImageTemplateManagedImageDistributor
名前 | 説明 | 値 |
---|---|---|
type | 分布の種類。 | "ManagedImage" (必須) |
imageId | マネージド ディスク イメージのリソース ID | string (必須) |
location | イメージの Azure の場所は、イメージが既に存在する場合は一致する必要があります | string (必須) |
ImageTemplateSharedImageDistributor
名前 | 説明 | 値 |
---|---|---|
type | 分布の種類。 | "SharedImage" (必須) |
galleryImageId | Shared Image Gallery イメージのリソース ID | string (必須) |
replicationRegions | イメージがレプリケートされるリージョンの一覧 | string[] (必須) |
ImageTemplateVhdDistributor
名前 | 説明 | 値 |
---|---|---|
type | 分布の種類。 | "VHD" (必須) |
ImageTemplateSource
名前 | 説明 | 値 |
---|---|---|
type | オブジェクトの種類を設定する | ISO ManagedImage PlatformImage SharedImageVersion (必須) |
ImageTemplateIsoSource
名前 | 説明 | 値 |
---|---|---|
type | 開始するソース イメージの種類を指定します。 | "ISO" (必須) |
sha256Checksum | ISO イメージの SHA256 チェックサム。 | string (必須) |
sourceUri | ISO イメージを取得する URI。 この URI は、イメージ テンプレートの作成時にリソース プロバイダーからアクセスできる必要があります。 | string (必須) |
ImageTemplateManagedImageSource
名前 | 説明 | 値 |
---|---|---|
type | 開始するソース イメージの種類を指定します。 | "ManagedImage" (必須) |
imageId | 顧客サブスクリプション内のマネージド イメージの ARM リソース ID | string (必須) |
ImageTemplatePlatformImageSource
名前 | 説明 | 値 |
---|---|---|
type | 開始するソース イメージの種類を指定します。 | "PlatformImage" (必須) |
offer | Azure ギャラリー イメージからのイメージ オファー。 | string |
publisher | Azure ギャラリー イメージの Image Publisher。 | string |
sku | Azure ギャラリー イメージのイメージ SKU。 | string |
version | Azure ギャラリー イメージのイメージ バージョン。 | string |
ImageTemplateSharedImageVersionSource
名前 | 説明 | 値 |
---|---|---|
type | 開始するソース イメージの種類を指定します。 | "SharedImageVersion" (必須) |
imageVersionId | 共有イメージ ギャラリー内のイメージ バージョンの ARM リソース ID | string (必須) |
ImageTemplateVmProfile
名前 | 説明 | 値 |
---|---|---|
vmSize | イメージのビルド、カスタマイズ、キャプチャに使用される仮想マシンのサイズ。 既定値 (Standard_D1_v2) を使用するには、空の文字列を省略または指定します。 | string |