Azure Management API: "ProviderError" 502 when paging through storageAccounts (first page works, skipToken fails)

Israel Lopez 0 Reputation points
2025-04-04T15:29:29.34+00:00

Summary: When calling the Azure Management API to list storage accounts using the Microsoft.Storage/storageAccounts resource provider, I am able to successfully retrieve the first page of results. However, any paginated requests using $skipToken fail with a 502 Bad Gateway, returning a ProviderError.

This occurs consistently across multiple requests and subscriptions.

Error Details:

  • Initial request: GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts?api-version=2023-05-01 Returns 200 OK with nextLink.
  • Follow-up request using $skipToken: GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts?$skiptoken=...&api-version=2023-05-01 Returns 502 Bad Gateway.
{
  "error": {
    "code": "ProviderError",
    "message": "Resource provider 'Microsoft.Storage' failed to return collection response for type 'storageAccounts'."
  }
}

Response headers of failed request (truncated):

  • x-ms-request-id: 4cfb6037-df08-4f2b-be81-aa6fad4aec48
  • x-ms-routing-request-id: WESTUS:20250404T152131Z:4cfb6037-df08-4f2b-be81-aa6fad4aec48
  • Date: Fri, 04 Apr 2025 15:21:30 GMT Error Details:
    • Initial request:
      GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts?api-version=2023-05-01
      Returns 200 OK with nextLink.
    • Follow-up request using $skipToken:
      GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts?$skiptoken=...&api-version=2023-05-01
      Returns 502 Bad Gateway.
      {
    
    Response headers of failed request (truncated):
    • x-ms-request-id: 4cfb6037-df08-4f2b-be81-aa6fad4aec48
    • x-ms-routing-request-id: WESTUS:20250404T152131Z:4cfb6037-df08-4f2b-be81-aa6fad4aec48
    • Date: Fri, 04 Apr 2025 15:21:30 GMT

What I've already verified:

  • The same bearer token is used for both requests.
  • Token is valid (not expired, same tid, oid, aud).
  • This happens regardless of user agent or SDK (tested both via .NET SDK and raw REST).
  • $skipToken is passed exactly as provided in nextLink.
  • No throttling — verified via x-ms-ratelimit-remaining-* headers.
  • Reproduced in multiple tenants/subscriptions.

Can someone from the Azure SDK or Microsoft.Storage team confirm:

  • Is this a known issue with skipToken in Microsoft.Storage?
  • Can the request ID above be escalated for backend tracing?
  • Is there a way to override pagination behavior to fetch all storage accounts without $skipToken?
  • What’s the proper escalation path when ProviderError occurs within ARM for a core service like this?

Notes for responders (please read before replying)

This is not a client bug; I’ve confirmed the HTTP calls independently.

The skipToken format is correct and unmodified.

  • Please don’t ask me to “try another region” I don't think I can change regions for the azure management API
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,471 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Venkatesan S 1,625 Reputation points Microsoft External Staff
    2025-04-08T07:10:54.5133333+00:00

    Hi Israel Lopez

    Here is the similar issue 1 and Issue 2

    In both issues, they mentioned like

    The error is reported from storage server, so this is a server issue.

    They also mentioned that they contacted Azure Support, and were advised to re-register the Microsoft.Storage resource provider

    You can try using Azure CLI command to reregister the storage resource provider like below:

    Command:

    az login
    az account set --subscription <your-subscription-id>
    az provider register --namespace Microsoft.Storage
    

    Here is Equivalent Powershell command:

    Command:

    Connect-AzAccount
    Set-AzContext -SubscriptionId <...>
    Register-AzResourceProvider -ProviderNamespace "Microsoft.Storage" 
    

    Please try the above commands and check again to see if it works.

    Hope this answer helps! please 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 "Yes" for was this answer helpful. this can be beneficial to other community members.


  2. Sumarigo-MSFT 47,526 Reputation points Microsoft Employee
    2025-04-17T10:04:37.8933333+00:00

    @Israel Lopez

    Issue: Experiencing issues with the Azure API Management when attempting to list storage accounts using the Microsoft.Storage/storageAccounts resource provider.  

    Resolution:

    To resolve your issue, you had to register again the provider because when new regions are enabled for resource providers, a prior namespace registration is not automatically propagated to newly enabled regions. Using the command Register-AzResourceProvider -ProviderNamespace Microsoft.Storage fixed the issue. 

     

    The command Register-AzResourceProvider -ProviderNamespace Microsoft.Storage is used in Azure PowerShell to register a resource provider for your Azure subscription.  

    It ensures that the specified resource provider, in this case, Microsoft.Storage, is available for use within your subscription.

     This command registers the Microsoft.Storage resource provider, which is necessary to create and manage storage accounts and other storage-related resources in Azure.

    Also billing ticket was been rasied for pricing/refund issue.

    • Posting the SR answer which might be beneficial to other community members reading this thread.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.