你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

az vm image

有关可用虚拟机映像的信息。

命令

名称 说明 类型 状态
az vm image accept-terms

接受Azure 市场术语,以便映像可用于创建 VM。

核心 已放弃
az vm image list

列出Azure 市场中可用的 VM/VMSS 映像。

核心 GA
az vm image list-offers

列出Azure 市场中提供的 VM 映像产品/服务。

核心 GA
az vm image list-publishers

列出Azure 市场中可用的 VM 映像发布者。

核心 GA
az vm image list-skus

列出Azure 市场中可用的 VM 映像 SKU。

核心 GA
az vm image show

获取Azure 市场中提供的 VM 映像的详细信息。

核心 GA
az vm image terms

管理 Azure 市场映像术语。

核心 GA
az vm image terms accept

接受Azure 市场映像术语,以便使用该映像创建 VM。

核心 GA
az vm image terms cancel

取消Azure 市场图像术语。

核心 GA
az vm image terms show

获取Azure 市场图像术语的详细信息。

核心 GA

az vm image accept-terms

已放弃

此命令已弃用,将在版本“3.0.0”中删除。 请改用“az vm image terms accept”。

接受Azure 市场术语,以便映像可用于创建 VM。

az vm image accept-terms [--offer]
                         [--plan]
                         [--publisher]
                         [--urn]

示例

接受Azure 市场术语,以便映像可用于创建 VM。 (自动生成)

az vm image accept-terms --urn publisher:offer:sku:version

可选参数

--offer -f

映像产品/服务。

--plan

映像计费计划。

--publisher -p

映像发布者。

--urn

URN 格式为“publisher:offer:sku:version”或“publisher:offer:sku:edge_zone:version”。 如果指定,则可以省略其他参数值。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az vm image list

列出Azure 市场中可用的 VM/VMSS 映像。

az vm image list [--all]
                 [--architecture {Arm64, x64}]
                 [--edge-zone]
                 [--location]
                 [--offer]
                 [--publisher]
                 [--sku]

示例

列出所有可用的映像。

az vm image list --all

列出所有脱机缓存的 CentOS 映像。

az vm image list -f CentOS

列出所有 CentOS 映像。

az vm image list -f CentOS --all

可选参数

--all

从实时 Azure 服务检索映像列表,而不是使用脱机映像列表。

默认值: False
--architecture

体系结构的名称。

接受的值: Arm64, x64
--edge-zone

边缘区域的名称。

--location -l

Location。 az account list-locations 中的值。 可以使用 az configure --defaults location=<location> 配置默认位置。

--offer -f

图像产品/服务名称,接受部分名称。

--publisher -p

映像发布者名称,接受部分名称。

--sku -s

映像 SKU 名称,接受部分名称。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az vm image list-offers

列出Azure 市场中提供的 VM 映像产品/服务。

az vm image list-offers --location
                        --publisher
                        [--edge-zone]

示例

列出来自美国西部区域 Microsoft 的所有产品/服务。

az vm image list-offers -l westus -p MicrosoftWindowsServer

列出美国西部地区 OpenLocic 提供的所有产品/服务。

az vm image list-offers -l westus -p OpenLogic

必需参数

--location -l

Location。 az account list-locations 中的值。 可以使用 az configure --defaults location=<location> 配置默认位置。

--publisher -p

映像发布者。

值来自: az vm image list-publishers

可选参数

--edge-zone

边缘区域的名称。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az vm image list-publishers

列出Azure 市场中可用的 VM 映像发布者。

az vm image list-publishers --location
                            [--edge-zone]

示例

列出美国西部区域的所有发布者。

az vm image list-publishers -l westus

列出名称以 westus 中的“Open”开头的所有发布者。

az vm image list-publishers -l westus --query "[?starts_with(name, 'Open')]"

必需参数

--location -l

Location。 az account list-locations 中的值。 可以使用 az configure --defaults location=<location> 配置默认位置。

可选参数

--edge-zone

边缘区域的名称。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az vm image list-skus

列出Azure 市场中可用的 VM 映像 SKU。

az vm image list-skus --location
                      --offer
                      --publisher
                      [--edge-zone]

示例

列出 OpenLogic 在美国西部区域发布的 CentOS 可用的所有 SKU。

az vm image list-skus -l westus -f CentOS -p OpenLogic

必需参数

--location -l

Location。 az account list-locations 中的值。 可以使用 az configure --defaults location=<location> 配置默认位置。

--offer -f

映像产品/服务。

--publisher -p

映像发布者。

值来自: az vm image list-publishers

可选参数

--edge-zone

边缘区域的名称。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az vm image show

获取Azure 市场中提供的 VM 映像的详细信息。

az vm image show [--edge-zone]
                 [--location]
                 [--offer]
                 [--publisher]
                 [--sku]
                 [--urn]
                 [--version]

示例

显示 OpenLogic 中最新可用 CentOS 映像的信息。

latest=$(az vm image list -p OpenLogic -s 7.3 --all --query \
    "[?offer=='CentOS'].version" -o tsv | sort -u | tail -n 1)
az vm image show -l westus -f CentOS -p OpenLogic --sku 7.3 --version ${latest}

获取Azure 市场中提供的 VM 映像的详细信息。 (自动生成)

az vm image show --location westus --urn publisher:offer:sku:version

可选参数

--edge-zone

边缘区域的名称。

--location -l

Location。 az account list-locations 中的值。 可以使用 az configure --defaults location=<location> 配置默认位置。

--offer -f

映像产品/服务。

--publisher -p

映像发布者。

--sku -s

映像 SKU。

--urn

URN 格式为“publisher:offer:sku:version”或“publisher:offer:sku:edge_zone:version”。 如果指定,则可以省略其他参数值。

--version

映像 SKU 的版本。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。