Stanislav Fotev - Welcome to Microsoft Q&A and thanks for reaching out to us.
Yes, we have a stringent throttling limit on this API. The recommended pattern to get cost data is using API or exports https://learn.microsoft.com/en-us/azure/cost-management-billing/automate/get-small-usage-datasets-on-demand and build queries on top of that.
When you generate a token through the Azure portal, it may have different rate limits than a token generated through the Java SDK. This is because the portal may have different usage patterns and requirements than a Java application.
To avoid hitting the rate limits, you can try implementing a backoff strategy in your Java application. This means that if you receive a 429 error, you wait for a certain amount of time before retrying the request. The amount of time you wait can increase with each consecutive error to avoid overwhelming the service.
Hope this helps. and please feel free to reach out if you have any further questions.
If the above response was helpful, please feel free to "Accept as Answer" and click "Yes" so it can be beneficial to the community.