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

Azure App Service Plan仪表盘模板部署成功但显示异常求助

Azure仪表盘模板加载异常原因排查(App Service Plan CPU监控场景)

你部署的监控Azure App Service Plan CPU百分比的仪表盘模板,虽验证和部署成功,但打开时出现异常,核心原因有两个:

1. 指标名称不符合规范

Azure App Service Plan的CPU使用率指标正确名称是CpuPercentage(无空格),你模板里写的CPU Percentage与Azure Monitor的指标命名不匹配,导致系统无法找到对应指标数据,触发加载异常。

2. 冗余的资源ID配置

在queryInputs层级已经通过id字段指定了目标App Service Plan的资源ID,metrics数组里重复填写resourceId属于冗余配置,部分场景下会导致仪表盘组件解析逻辑冲突,加重加载异常。

修正后的模板代码

resource dashboardName_resource 'Microsoft.Portal/dashboards@2020-09-01-preview' = {
  name: dashboardName
  location: location
  properties: {
    lenses: [
      {
        order: 0
        parts: [
          {
            position: {
              x: 0
              y: 4
              rowSpan: 3
              colSpan: 11
            }
            metadata: {
              inputs: [
                {
                  name: 'queryInputs'
                  value: {
                    timespan: {
                      duration: 'PT1H'
                    }
                    id: resourceId(appServicePlanResourceGroup, 'Microsoft.Web/serverfarms', appServicePlanName)
                    chartType: 0
                    metrics: [
                      {
                        name: 'CpuPercentage' // 修正指标名称
                        // 移除冗余的resourceId配置
                      }
                    ]
                  }
                }
              ]
              type: 'Extension/Microsoft_Azure_Monitoring/PartType/MetricsChartPart'
            }
          }
        ]
      }
    ]
  }
}

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.19 00:30:56