次の方法で共有


az image builder customizer

イメージ ビルダー テンプレート カスタマイザーを管理します。

コマンド

名前 説明 状態
az image builder customizer add

イメージ ビルダー カスタマイザーをイメージ ビルダー テンプレートに追加します。

Core GA
az image builder customizer clear

イメージ ビルダー テンプレートからすべてのイメージ ビルダー カスタマイザーを削除します。

Core GA
az image builder customizer remove

イメージ ビルダー テンプレートからイメージ ビルダー カスタマイザーを削除します。

Core GA

az image builder customizer add

イメージ ビルダー カスタマイザーをイメージ ビルダー テンプレートに追加します。

--defer と共に使用する必要があります。

az image builder customizer add --customizer-name
                                --type {file, powershell, shell, windows-restart, windows-update}
                                [--defer]
                                [--dest-path]
                                [--exit-codes]
                                [--file-source]
                                [--filters]
                                [--ids]
                                [--inline-script]
                                [--name]
                                [--resource-group]
                                [--restart-check-command]
                                [--restart-command]
                                [--restart-timeout]
                                [--script-url]
                                [--search-criteria]
                                [--subscription]
                                [--update-limit]

cli オブジェクト キャッシュ内のイメージ テンプレートにインライン シェル カスタマイザーを追加する

az image builder customizer add -n myTemplate -g myGroup \
    --inline-script "sudo mkdir /buildArtifacts" \
                    "sudo cp /tmp/index.html /buildArtifacts/index.html" \
    --customizer-name shellScriptInline --type shell --defer

cli オブジェクト キャッシュ内のイメージ テンプレートにファイル カスタマイザーを追加する

az image builder customizer add -n myTemplate -g myGroup \
    --customizer-name myFile --type file \
    --file-source "https://my-remote-file.html" --dest-path "/tmp/index.html" --defer

cli オブジェクト キャッシュ内のイメージ テンプレートに Windows 再起動カスタマイザーを追加する

az image builder customizer add -n myTemplate -g myGroup \
--customizer-name shellScriptUrl \
--restart-check-command "echo Azure-Image-Builder-Restarted-the-VM  > \
                        c:\buildArtifacts\restart.txt" \
    --type windows-restart --restart-timeout 10m --defer

cli オブジェクト キャッシュ内のイメージ テンプレートに Windows Update カスタマイザーを追加します。

az image builder customizer add -n myTemplate -g myGroup --customizer-name winUpdate --type windows-update --search-criteria IsInstalled=0 --filters "exclude:\$_.Title -like \'*Preview*\'" "include:\$true" --update-limit 20 --defer

必須のパラメーター

--customizer-name

カスタマイザーの名前。

--type -t

イメージ テンプレートに追加するカスタマイザーの種類。

プロパティ
指定可能な値: file, powershell, shell, windows-restart, windows-update

省略可能のパラメーター

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--defer

Azure に送信するのではなく、オブジェクトをローカル キャッシュに一時的に格納します。 az cache コマンドを使用して表示/クリアします。

--dest-path

file-source で指定されたファイルがイメージ内にダウンロードされる絶対宛先パス。

プロパティ
Parameter group: File Arguments
--exit-codes -e

有効な終了コードのスペース区切りリスト (整数)。

プロパティ
Parameter group: Powershell Arguments
--file-source

イメージにダウンロードするファイルの URI。 GitHub リンク、Azure Storage の SAS URI などを指定できます。

プロパティ
Parameter group: File Arguments
--filters

適用する更新プログラムを選択するためのスペース区切りフィルター。 既定値 (フィルターなし) を使用するには、空の配列を省略または指定します。

プロパティ
Parameter group: Windows Update Arguments
--ids

1 つ以上のリソース ID (スペース区切り)。 これは、'Resource Id' 引数のすべての情報を含む完全なリソース ID である必要があります。 --ids または他の 'Resource Id' 引数を指定する必要があります。

プロパティ
Parameter group: Resource Id Arguments
--inline-script

イメージをカスタマイズするためのインライン スクリプト行のスペース区切りの一覧。

プロパティ
Parameter group: Shell and Powershell Arguments
--name -n

イメージ テンプレートの名前。

プロパティ
Parameter group: Resource Id Arguments
--resource-group -g

リソース グループの名前。 az configure --defaults group=<name>を使用して既定のグループを構成できます。

プロパティ
Parameter group: Resource Id Arguments
--restart-check-command

再起動が成功したことを確認するコマンド。

プロパティ
Parameter group: Windows Restart Arguments
--restart-command

再起動操作を実行するコマンド。

プロパティ
Parameter group: Windows Restart Arguments
--restart-timeout

"5m" (5 分) や "2h" (2 時間) など、大きさと単位で構成される文字列として指定された再起動タイムアウト。

プロパティ
Parameter group: Windows Restart Arguments
規定値: 5m
--script-url

イメージをカスタマイズするスクリプトの URL。 URL にはパブリックにアクセスできる必要があります。

