You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求助:无法删除Azure Compute Gallery中黄金VM的旧镜像

解决Azure Compute Gallery旧镜像版本无法删除的问题

问题核心

删除专用镜像版本时遇到API版本不支持、资源提供者未找到的错误,且误将资源提供者名称混淆为AzureComputeGallery(实际应为Microsoft.Compute)。

分步解决方案

1. 注册正确的资源提供者

Azure Compute Gallery归属于Microsoft.Compute资源提供者,而非AzureComputeGallery:

  • 登录Azure门户,进入目标订阅
  • 左侧导航选择资源提供者,搜索Microsoft.Compute
  • 若状态为「未注册」,点击顶部「注册」按钮,等待注册完成(通常需1-5分钟)

2. 使用支持的API版本执行删除

错误提示明确列出了支持的API版本(如2021-10-01、2022-08-03等),避免使用2021-11-01这类未被支持的版本:

  • Azure CLI示例:
    az sig image-version delete \
      --resource-group <你的资源组名> \
      --gallery-name <你的画廊名称> \
      --gallery-image-definition <镜像定义名> \
      --gallery-image-version <要删除的版本号> \
      --api-version 2022-08-03 \
      --location <支持的位置,如eastus>
    
  • PowerShell示例:
    Remove-AzGalleryImageVersion `
      -ResourceGroupName <你的资源组名> `
      -GalleryName <你的画廊名称> `
      -GalleryImageDefinitionName <镜像定义名> `
      -Name <要删除的版本号> `
      -ApiVersion 2022-08-03 `
      -Location <支持的位置,如eastus>
    

3. 确保位置参数正确

错误信息中位置字段为空,需指定错误提示里列出的支持位置(如westcentralus、eastus等),避免位置参数缺失或无效。

4. 检查镜像版本的引用关系

若该镜像版本仍被VMSS实例或其他虚拟机使用,会导致删除失败:

  • 进入Azure Compute Gallery的镜像版本详情页,查看「依赖项」部分
  • 解除所有资源对该镜像版本的引用后,再执行删除操作

内容的提问来源于stack exchange,提问作者Raghava Akula

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.06 03:05:31