az sig image-version

注意

此命令群組具有 Azure CLI 和至少一個擴充功能中定義的命令。 安裝每個擴充功能以受益於其擴充功能。 深入了解擴充功能。

使用 VM 管理共用資源庫映像版本。

命令

名稱 Description 類型 狀態
az sig image-version create

建立新的映像版本。

核心 GA
az sig image-version delete

刪除資源庫映像版本。

核心 GA
az sig image-version list

列出資源庫映像定義中的資源庫映像版本。

核心 GA
az sig image-version list-community

列出資源庫社群中的 VM 映像版本。

核心 GA
az sig image-version list-community (image-gallery 擴充功能)

列出資源庫社群中的 VM 映像版本(預覽版)。

副檔名 實驗性
az sig image-version list-shared

列出直接與您的訂用帳戶或租用戶共用的資源庫中的 VM 映射版本。

核心 GA
az sig image-version show

擷取資源庫映像版本的相關信息。

核心 GA
az sig image-version show-community

取得社群資源庫映像版本。

核心 GA
az sig image-version show-community (image-gallery 擴充功能)

在資源庫社群中取得映像版本(預覽版)。

副檔名 實驗性
az sig image-version show-shared

在直接與您的訂用帳戶或租用戶共享的資源庫中取得映像版本。

核心 GA
az sig image-version undelete

還原虛刪除的映像版本。

核心 預覽
az sig image-version update

更新共用映像版本。

核心 GA
az sig image-version wait

等候映像版本相關作業。

核心 GA

az sig image-version create

建立新的映像版本。

此作業可能需要很長的時間,視復寫區域號碼而定。 建議使用 「--no-wait」。

az sig image-version create --gallery-image-definition
                            --gallery-image-version
                            --gallery-name
                            --resource-group
                            [--allow-replicated-location-deletion {false, true}]
                            [--data-snapshot-luns]
                            [--data-snapshots]
                            [--data-vhds-luns]
                            [--data-vhds-sa]
                            [--data-vhds-uris]
                            [--end-of-life-date]
                            [--exclude-from-latest {false, true}]
                            [--image-version]
                            [--location]
                            [--managed-image]
                            [--no-wait]
                            [--os-snapshot]
                            [--os-vhd-storage-account]
                            [--os-vhd-uri]
                            [--replica-count]
                            [--replication-mode {Full, Shallow}]
                            [--storage-account-type {Premium_LRS, Standard_LRS, Standard_ZRS}]
                            [--tags]
                            [--target-edge-zone-encryption]
                            [--target-edge-zones]
                            [--target-region-cvm-encryption]
                            [--target-region-encryption]
                            [--target-regions]
                            [--virtual-machine]

範例

從虛擬機新增映像版本

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--virtual-machine /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/virtualMachines/MyVM

從受控映像新增映像版本

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--managed-image /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/images/MyManagedImage

從另一個映像版本新增映像版本

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--image-version /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/galleries/MyGallery/images/MyImageDefinition/versions/1.0.0

從受控磁碟新增映像版本

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--os-snapshot /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/disks/MyOSDisk

從受控磁碟新增映像版本,並新增其他數據磁碟

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--os-snapshot /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/disks/MyOSDisk \
--data-snapshots /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/disks/MyDataDisk \
--data-snapshot-luns 0

從 OS 磁碟的快照集新增映像版本。

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--os-snapshot /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/snapshots/MyOsDiskSnapshot

從 OS 磁碟的快照集新增映像版本,並將其他快照集新增為數據磁碟

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--os-snapshot /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/snapshots/MyOsDiskSnapshot \
--data-snapshots /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/snapshots/MyDiskSnapshot \
--data-snapshot-luns 0

從 OS 磁碟的 VHD 新增映像版本。

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--os-vhd-storage-account /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Storage/storageAccounts/mystorageaccount \
--os-vhd-uri https://mystorageaccount.blob.core.windows.net/container/path_to_vhd_file

從 OS 磁碟的 VHD 新增映像版本,並將其他 VHD 新增為數據磁碟

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--os-vhd-storage-account /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Storage/storageAccounts/mystorageaccount \
--os-vhd-uri https://mystorageaccount.blob.core.windows.net/container/path_to_vhd_file \
--data-vhds-sa /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Storage/storageAccounts/myotherstorageaccount \
--data-vhds-uris https://myotherstorageaccount.blob.core.windows.net/container/path_to_vhd_file \
--data-vhds-luns 0

