I have created a CDN named 'cdn-profile', in resource group 'rgDev' . In the CDN the endpoint created is 'webqa.azureedge.net'. Inside that I have created a custom domain 'qa.example.com'. I wanted to purge the CDN cache. Below is the command I run.
$ResourceGroupName='rgDev'
$EndpointName='qa.example.com'
$ProfileName='cdn-profile'
$CDNEndPointName='webqa.azureedge.net'
az cdn endpoint purge -g $ResourceGroupName -n $EndpointName --profile-name $ProfileName --content-paths '/*' --name $CDNEndPointName
This gives me below error: Endpoint(s) not found. Please verify the resource(s), group or it's parent resources exist.
What am I missing here?
In the Azure CLI command az cdn endpoint purge, the name of the CDN endpoint is webqa
(It is the name of the resource that type is Endpoint in your resource group.) instead of the hostname webqa.azureedge.net
or qa.example.com
.
You should use it like this:
$ResourceGroupName='rgDev'
$ProfileName='cdn-profile'
$CDNEndPointName='webqa'
az cdn endpoint purge -g $ResourceGroupName --profile-name $ProfileName --content-paths '/*' --name $CDNEndPointName