-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Description
API Spec link
API Spec version
2022-10-01
Describe the bug
MetricTrigger.MetricName should be an enum with valid values instead of a primitive string type.
Expected behavior
This creates ambiguous errors in Azure-powershell which is generated from the spec of azure-rest-api-specs.
See issue: Azure/azure-powershell#24727
Actual behavior
See issue: Azure/azure-powershell#24727
User receives generic error for the metric name, with no guidance as to what are the accepted values.
Reproduction Steps
Api call to:
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroup}/providers/Microsoft.Insights/autoscalesettings/test-autoscale?api-version=2022-10-01
With payload:
{
"properties": {
"profiles": [{
"rules": [{
"metricTrigger": {
"metricName": "Percentage CPU",
"metricNamespace": "microsoft.web/serverfarms",
"metricResourceUri": "/subscriptions/.../providers/Microsoft.Web/serverfarms/test-asp"
}
}]
}]
}
}
Produces generic error:
Error: resource: /subscriptions/.../providers/Microsoft.Web/serverfarms/test-asp,
metricnamespace: microsoft.web/serverfarms,
metricname: Percentage CPU
Environment
Name Value
PSVersion 7.4.1
PSEdition Core
GitCommitId 7.4.1
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0