gpt4 book ai didi

Azure API 限制

转载 作者:行者123 更新时间:2023-12-02 08:05:00 25 4
gpt4 key购买 nike

我试图获取我的 Azure 订阅中存在的所有存储帐户的列表,但遇到限制错误。

com.microsoft.azure.CloudException: Status code 429, {"error":{"code":"ResourceCollectionRequestsThrottled","message":"Operation 'Microsoft.Storage/storageAccounts/read' failed as server encountered too many requests. Please try after '17' seconds. Tracking Id is 'e982a894-0f3e-4291-a9b3-e147c18f8f60'."}}

此请求之前的请求打印还有 13869 个剩余订阅读取,但仍然失败。

x-ms-ratelimit-remaining-subscription-reads: 13869

我的订阅中有大约 60 个存储帐户,但这个数字很小。

只有在列出存储帐户时才知道是什么导致了这个或那个。

最佳答案

根据这个article :

For each subscription and tenant, Resource Manager limits read requests to 15,000 per hour and write requests to 1,200 per hour. These limits apply to each Azure Resource Manager instance; there are multiple instances in every Azure region, and Azure Resource Manager is deployed to all Azure regions. So, in practice, limits are effectively much higher than those listed above, as user requests are generally serviced by many different instances. If your application or script reaches these limits, you need to throttle your requests.

因此,如果达到请求限制,资源管理器会在 header 中返回 429 HTTP 状态代码和 Retry-After 值。 Retry-After 值指定应用程序在发送下一个请求之前应等待(或休眠)的秒数。如果您在重试值到期之前发送请求,则您的请求不会被处理,并且会返回新的重试值。

我建议你可以使用这个way获取读取时间的数量。如果满足限制,您可以编写代码来限制应用程序发送请求。

关于Azure API 限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46083874/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com