Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TRE Cost API doesn't handle 429 TooManyRequests and 503 ServiceUnavailable which might return from Azure Cost Management #2835

Closed
guybartal opened this issue Nov 8, 2022 · 0 comments · Fixed by #2887
Assignees
Labels
bug Something isn't working

Comments

@guybartal
Copy link
Contributor

guybartal commented Nov 8, 2022

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

  1. Deploy Azure TRE in ARIS subscription type
  2. 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

@guybartal guybartal added the bug Something isn't working label Nov 8, 2022
@guybartal guybartal self-assigned this Nov 8, 2022
@guybartal guybartal moved this to In Progress in Azure TRE - Engineering Nov 14, 2022
@tamirkamara tamirkamara moved this from In Progress to PR in Azure TRE - Engineering Nov 17, 2022
Repository owner moved this from PR to Done in Azure TRE - Engineering Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant