Microsoft.VirtualMachineImages imageTemplates 2019-02-01-preview
Bicep リソース定義
imageTemplates リソースの種類は、次の対象にデプロイできます。
- リソース グループ - リソース グループのデプロイ コマンドを参照してください
各 API バージョンの変更されたプロパティの一覧については、「 変更ログ」を参照してください。
リソース形式
Microsoft.VirtualMachineImages/imageTemplates リソースを作成するには、次の Bicep をテンプレートに追加します。
resource symbolicname 'Microsoft.VirtualMachineImages/imageTemplates@2019-02-01-preview' = {
name: 'string'
location: 'string'
tags: {
tagName1: 'tagValue1'
tagName2: 'tagValue2'
}
properties: {
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
}
}
}
ImageTemplateCustomizer オブジェクト
オブジェクトの 型 を指定するには、type プロパティを設定します。
PowerShell の場合は、次の値を使用します。
type: 'PowerShell'
inline: [
'string'
]
script: 'string'
validExitCodes: [
int
]
Shell の場合は、次のコマンドを使用します。
type: 'Shell'
inline: [
'string'
]
script: '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'
プロパティ値
imageTemplates
名前 | 説明 | 値 |
---|---|---|
name | リソース名 | string (必須) |
location | リソースの場所 | string (必須) |
tags | リソース タグ | タグの名前と値のディクショナリ。 「テンプレート内のタグ」を参照してください |
properties | ImageTemplateProperties |
ImageTemplateProperties
名前 | 説明 | 値 |
---|---|---|
カスタマイズ | イメージ ソースなど、イメージのカスタマイズ手順を記述するために使用されるプロパティを指定します。 | ImageTemplateCustomizer[] |
配布 (distribute) | イメージ出力の移動先となる配布ターゲット。 | ImageTemplateDistributor[] (必須) |
source | ソース イメージの記述に使用するプロパティを指定します。 | ImageTemplateSource (必須) |
ImageTemplateCustomizer
名前 | 説明 | 値 |
---|---|---|
name | このカスタマイズ手順の内容に関するコンテキストを提供するフレンドリ名 | string |
type | オブジェクトの種類を設定する | PowerShell Shell WindowsRestart (必須) |
ImageTemplatePowerShellCustomizer
名前 | 説明 | 値 |
---|---|---|
type | イメージで使用するカスタマイズ ツールの種類。 たとえば、"Shell" はシェル カスタマイザーにすることができます | 'PowerShell' (必須) |
inline | 実行する PowerShell コマンドの配列 | string[] |
script | カスタマイズのために実行する PowerShell スクリプト。 GitHub リンク、Azure Storage の SAS URI などです。 | string |
validExitCodes | PowerShell スクリプトの有効な終了コード。 [既定値: 0] | int[] |
ImageTemplateShellCustomizer
名前 | 説明 | 値 |
---|---|---|
type | イメージで使用するカスタマイズ ツールの種類。 たとえば、"Shell" はシェル カスタマイザーにすることができます | 'Shell' (必須) |
inline | 実行するシェル コマンドの配列 | string[] |
script | カスタマイズのために実行するシェル スクリプト。 GitHub リンク、Azure Storage の SAS URI などです。 | 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 (必須) |
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 |
クイック スタート テンプレート
次のクイックスタート テンプレートでは、このリソースの種類をデプロイします。
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-02-01-preview",
"name": "string",
"location": "string",
"tags": {
"tagName1": "tagValue1",
"tagName2": "tagValue2"
},
"properties": {
"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
}
}
}
ImageTemplateCustomizer オブジェクト
オブジェクトの 型 を指定するには、type プロパティを設定します。
PowerShell の場合は、次の値を使用します。
"type": "PowerShell",
"inline": [ "string" ],
"script": "string",
"validExitCodes": [ "int" ]
Shell の場合は、次のコマンドを使用します。
"type": "Shell",
"inline": [ "string" ],
"script": "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"
プロパティ値
imageTemplates
名前 | 説明 | 値 |
---|---|---|
type | リソースの種類 | 'Microsoft.VirtualMachineImages/imageTemplates' |
apiVersion | リソース API のバージョン | '2019-02-01-preview' |
name | リソース名 | string (必須) |
location | リソースの場所 | string (必須) |
tags | リソース タグ | タグの名前と値のディクショナリ。 「テンプレート内のタグ」を参照してください |
properties | ImageTemplateProperties |
ImageTemplateProperties
名前 | 説明 | 値 |
---|---|---|
カスタマイズ | イメージ ソースなど、イメージのカスタマイズ手順を記述するために使用されるプロパティを指定します。 | ImageTemplateCustomizer[] |
配布 (distribute) | イメージ出力の移動先となる配布ターゲット。 | ImageTemplateDistributor[] (必須) |
source | ソース イメージの記述に使用するプロパティを指定します。 | ImageTemplateSource (必須) |
ImageTemplateCustomizer
名前 | 説明 | 値 |
---|---|---|
name | このカスタマイズ手順の内容に関するコンテキストを提供するフレンドリ名 | string |
type | オブジェクトの種類を設定する | PowerShell Shell WindowsRestart (必須) |
ImageTemplatePowerShellCustomizer
名前 | 説明 | 値 |
---|---|---|
type | イメージで使用するカスタマイズ ツールの種類。 たとえば、"Shell" はシェル カスタマイザーにすることができます | 'PowerShell' (必須) |
inline | 実行する PowerShell コマンドの配列 | string[] |
script | カスタマイズのために実行する PowerShell スクリプト。 GitHub リンク、Azure Storage の SAS URI などです。 | string |
validExitCodes | PowerShell スクリプトの有効な終了コード。 [既定値: 0] | int[] |
ImageTemplateShellCustomizer
名前 | 説明 | 値 |
---|---|---|
type | イメージで使用するカスタマイズ ツールの種類。 たとえば、"Shell" はシェル カスタマイザーにすることができます | 'Shell' (必須) |
inline | 実行するシェル コマンドの配列 | string[] |
script | カスタマイズのために実行するシェル スクリプト。 GitHub リンク、Azure Storage の SAS URI などです。 | 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 (必須) |
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 |
クイック スタート テンプレート
次のクイックスタート テンプレートでは、このリソースの種類をデプロイします。
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-02-01-preview"
name = "string"
location = "string"
parent_id = "string"
tags = {
tagName1 = "tagValue1"
tagName2 = "tagValue2"
}
body = jsonencode({
properties = {
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
}
}
})
}
ImageTemplateCustomizer オブジェクト
オブジェクトの 型 を指定するには、type プロパティを設定します。
PowerShell の場合は、次の値を使用します。
type = "PowerShell"
inline = [
"string"
]
script = "string"
validExitCodes = [
int
]
Shell の場合は、次のコマンドを使用します。
type = "Shell"
inline = [
"string"
]
script = "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"
プロパティ値
imageTemplates
名前 | 説明 | 値 |
---|---|---|
type | リソースの種類 | "Microsoft.VirtualMachineImages/imageTemplates@2019-02-01-preview" |
name | リソース名 | string (必須) |
location | リソースの場所 | string (必須) |
parent_id | リソース グループにデプロイするには、そのリソース グループの ID を使用します。 | string (必須) |
tags | リソース タグ | タグの名前と値のディクショナリ。 |
properties | ImageTemplateProperties |
ImageTemplateProperties
名前 | 説明 | 値 |
---|---|---|
カスタマイズ | イメージ ソースなど、イメージのカスタマイズ手順を記述するために使用されるプロパティを指定します。 | ImageTemplateCustomizer[] |
配布 (distribute) | イメージ出力の移動先となる配布ターゲット。 | ImageTemplateDistributor[] (必須) |
source | ソース イメージの記述に使用するプロパティを指定します。 | ImageTemplateSource (必須) |
ImageTemplateCustomizer
名前 | 説明 | 値 |
---|---|---|
name | このカスタマイズ手順の内容に関するコンテキストを提供するフレンドリ名 | string |
type | オブジェクトの種類を設定する | PowerShell Shell WindowsRestart (必須) |
ImageTemplatePowerShellCustomizer
名前 | 説明 | 値 |
---|---|---|
type | イメージで使用するカスタマイズ ツールの種類。 たとえば、"Shell" はシェル カスタマイザーにすることができます | "PowerShell" (必須) |
inline | 実行する PowerShell コマンドの配列 | string[] |
script | カスタマイズのために実行する PowerShell スクリプト。 GitHub リンク、Azure Storage の SAS URI などです。 | string |
validExitCodes | PowerShell スクリプトの有効な終了コード。 [既定値: 0] | int[] |
ImageTemplateShellCustomizer
名前 | 説明 | 値 |
---|---|---|
type | イメージで使用するカスタマイズ ツールの種類。 たとえば、"Shell" はシェル カスタマイザーにすることができます | "Shell" (必須) |
inline | 実行するシェル コマンドの配列 | string[] |
script | カスタマイズのために実行するシェル スクリプト。 GitHub リンク、Azure Storage の SAS URI などです。 | 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 (必須) |
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 |