Further clarity needed with Azure REST API response codes

JJ-8928 20 Reputation points
2024-06-03T22:07:32.4466667+00:00

The Azure REST API docs provide 4 different reasons for receiving a 503 due to "ServiceBusy" error code. I'm trying to disambiguate user error due to too many requests vs Azure services actually being down/impacted. Originally I thought 503 would be sufficient but it appears to also be used when resource limits thresholds are breached per this document https://learn.microsoft.com/en-us/rest/api/storageservices/common-rest-api-error-codes

My though was to take the "user message" from the response body into account to determine this, e.g. consider errors due to "The server is currently unable to receive requests. Please retry your request." as Azure being unavailable and every other 503 reason code as user error due to too many requests. Are there any problems with this approach or any preferred alternatives to achieve what I'm trying to do?

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,562 questions
0 comments No comments
{count} votes

Accepted answer
  1. Anand Prakash Yadav 7,465 Reputation points Microsoft Vendor
    2024-06-04T11:31:25.0766667+00:00

    Hello JJ-8928,

    Thank you for posting your query here!

    A 503 response indicates that the server is currently unavailable. According to the Azure REST API documentation, this can happen due to:

    · The service being temporarily unavailable.

    · The server being busy due to too many requests.

    · The account being throttled due to exceeding account-level limits.

    · The server undergoing maintenance.

    The best way to handle the 503 error code is to inspect the response body and look for the user message field. The user message field contains a human-readable explanation of the error, which can help you identify the cause and determine the appropriate action to take.

    Examples and Actions:

    Service Temporarily Unavailable:

    User Message: "The server is currently unable to receive requests. Please retry your request."

    Action: This indicates that the Azure service is experiencing a temporary outage or overload. You should retry the request after some time, using an exponential backoff strategy.

    Quota Limits Exceeded:

    User Message: "The subscription has reached its quota limit. Please contact support to increase the quota or delete some resources."

    Action: This means your subscription has exceeded its allocated resources. You need to either increase your quota or delete some resources. Use the Azure portal or Azure CLI to manage your subscription and resource limits.

    Resource Group Limits Exceeded:

    User Message: "The resource group has reached its quota limit. Please create a new resource group or delete some resources."

    Action: This indicates that your resource group has exceeded its allocated resources. You need to create a new resource group or delete some resources. Manage your resource groups and limits using the Azure portal or Azure CLI.

    Server Busy:

    User Message: "The server is busy and cannot process the request. Please retry the request after 10 seconds."

    Action: This indicates a temporary spike in demand. Retry the request after a short delay, using a fixed or linear backoff strategy. Additionally, monitor Azure metrics and alerts to check for any performance issues or bottlenecks affecting the service.

    Additional Considerations

    You may implement detailed logging for all 503 responses to track patterns and better understand the root cause of the errors over time.

    Do let us know if you have any further queries. I’m happy to assist you further.

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.


0 additional answers

Sort by: Most helpful