不支持 Azure Web 应用程序自动缩放的 AppInsights 自定义指标

AppInsights custom metric for autoscaling of azure web apps not supported

我一直在关注关于自定义指标 (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: Code for sending custom metrics。在 Azure Web App 中,我尝试像这样配置自动缩放: Configuring autoscaling by custom metric. As it can be seen on the image, I am targeting metric namespace "azure.applicationinsights", which really contains my custom metric, but upon saving Azure tells me that it is not possible: enter image description here

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

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

希望对您有所帮助!