question

SergioSolorzano-0663 avatar image
0 Votes"
SergioSolorzano-0663 asked GitaraniSharmaMSFT-4262 commented

CDN Library for .NET. purge BadRequest Exception: only accept 100 paths but only sent 2

Hello

I have followed this tutorial to purge with a cdn end point using Azure CDN Library for .NET. I use Azure CDN Standard from Microsoft.

I purged all (path is /) once and it worked.
cdn.Endpoints.PurgeContent(resourceGroupName,profileName,endpointName, new List<string>() { "/
" });

I purged again after 10 minutes and got exception and see this error for Response Content:
Content "{\n \"error\": {\n \"code\": \"BadRequest\",\n \"message\": \"We can only accept 100 paths for purging concurrently. Please try again in a few minutes.\"\n }\n}" string

I don't see any problems with the query (e.g. authentication, token all seem fine etc).

The CDN cached 6 files at the time, so assuming Purge All breaks out into each file path, that's a total of 6. Plus the other 6 in the prior purge that's 12. Why the 100 paths error? This problem was raised in stackoverflow in 2020 for Akamai but no response.

I note I see in Logs that 12 minutes later Azure retried the purge (I didn't fire it again) and it succeeded. Is it the case when a Badrequest occurs the PurgeContent fires back after sometime?

After some testing we find this problem happens when the registered app for Access Control only has CDN Endpoint Contributor role assigned (shouldn't be the case because this role has purge permission -> Microsoft.Cdn/profiles/endpoints/Purge/action, Microsoft.Cdn/operationresults/profileresults/endpointresults/Purge/action, Microsoft.Cdn/operationresults/profileresults/afdendpointresults/Purge/action). The exception does not happen when the registered app also has CDN Profile Contributor role assigned. FYI the CDN Profile we create has several end points and we do not wish for the registered app to have a role on other end points of the profile. Is this a bug?

Please help to understand concurrent purging count.

Thank you, Sergio



azure-cdn
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @SergioSolorzano-0663 ,

Apologies for the delay in response.

There was a bug in 2020 where Azure failed to handle simultaneous multiple purge requests at a time with an error "We can only accept 100 paths for purging concurrently. Please try again in a few minutes" And it was an incorrect error message, which the PG team fixed thereafter.

I couldn't find any bug or issue with the CDN Endpoint Contributor role assignment.

This issue requires a deeper investigation with collection of backend logs, so if you have a support plan, I request you file a support ticket, else please do let us know, we will try and help you get a one-time free technical support. In case you need help with a one-time free technical support, I would request you to send an email to azcommunity@microsoft.com referencing this thread and your subscription id. Please mention "ATTN gishar" in the subject field.

Thanks,
Gita

1 Vote 1 ·

Hello @SergioSolorzano-0663 ,

Since we have not heard back from you in sometime, I am reaching out to you to check if you have any updates regarding the above issue.

Thanks,
Gita

0 Votes 0 ·

0 Answers