Open yossi-y opened 4 years ago
The reason why error message was not thrown properly is because the error defined in swagger (ClusterErrorResponse): https://github.com/Azure/azure-rest-api-specs/blob/master/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/preview/2020-03-01-preview/Clusters.json#L322
the generated SDK didn’t add the exception body to exception message: https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ClustersOperations.cs#L890 to https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ClustersOperations.cs#L917
In Azure-PowerShell we usually throw server error by generated SDK directly without catch them in client code. So you can only see the message: https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ClustersOperations.cs#L892
exception.body was there but not printed to powershell console: https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/operationalinsights/Microsoft.Azure.Management.OperationalInsights/src/Generated/ClustersOperations.cs#L899
There are two options:
Adding @yoramsinger .
We will go with option #1. I opened a bug on the team to fix: Bug (https://msazure.visualstudio.com/DefaultCollection/One/_workitems/edit/8824222) Control plane - Incorrect ClusterErrorResponse definition in cluster swagger.
Once we have the .NET SDK updated, do we need to update PowerShell package as well?
Once SDK is updated, client side code doesn't need to be changed. I change the tag and let's close this ticket one service is deployed.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @SameergMS, @dadunl.
Author: | yossi-y |
---|---|
Assignees: | VeryEarly |
Labels: | `Monitor`, `Monitor - Operational Insights`, `Service Attention` |
Milestone: | - |
client side need to upgrade SDK version to Microsoft.Azure.Management.OperationalInsights-0.22.0-preview or above.
Description
Two issues:
Customer was able to create a cluster without providing -SkuName.
We have a case where customer configured CMK and then updated it with incorrect capacity value and got generic error message: "Update-AzOperationalInsightsCluster: Operation returned an invalid status code 'BadRequest'"
Instead of the one returned from the API: { "error": { "code": "BadRequest", "message": "CapacityReservationLevel must be in the range of 1000-3000. Contact us to increase the limit LAIngestionRate@microsoft.com" } }
Steps to reproduce
Update-AzOperationalInsightsCluster -ResourceGroupName {rg-name} -ClusterName {cluster-name} -SkuName CapacityReservation -SkuCapacity 1000
Debug output
Error output