プロパティ
Parameter group: Shell and Powershell Arguments
--search-criteria

更新プログラムを検索する条件。 既定値 (すべて検索) を使用するには、空の文字列を省略または指定します。 このフィールドの例と詳細な説明については、上記のリンクを参照してください。

プロパティ
Parameter group: Windows Update Arguments
--subscription

サブスクリプションの名前または ID。 az account set -s NAME_OR_IDを使用して既定のサブスクリプションを構成できます。

プロパティ
Parameter group: Resource Id Arguments
--update-limit

一度に適用する更新プログラムの最大数。 既定値 (1000) を使用するには、0 を省略または指定します。

プロパティ
Parameter group: Windows Update Arguments
グローバル パラメーター
--debug

ログの詳細度を上げて、すべてのデバッグ ログを表示します。

プロパティ
規定値: False
--help -h

このヘルプ メッセージを表示して終了します。

--only-show-errors

エラーのみを表示し、警告を抑制します。

プロパティ
規定値: False
--output -o

Output format.

プロパティ
規定値: json
指定可能な値: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath クエリ文字列。 詳細と例については、http://jmespath.org/ を参照してください。

--verbose

ログの詳細度を高める。 完全なデバッグ ログには --debug を使用します。

プロパティ
規定値: False

az image builder customizer clear

イメージ ビルダー テンプレートからすべてのイメージ ビルダー カスタマイザーを削除します。

--defer と共に使用する必要があります。

az image builder customizer clear [--defer]
                                  [--ids]
                                  [--name]
                                  [--resource-group]
                                  [--subscription]

省略可能のパラメーター

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--defer

Azure に送信するのではなく、オブジェクトをローカル キャッシュに一時的に格納します。 az cache コマンドを使用して表示/クリアします。

--ids

1 つ以上のリソース ID (スペース区切り)。 これは、'Resource Id' 引数のすべての情報を含む完全なリソース ID である必要があります。 --ids または他の 'Resource Id' 引数を指定する必要があります。

プロパティ
Parameter group: Resource Id Arguments
--name -n

イメージ テンプレートの名前。

プロパティ
Parameter group: Resource Id Arguments
--resource-group -g

リソース グループの名前。 az configure --defaults group=<name>を使用して既定のグループを構成できます。

プロパティ
Parameter group: Resource Id Arguments
--subscription

サブスクリプションの名前または ID。 az account set -s NAME_OR_IDを使用して既定のサブスクリプションを構成できます。

プロパティ
Parameter group: Resource Id Arguments
グローバル パラメーター
--debug

ログの詳細度を上げて、すべてのデバッグ ログを表示します。

プロパティ
規定値: False
--help -h

このヘルプ メッセージを表示して終了します。

--only-show-errors

エラーのみを表示し、警告を抑制します。

プロパティ
規定値: False
--output -o

Output format.

プロパティ
規定値: json
指定可能な値: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath クエリ文字列。 詳細と例については、http://jmespath.org/ を参照してください。

--verbose

ログの詳細度を高める。 完全なデバッグ ログには --debug を使用します。

プロパティ
規定値: False

az image builder customizer remove

イメージ ビルダー テンプレートからイメージ ビルダー カスタマイザーを削除します。

--defer と共に使用する必要があります。

az image builder customizer remove --customizer-name
                                   [--defer]
                                   [--ids]
                                   [--name]
                                   [--resource-group]
                                   [--subscription]

必須のパラメーター

--customizer-name

カスタマイザーの名前。

省略可能のパラメーター

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--defer

Azure に送信するのではなく、オブジェクトをローカル キャッシュに一時的に格納します。 az cache コマンドを使用して表示/クリアします。

--ids

1 つ以上のリソース ID (スペース区切り)。 これは、'Resource Id' 引数のすべての情報を含む完全なリソース ID である必要があります。 --ids または他の 'Resource Id' 引数を指定する必要があります。

プロパティ
Parameter group: Resource Id Arguments
--name -n

イメージ テンプレートの名前。

プロパティ
Parameter group: Resource Id Arguments
--resource-group -g

リソース グループの名前。 az configure --defaults group=<name>を使用して既定のグループを構成できます。

プロパティ
Parameter group: Resource Id Arguments
--subscription

サブスクリプションの名前または ID。 az account set -s NAME_OR_IDを使用して既定のサブスクリプションを構成できます。

プロパティ
Parameter group: Resource Id Arguments
グローバル パラメーター
--debug

ログの詳細度を上げて、すべてのデバッグ ログを表示します。

プロパティ
規定値: False
--help -h

このヘルプ メッセージを表示して終了します。

--only-show-errors

エラーのみを表示し、警告を抑制します。

プロパティ
規定値: False
--output -o

Output format.

プロパティ
規定値: json
指定可能な値: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath クエリ文字列。 詳細と例については、http://jmespath.org/ を参照してください。

--verbose

ログの詳細度を高める。 完全なデバッグ ログには --debug を使用します。

プロパティ
規定値: False