How to purge cache in azure cdn

Rishabh 20 Reputation points
2023-12-11T12:01:45.71+00:00

Dear Team,

I am seeking assistance regarding an essential task I'm facing challenges with. Specifically, I've been endeavouring to clear the Azure CDN cache using the az cli utility. However, attempts to execute the following commands:

  • az cdn endpoint purge -g group -n endpoint --profile-name profile-name --content-paths '/*'
  • az cdn endpoint purge --resource-group $rg_name --profile-name $profile_name --name $name --no-wait --content-paths '/*' --verbose

have resulted in encountering an error message: "Endpoint(s) not found. Please verify the resource(s), group, or its parent resources exist."

At this juncture, uncertainty prevails as to whether the command itself is incorrect or if there are inherent limitations hindering the cache clearance via this specified method. I wish to highlight that our Azure CDN Service operates under the Standard pricing tier, and my az-cli version stands at 2.0.81.

I would highly appreciate your guidance on this matter or any alternative approaches you might suggest to effectively clear the CDN cache.

Your timely assistance in resolving this matter would be immensely valuable.

Thank you for your attention and support.

Best regards,
Rishabh Sharma

Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
851 questions
{count} votes

Accepted answer
  1. KapilAnanth-MSFT 49,536 Reputation points Microsoft Employee Moderator
    2023-12-13T08:06:45.04+00:00

    @Rishabh

    Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.

    I understand that you would like to purge the contents of CDN using Azure CLI.

    After further investigation, we found that the resource was actually an AFD and not a CDN.

    In that case, the command becomes,

    az afd endpoint purge -g <group> --profile-name <profile> --endpoint-name <endpoint> --content-paths '/*'
    

    Refer : Cache purging in Azure Front Door with Azure CLI

    NOTE:

    • The "az afd" is in preview
    • Please use "az upgrade" to get the latest version.

    Thanks,

    Kapil


    Please Accept an answer if correct.

    Original posters help the community find answers faster by identifying the correct answer.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.