0

我正在关注本教程关于在自定义指标 ( https://docs.microsoft.com/en-us/azure/azure-monitor/platform/autoscale-custom-metric ) 上自动缩放 Web 应用程序,不幸的是 Azure 一直告诉我我的已部署的 Web 应用程序不支持自定义指标。任何人都可以帮助我并指出为什么我的网络应用程序不能按自定义指标进行缩放。如果需要,我位于奥地利,正在将 Web 应用程序部署到西欧。

提前致谢!

资源'/subscriptions/4c6ad49f-5448-4a16-bef1-de2342c0626e/resourceGroups/dtc/providers/microsoft.insights/components/AppInsightsTestApp201 不支持度量标准'NumOfRequests'

{  
   "authorization":{  
      "action":"microsoft.insights/autoscalesettings/write",
      "scope":"/subscriptions/4c6ad49f-5448-4a16-bef1-de2342c0626e/resourceGroups/dtc/providers/microsoft.insights/autoscalesettings/dtc-serviceplan-low-prod-webwts-Autoscale-468"
   },
   "caller":"robi-91@hotmail.com",
   "channels":"Operation",  
   "correlationId":"79d4a60d-f03b-4e3e-b556-8326f202086c",
   "description":"",
   "eventDataId":"c157fde0-301d-475c-bda6-cdb5a52420ed",
   "eventName":{  
      "value":"EndRequest",
      "localizedValue":"End request"
   },
   "category":{  
      "value":"Administrative",
      "localizedValue":"Administrative"
   },
   "eventTimestamp":"2019-06-05T07:12:12.5615148Z",
   "id":"/subscriptions/4c6ad49f-5448-4a16-bef1-de2342c0626e/resourceGroups/dtc/providers/microsoft.insights/autoscalesettings/dtc-serviceplan-low-prod-webwts-Autoscale-468/events/c157fde0-301d-475c-bda6-cdb5a52420ed/ticks/636953155325615148",
   "level":"Error",
   "operationId":"79d4a60d-f03b-4e3e-b556-8326f202086c",
   "operationName":{  
      "value":"microsoft.insights/autoscalesettings/write",
      "localizedValue":"Update autoscale setting"
   },
   "resourceGroupName":"dtc",
   "resourceProviderName":{  
      "value":"microsoft.insights",
      "localizedValue":"Microsoft Insights"
   },
   "resourceType":{  
      "value":"microsoft.insights/autoscalesettings",
      "localizedValue":"microsoft.insights/autoscalesettings"
   },
   "resourceId":"/subscriptions/4c6ad49f-5448-4a16-bef1-de2342c0626e/resourceGroups/dtc/providers/microsoft.insights/autoscalesettings/dtc-serviceplan-low-prod-webwts-Autoscale-468",
   "status":{  
      "value":"Failed",
      "localizedValue":"Failed"
   },
   "subStatus":{  
      "value":"BadRequest",
      "localizedValue":"Bad Request (HTTP Status Code: 400)"
   },
   "submissionTimestamp":"2019-06-05T07:13:48.1357184Z",
   "subscriptionId":"4c6ad49f-5448-4a16-bef1-de2342c0626e",
   "properties":{  
      "statusCode":"BadRequest",
      "serviceRequestId":"00000000-0000-0000-0000-000000000000",
      "statusMessage":"{\"code\":\"UnsupportedMetric\",\"message\":\"Metric 'NumOfRequests' is not supported for resource '/subscriptions/4c6ad49f-5448-4a16-bef1-de2342c0626e/resourceGroups/dtc/providers/microsoft.insights/components/AppInsightsTestApp20190604021321'\"}"
   },
   "relatedEvents":[  

   ]
}

编辑 我正在将我的自定义指标从这样的应用程序发送到 Application Insights: 发送自定义指标的代码。在 Azure Web App 中,我尝试配置自动缩放,例如: Configuring autoscaling by custom metric。如图所示,我的目标是指标命名空间“azure.applicationinsights”,它确实包含我的自定义指标,但保存后 Azure 告诉我这是不可能的:在此处输入图像描述

4

1 回答 1

1

我遵循了文档,并能够根据我的自定义指标启用自动缩放:

在此处输入图像描述

请确保在添加规则时选择正确的选项:

在此处输入图像描述

希望这可以帮助!

于 2019-06-06T10:16:31.893 回答