Search code examples
azureazure-cliazure-cdn

Not able to purge Azure CDN Endpoint using Azure CLI


I'm using Azure CLI to purge all the contents from Azure CDN endpoint. I got a reference from Microsoft Docs: https://learn.microsoft.com/en-us/cli/azure/cdn/endpoint?view=azure-cli-latest

I'm trying exactly same commands with proper params but it says - "Endpoint(s) not found. Please verify the resource(s), group or it's parent resources exist."

az cdn endpoint purge -g <my-resource-group> --profile-name \
<name-of-cdn-profile> --content-paths '/*' --name <cdn-endpoint-name>

-renders the above error

however, I can see the CDN endpoint when I issue the list command:

az cdn endpoint list -g <my-resource-group> --profile-name <cd>n-profile-name>

the above command works fine and returns the endpoint which I'm trying to purge

Anyone having a similar experience?

TIA!


Solution

  • I can produce this error, please check the parameter --name <cdn-endpoint-name>, It should not have a suffix like .azureedge.net. The endpoint name is the name of the resource which type is Endpoint in your resource group.

    enter image description here