Describe the bug
Azure cost management API might return 429 TooManyRequests which means that the request is throttled, and 503 ServiceUnavailable which means that the service is temporarily unavailable.
Cost Reporting API doesn't handle those errors and simply returns 500.
Consider propagate that status to UI for retry, or retry in API and if fails hide in UI and cache the result to reduce api cost management calls:
-
429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header.
-
503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header.
Steps to reproduce
- Deploy Azure TRE in ARIS subscription type
- Browse main page in UI and refresh quickly several times
example for returned relevant HTTP headers for 200 OK:
x-ms-ratelimit-remaining-microsoft.costmanagement-entity-requests: DefaultQuota:7
x-ms-ratelimit-remaining-microsoft.costmanagement-tenant-requests: DefaultQuota:49
x-ms-ratelimit-microsoft.costmanagement-qpu-consumed: 2
x-ms-ratelimit-microsoft.costmanagement-qpu-remaining: QueriesPerHour:597,QueriesPerMin:57,QueriesPer10Sec:9
example for returned relevant HTTP headers for 429 TooManyRequests:
x-ms-ratelimit-remaining-subscription-resource-requests: 98
x-ms-ratelimit-microsoft.costmanagement-entity-retry-after: 23
x-ms-ratelimit-remaining-microsoft.costmanagement-entity-requests: DefaultQuota:0
Describe the bug
Azure cost management API might return
429 TooManyRequestswhich means that the request is throttled, and503 ServiceUnavailablewhich means that the service is temporarily unavailable.Cost Reporting API doesn't handle those errors and simply returns 500.
Consider propagate that status to UI for retry, or retry in API and if fails hide in UI and cache the result to reduce api cost management calls:
429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the "x-ms-ratelimit-microsoft.consumption-retry-after" header.
503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time specified in the "Retry-After" header.
Steps to reproduce
example for returned relevant HTTP headers for 200 OK:
x-ms-ratelimit-remaining-microsoft.costmanagement-entity-requests: DefaultQuota:7
x-ms-ratelimit-remaining-microsoft.costmanagement-tenant-requests: DefaultQuota:49
x-ms-ratelimit-microsoft.costmanagement-qpu-consumed: 2
x-ms-ratelimit-microsoft.costmanagement-qpu-remaining: QueriesPerHour:597,QueriesPerMin:57,QueriesPer10Sec:9
example for returned relevant HTTP headers for 429 TooManyRequests:
x-ms-ratelimit-remaining-subscription-resource-requests: 98
x-ms-ratelimit-microsoft.costmanagement-entity-retry-after: 23
x-ms-ratelimit-remaining-microsoft.costmanagement-entity-requests: DefaultQuota:0