您可以結合快照集、受控磁碟和 VHD 來建立新的映射版本。 使用 VHD 作為 OS 磁碟和受控磁碟,以及作為數據磁碟的快照集來新增映射版本。

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--os-vhd-storage-account /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Storage/storageAccounts/mystorageaccount \
--os-vhd-uri https://mystorageaccount.blob.core.windows.net/container/path_to_vhd_file \
--data-snapshots /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/disks/MyDataDisk subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/snapshots/MyDiskSnapshot \
--data-snapshot-luns 0 1

新增映像版本,並將其複製到其他區域。 映射版本來源的主位置必須包含在目標區域清單中。 針對每個額外的區域,您可以指定不同的複本計數和記憶體帳戶類型。 否則,區域會繼承自全域。 默認複本計數為 1,預設記憶體帳戶類型為標準 LRS。 在此範例中,eastus2 將有一個複本儲存在標準 ZRS 記憶體上,ukwest 將有 3 個復本儲存在標準 ZRS 記憶體上,southindia 將有一個複本儲存在標準 LRS 記憶體上,而 brazilsouth 將有 2 個復本儲存在標準 LRS 記憶體上。

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 --replica-count 1 \
--storage-account-type Standard_ZRS --managed-image image-name \
--target-regions eastus2 ukwest=3 southindia=standard_lrs \
brazilsouth=2=standard_lrs

使用磁碟加密集來新增具有加密的新映像版本。 加密會套用至映像版本一部分的每個磁碟。

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--virtual-machine /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/virtualMachines/MyVM \
--target-regions westus=2=standard eastus \
--target-region-encryption WestUSDiskEncryptionSet1,0,WestUSDiskEncryptionSet2 \
EastUSDiskEncryptionSet1,0,EastUSDiskEncryptionSet2

新增映像版本,並將其複製到擴充位置。

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 --replica-count 1 \
--storage-account-type Standard_ZRS --managed-image image-name \
--target-edge-zones westus=microsoftlosangeles1 eastus=microsoftlosangeles2=1 \
brazilsouth=2=standard_lrs

新增映像版本,並使用磁碟加密集將它複製到具有加密的擴充位置。

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--virtual-machine /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/virtualMachines/MyVM \
--target-edge-zones westus=microsoftlosangeles1 \
--target-edge-zone-encryption microsoftlosangeles1,WestUSDiskEncryptionSet1,0,WestUSDiskEncryptionSet2

新增映像版本,不要等候。 稍後您可以在準備好從資源庫映像版本建立 VM 時叫用 “az sig image-version wait” 命令

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--virtual-machine /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/virtualMachines/MyVM \
--no-wait

新增映像版本,但將其從考慮中移除為映像定義中的最新版本

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--virtual-machine /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/virtualMachines/MyVM \
--exclude-from-latest true

新增映像版本,並設定其生命周期結束日期。 映像版本仍可用來在其生命周期結束日期之後建立虛擬機。

az sig image-version create --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--virtual-machine /subscriptions/00000000-0000-0000-0000-00000000xxxx/resourceGroups/imageGroups/providers/Microsoft.Compute/virtualMachines/MyVM \
--end-of-life-date 2024-08-02T00:00:00+00:00

必要參數

--gallery-image-definition -i

資源庫映像定義。

--gallery-image-version -e

語意版本模式中的資源庫映像版本。 允許的字元為數位和句點。 數字必須介於32位整數的範圍內,例如 <MajorVersion>.<MinorVersion>.<Patch>

--gallery-name -r

資源庫名稱。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--allow-replicated-location-deletion

指出是否允許從復寫區域移除此資源庫映像版本。

接受的值: false, true
--data-snapshot-luns

數據磁碟快照集的邏輯單元編號(以空格分隔)。

--data-snapshots

數據磁碟快照集的名稱或標識碼(以空格分隔)。

--data-vhds-luns

數據磁碟來源 VHD URI 的邏輯單元編號(空格分隔)。

--data-vhds-sa --data-vhds-storage-accounts

數據磁碟來源 VHD URI 記憶體帳戶的名稱或識別碼(以空格分隔)。

--data-vhds-uris

數據磁碟的來源 VHD URI(空格分隔)。

--end-of-life-date

生命周期結束日期,例如 『2020-12-31』。

--exclude-from-latest

旗標表示如果設定為 true,則省略版本部署 VM 的人員將不會使用此版本。

接受的值: false, true
--image-version

資源庫映像版本來源的資源標識碼。

--location -l

位置。​​ 來自的值: az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

