Purge Akamai CDN endpoint

suvra jyoti 151 Reputation points
2021-10-12T06:07:59.23+00:00

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:

  1. 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
  2. Can we not provide here name of the folder such that all files inside it is purged from the Cache.?
  3. 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

Azure Content Delivery Network
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. suvasara-MSFT 10,011 Reputation points
    2021-10-12T18:11:33.677+00:00

    @suvra jyoti , Yes, ‘Purge all’ and ‘Wildcard purge’ (/*) are not supported by Azure CDN from Akamai currently. Using the “/” you will purge only the root domain. Having this said, with Akamai CDN, the only option at this time is to put all the URL paths that needs to be purged.

    ----------

    Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.