question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Too many management API calls

See original GitHub issue

For a while now we’ve been having bad throttling issues, where things kept crashing with errors. After a long debugging session where I went into the code to track where the bad calls are made, I saw that the offending calls are ones that are made to the management API, eg:

https://management.azure.com/subscriptions/[...]/providers/Microsoft.Storage/storageAccounts?api-version=2017-06-01

Later on, we found that it’s no wonder that we’ve been throttled, since apparently the limit for these calls is 100 per 5 minutes, which is easy to reach when we have a bunch of blobs to delete, which we have to do one by one (see Issue #3757). To make things worse, it looks like this limit is at the subscription level, and therefore it’s even easier to reach.

Digging more into the code, it looked like these calls are made to get the storage access key, so we’ve tried providing that (via $AZURE_STORAGE_KEY) and the throttling problems went away. To clarify, this became a bad blocking issue for us since we got to a point where we couldn’t create any new builds.

I also see that the help text claims that --account-name must be used with --account-key, which we haven’t followed.

So: I think that as a good short-term stopgap it would be best to clear the help text and say that it will retrieve the key, but that makes for another API call and therefore it slows things down and it might run into the much-tighter throttling limits on the management service.

A better long-term solution would be to cache the access key itself, possibly together with the cached login information. For example, it would retrieve and cache the key if it’s not there, and if it uses a cached key and that doesn’t work, only then try to re-retrieve the key in case it changed. This would make it possible to lift the requirement of using both the account name and the key, and still have a sane interaction.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
tjprescottcommented, Oct 29, 2018

The OAuth mechanism is available using the storage CLI extension. Please give it a try. cc/ @williexu

0reactions
williexucommented, Oct 31, 2018

@elibarzilay the feature is already being shipped with our product. Take a look at: https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-script#call-cli-commands-with-an-azure-ad-identity (it’s a little outdated; no need to install the extension 😃)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Management API Endpoint Rate Limits - Auth0
For some API endpoints, the rate limits are defined per bucket, so the origins of the call do not influence the rate limit...
Read more >
Troubleshoot API Gateway"429 Too Many Requests" or "Limit ...
I received "429 Too Many Requests" or "Limit Exceeded" errors when sending requests to my Amazon API Gateway API. How do I troubleshoot ......
Read more >
API overload protection: Handling 429 errors
An API key you're using has exceeded the maximum number of requests per minute. · Further API calls will fail with HTTP status...
Read more >
How to handle API rate limits: Do your integrations work at ...
API rate limits are essential for well-functioning apps and happy customers. ... RFC 6585 sets this status code aside to represent "Too Many...
Read more >
Limits and Quotas on API Requests | Analytics Management API
This video discusses the best practices for managing Google Analytics API request quotas. General quota limits.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found