--managed-image

映射名稱(如果位於相同的資源群組中)或資源識別碼。

--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--os-snapshot

OS 磁碟快照集的名稱或標識碼。

--os-vhd-storage-account

OS 磁碟來源 VHD URI 的記憶體帳戶名稱或標識碼。

--os-vhd-uri

OS 磁碟的來源 VHD URI。

--replica-count

要為每個區域建立的預設複本數目。 若要設定區域復寫計數,請使用 --target-regions。

--replication-mode

選擇性參數,指定要用於複寫的模式。 這個屬性無法更新。

接受的值: Full, Shallow
--storage-account-type

每個區域要使用的預設記憶體帳戶類型。 若要設定區域記憶體帳戶類型,請使用 --target-regions。

接受的值: Premium_LRS, Standard_LRS, Standard_ZRS
--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。

--target-edge-zone-encryption --zone-encryption

客戶受控金鑰的空間分隔清單,以加密每個區域的資源庫成品中的 OS 和數據磁碟。 每個邊緣區域的格式:、<os_des、lun1_des><、<lun2_des>。>

--target-edge-zones

區域、邊緣區域、複本計數和記憶體類型的空格分隔清單。 使用 =[=][=] 選擇性地為每個區域設定複本計數和/或記憶體帳戶類型。 如果未指定複本計數,則會使用預設複本計數。 如果未指定記憶體帳戶類型,則會使用預設記憶體帳戶類型。 如果指定 「--target-edge-zones None」,則會清除目標擴充位置。

--target-region-cvm-encryption

每個區域資源庫成品中加密OS磁碟之機密 VM 的客戶受控密鑰空間分隔清單。 每個區域的格式: <os_cvm_encryption_type>,<os_cvm_des>。 os_cvm_encryption_type的有效值為 EncryptedVMGuestStateOnlyWithPmk、EncryptedWithPmk、EncryptedWithCmk。

--target-region-encryption

客戶受控金鑰的空間分隔清單,以加密每個區域的資源庫成品中的 OS 和數據磁碟。 每個區域的格式: <os_des>,<lun1>,<lun1_des>,<lun2>,<lun2_des>。 使用 「null」 作為佔位元。

--target-regions

區域及其復本計數的空間分隔清單。 使用 <region>[=<replica count>][=<storage account type>] 來選擇性地設定每個區域的複本計數和/或記憶體帳戶類型。 如果未指定複本計數,則會使用預設複本計數。 如果未指定記憶體帳戶類型,則會使用預設記憶體帳戶類型。

--virtual-machine

VM 來源的資源標識碼。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az sig image-version delete

刪除資源庫映像版本。

az sig image-version delete [--gallery-image-definition]
                            [--gallery-image-version]
                            [--gallery-name]
                            [--ids]
                            [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                            [--resource-group]
                            [--subscription]

選擇性參數

--gallery-image-definition --gallery-image-name -i

映射版本所在的資源庫映像定義名稱。

--gallery-image-version --gallery-image-version-name -e

要刪除的資源庫映像版本名稱。

--gallery-name -r

影像定義所在的 共用映像庫 名稱。

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--no-wait

請勿等候長時間執行的作業完成。

接受的值: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az sig image-version list

列出資源庫映像定義中的資源庫映像版本。

az sig image-version list --gallery-image-definition
                          --gallery-name
                          --resource-group
                          [--max-items]
                          [--next-token]

必要參數

--gallery-image-definition --gallery-image-name -i

資源庫映像定義。

--gallery-name -r

資源庫名稱。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--max-items

命令輸出中要傳回的項目總數。 如果可用的專案總數超過指定的值,則會在命令的輸出中提供令牌。 若要繼續分頁,請在後續命令的自變數中 --next-token 提供令牌值。

--next-token

標記,指定要開始分頁的位置。 這是先前截斷回應中的令牌值。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az sig image-version list-community

列出資源庫社群中的 VM 映像版本。

az sig image-version list-community [--gallery-image-definition]
                                    [--ids]
                                    [--location]
                                    [--marker]
                                    [--public-gallery-name]
                                    [--show-next-marker]
                                    [--subscription]

範例

列出資源庫社群中的映像版本。

az sig image-version list-community --public-gallery-name publicGalleryName \
--gallery-image-definition MyImage --location myLocation

選擇性參數

--gallery-image-definition -i

要列出映像版本的社群資源庫映像定義名稱。

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--location -l

位置。​​ 來自的值: az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

--marker

字串值,識別要隨著下一個清單作業傳回之容器清單的部分。 如果清單作業未傳回剩餘的所有容器,則此作業會傳回響應主體內的 NextMarker 值,以與目前頁面一起列出。 如果指定,這個產生器會從前一個產生器停止的點開始傳回結果。

--public-gallery-name

社群資源庫的公用名稱。

--show-next-marker

指定時,在結果中顯示 nextMarker。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az sig image-version list-community (image-gallery 擴充功能)

實驗

此命令是實驗性且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

列出資源庫社群中的 VM 映像版本(預覽版)。

列出資源庫社群中的 VM 映像版本(私人預覽功能,請透過電子郵件 sigpmdev@microsoft.com 連絡社群映像庫小組,以註冊預覽版,如果您有興趣使用此功能)。

az sig image-version list-community [--gallery-image-definition]
                                    [--ids]
                                    [--location]
                                    [--marker]
                                    [--public-gallery-name]
                                    [--show-next-marker]
                                    [--subscription]

範例

列出資源庫社群中的映像版本。

az sig image-version list-community --public-gallery-name publicGalleryName \
--gallery-image-definition MyImage --location myLocation

選擇性參數

--gallery-image-definition -i

要列出映像版本的社群資源庫映像定義名稱。

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--location -l

位置。​​ 來自的值: az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

--marker

字串值,識別要隨著下一個清單作業傳回之容器清單的部分。 如果清單作業未傳回剩餘的所有容器,則此作業會傳回響應主體內的 NextMarker 值,以與目前頁面一起列出。 如果指定,這個產生器會從前一個產生器停止的點開始傳回結果。

--public-gallery-name

社群資源庫的公用名稱。

--show-next-marker

指定時,在結果中顯示 nextMarker。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az sig image-version list-shared

列出直接與您的訂用帳戶或租用戶共用的資源庫中的 VM 映射版本。

az sig image-version list-shared [--gallery-image-definition]
                                 [--gallery-unique-name]
                                 [--ids]
                                 [--location]
                                 [--marker]
                                 [--shared-to {tenant}]
                                 [--show-next-marker]
                                 [--subscription]

範例

列出資源庫中的映像版本,直接在指定的位置和映像定義中共用至您的訂用帳戶。

az sig image-version list-shared --gallery-unique-name galleryUniqueName \
--gallery-image-definition MyImage --location myLocation

列出資源庫中的映像版本,直接在指定的位置和映像定義中與您的租用戶共用。

az sig image-version list-shared --gallery-unique-name galleryUniqueName \
--gallery-image-definition MyImage --location myLocation --shared-to tenant

選擇性參數

--gallery-image-definition -i

要列出映像版本的共享資源庫映像定義名稱。

--gallery-unique-name

共用資源庫的唯一名稱。

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--location -l

位置。​​ 來自的值: az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

--marker

字串值,識別要隨著下一個清單作業傳回之容器清單的部分。 如果清單作業未傳回剩餘的所有容器,則此作業會傳回響應主體內的 NextMarker 值,以與目前頁面一起列出。 如果指定,這個產生器會從前一個產生器停止的點開始傳回結果。

--shared-to

查詢參數,決定執行清單作業時要擷取的共用資源庫。 如果未指定,請依訂用帳戶標識碼列出。

接受的值: tenant
--show-next-marker

指定時,在結果中顯示 nextMarker。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az sig image-version show

擷取資源庫映像版本的相關信息。

az sig image-version show --gallery-image-definition
                          --gallery-image-version
                          --gallery-name
                          --resource-group
                          [--expand]

必要參數

--gallery-image-definition -i

資源庫映像定義。

--gallery-image-version -e

語意版本模式中的資源庫映像版本。 允許的字元為數位和句點。 數字必須介於32位整數的範圍內,例如 <MajorVersion>.<MinorVersion>.<Patch>

--gallery-name -r

資源庫名稱。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--expand

要套用至作業的展開表達式,例如 『ReplicationStatus』。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az sig image-version show-community

取得社群資源庫映像版本。

az sig image-version show-community [--gallery-image-definition]
                                    [--gallery-image-version]
                                    [--ids]
                                    [--location]
                                    [--public-gallery-name]
                                    [--subscription]

選擇性參數

--gallery-image-definition --gallery-image-name -i

要列出映像版本的社群資源庫映像定義名稱。

--gallery-image-version --gallery-image-version-name -e

語意版本模式中的資源庫映像版本。 允許的字元為數位和句點。 數字必須介於32位整數的範圍內,例如 <MajorVersion>.<MinorVersion>.<Patch>

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--location -l

位置。​​ 來自的值: az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

--public-gallery-name

社群資源庫的公用名稱。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az sig image-version show-community (image-gallery 擴充功能)

實驗

此命令是實驗性且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

在資源庫社群中取得映像版本(預覽版)。

取得資源庫社群中的映像版本(私人預覽功能,請透過電子郵件 sigpmdev@microsoft.com 連絡社群映像庫小組,以註冊預覽版,如果您有興趣使用此功能)。

az sig image-version show-community [--gallery-image-definition]
                                    [--gallery-image-version]
                                    [--ids]
                                    [--location]
                                    [--public-gallery-name]
                                    [--subscription]

範例

在指定位置的資源庫社群中取得映像版本。

az sig image-version show-community --public-gallery-name publicGalleryName \
--gallery-image-definition MyImage --gallery-image-version 1.0.0 --location myLocation

選擇性參數

--gallery-image-definition -i

要列出映像版本的社群資源庫映像定義名稱。

--gallery-image-version -e

要建立的資源庫映像版本名稱。 必須遵循語意版本名稱模式:允許的字元為數位和句號。 數字必須介於32位整數的範圍內。 格式:。。。

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--location -l

位置。​​ 來自的值: az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

--public-gallery-name

社群資源庫的公用名稱。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az sig image-version show-shared

在直接與您的訂用帳戶或租用戶共享的資源庫中取得映像版本。

az sig image-version show-shared [--gallery-image-definition]
                                 [--gallery-image-version]
                                 [--gallery-unique-name]
                                 [--ids]
                                 [--location]
                                 [--subscription]

範例

取得資源庫中的映像版本,直接共用至指定位置中的訂用帳戶或租使用者。

az sig image-version show-shared --gallery-unique-name galleryUniqueName --gallery-image-definition MyImage --gallery-image-version 1.0.0 --location myLocation

選擇性參數

--gallery-image-definition --gallery-image-name -i

要列出映像版本的共享資源庫映像定義名稱。

--gallery-image-version --gallery-image-version-name -e

要建立的資源庫映像版本名稱。 必須遵循語意版本名稱模式:允許的字元為數位和句號。 數字必須介於32位整數的範圍內。 格式:。。。

--gallery-unique-name

共用資源庫的唯一名稱。

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源標識碼」自變數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」自變數。

--location -l

位置。​​ 來自的值: az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az sig image-version undelete

預覽

此命令處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

還原虛刪除的映像版本。

只有在資源庫內使用虛刪除時,作業才會成功。

az sig image-version undelete --gallery-image-definition
                              --gallery-image-version
                              --gallery-name
                              --resource-group
                              [--allow-replicated-location-deletion {false, true}]
                              [--location]
                              [--no-wait]
                              [--tags]

範例

還原虛刪除的映像版本

az sig image-version undelete --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.1.1

必要參數

--gallery-image-definition -i

資源庫映像定義。

--gallery-image-version -e

語意版本模式中的資源庫映像版本。 允許的字元為數位和句點。 數字必須介於32位整數的範圍內,例如 <MajorVersion>.<MinorVersion>.<Patch>

--gallery-name -r

資源庫名稱。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--allow-replicated-location-deletion

指出是否允許從復寫區域移除此資源庫映像版本。

接受的值: false, true
--location -l

位置。​​ 來自的值: az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「清除現有的標記」。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az sig image-version update

更新共用映像版本。

az sig image-version update --gallery-image-definition
                            --gallery-image-version
                            --gallery-name
                            --resource-group
                            [--add]
                            [--allow-replicated-location-deletion {false, true}]
                            [--force-string]
                            [--no-wait]
                            [--remove]
                            [--replica-count]
                            [--set]
                            [--target-edge-zones]
                            [--target-regions]

範例

變更複寫區域和複本計數

az sig image-version update --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--target-regions westcentralus=2 eastus2

變更復寫擴充位置

az sig image-version update --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--target-edge-zones westus=microsoftlosangeles1 eastus=microsoftlosangeles2=1

清除複寫擴充位置

az sig image-version update --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--target-edge-zones None

復寫至其他區域。 您可以選擇性地設定區域的複本計數,並在使用最新版本的映像定義時排除此映像。

az sig image-version update --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0 \
--add publishingProfile.targetRegions name=westcentralus \
regionalReplicaCount=3 excludeFromLatest=true

變更映像是否應該納入映像定義中最新版本的考慮中。 將此值設定為 true 會將影像排除在考慮中,並將此值設定為 false 包含要考慮的映像。

az sig image-version update -g MyResourceGroup --gallery-name MyGallery \
--gallery-image-definition MyImage --gallery-image-version 1.0.0 \
--set publishingProfile.excludeFromLatest=true

變更映像版本的生命週期結束日期。 映像仍可用來在生命周期結束日期之後建立虛擬機。

az sig image-version update -g MyResourceGroup --gallery-name MyGallery \
--gallery-image-definition MyImage --gallery-image-version 1.0.0 \
--set publishingProfile.endOfLifeDate=2024-08-02T00:00:00+00:00

允許從復寫的區域移除資源庫映像版本。

az sig image-version update -g MyResourceGroup --gallery-name MyGallery \
--gallery-image-definition MyImage --gallery-image-version 1.0.0 \
--set safetyProfile.allowDeletionOfReplicatedLocations=true

必要參數

--gallery-image-definition -i

資源庫映像定義。

--gallery-image-version -e

語意版本模式中的資源庫映像版本。 允許的字元為數位和句點。 數字必須介於32位整數的範圍內,例如 <MajorVersion>.<MinorVersion>.<Patch>

--gallery-name -r

資源庫名稱。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--add

藉由指定路徑和索引鍵值組,將物件加入物件清單。 範例:--add property.listProperty <key=value, string or JSON string>

預設值: []
--allow-replicated-location-deletion

指出是否允許從復寫區域移除此資源庫映像版本。

接受的值: false, true
--force-string

使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。

預設值: False
--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--remove

從清單中移除屬性或專案。 範例: --remove property.list <indexToRemove>--remove propertyToRemove

預設值: []
--replica-count

要為每個區域建立的預設複本數目。 若要設定區域復寫計數,請使用 --target-regions。

--set

指定要設定的屬性路徑和值,以更新物件。 範例:--set property1.property2=<value>

預設值: []
--target-edge-zones

區域、邊緣區域、複本計數和記憶體類型的空格分隔清單。 使用 =[=][=] 選擇性地為每個區域設定複本計數和/或記憶體帳戶類型。 如果未指定複本計數,則會使用預設複本計數。 如果未指定記憶體帳戶類型,則會使用預設記憶體帳戶類型。 如果指定 「--target-edge-zones None」,則會清除目標擴充位置。

--target-regions

區域及其復本計數的空間分隔清單。 使用 <region>[=<replica count>][=<storage account type>] 來選擇性地設定每個區域的複本計數和/或記憶體帳戶類型。 如果未指定複本計數,則會使用預設複本計數。 如果未指定記憶體帳戶類型,則會使用預設記憶體帳戶類型。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az sig image-version wait

等候映像版本相關作業。

az sig image-version wait --gallery-image-definition
                          --gallery-image-version
                          --gallery-name
                          --resource-group
                          [--created]
                          [--custom]
                          [--deleted]
                          [--exists]
                          [--expand]
                          [--interval]
                          [--timeout]
                          [--updated]

範例

等候映像版本更新

az sig image-version wait --updated --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0

等候映像版本相關作業。 ( 自動產生 )

az sig image-version wait --created --resource-group MyResourceGroup \
--gallery-name MyGallery --gallery-image-definition MyImage \
--gallery-image-version 1.0.0

必要參數

--gallery-image-definition -i

資源庫映像定義。

--gallery-image-version -e

語意版本模式中的資源庫映像版本。 允許的字元為數位和句點。 數字必須介於32位整數的範圍內,例如 <MajorVersion>.<MinorVersion>.<Patch>

--gallery-name -r

資源庫名稱。

--resource-group -g

資源群組的名稱。 您可以使用 來設定預設群組 az configure --defaults group=<name>

選擇性參數

--created

請等候在 'Succeeded' 使用 'provisioningState' 建立。

預設值: False
--custom

等到條件符合自定義 JMESPath 查詢為止。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。

--deleted

等到刪除為止。

預設值: False
--exists

等候資源存在。

預設值: False
--expand

要套用至作業的展開表達式。 'ReplicationStatus' 預設值為 None。

--interval

輪詢間隔以秒為單位。

預設值: 30
--timeout

以秒為單位的等候上限。

預設值: 3600
--updated

等到 provisioningState 更新為 'Succeeded'。

預設值: False
全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 來設定預設訂用 az account set -s NAME_OR_ID帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。