Hi
I have the below Powershell script to purge an Akamai CDN endpoint.
[CmdletBinding()]
PARAMETERS WILL BE PROVIDED FROM RELEASE PIPE LINE.
param (
[string] [Parameter(Mandatory=$true)] $ResourceGroupName,
[string] [Parameter(Mandatory=$true)] $ProfileName,
[string] [Parameter(Mandatory=$true)] $EndpointName
)
Purge some assets.
Unpublish-AzCdnEndpointContent -ProfileName $ProfileName -ResourceGroupName $ResourceGroupName -EndpointName $EndpointName -PurgeContent "/*"
Write-Output "Purged end point succesfully"
As per the link https://learn.microsoft.com/en-us/azure/cdn/cdn-purge-endpoint wildcard is not support for Akamai CDN endpoint so purging does not work currently.
As per this link https://stackoverflow.com/questions/67639095/azure-akamai-cdn-endpoint-not-purging-content we can provide paths as below but this also does not seem to work as stated in the link
[string[]]$purge = @(“/lib/app/Controllers/file1.js", “/lib/app/Controllers/files2.js", “/lib/app/Controllers/billingController.js", “/lib/app/Controllers/file3.js", “/lib/app/Controllers/file4.js"");
Unpublish-AzCdnEndpointContent -ResourceGroupName ${{parameters.resourceGroup}} -ProfileName application$(environment) -EndpointName application$(environment) -PurgeContent $purge;
My queries are as below:
- While providing the path for the files do we not need to include the container name in the path? We are using a static website hosted
on a storage account. The Storage account container is where the assets/files that get cached
- Can we not provide here name of the folder such that all files inside it is purged from the Cache.?
- As per the link above if this does not work , then what is the way ahead to purge content from Akamai CDN endpoint?
Please provide some inputs on the same.
Thanks,
SuvraJyoti