Azure-cli: Cannot purge all content from a CDN

Created on 4 Jul 2018  路  1Comment  路  Source: Azure/azure-cli

Describe the bug
az cdn endpoint purge ... --content-paths "/" "/*" does not purge files in root directory.

To Reproduce

  • Create a blob storage container.
  • Create a Premium Verizon CDN instance that relays the blob storage container.
  • Place any test file into root of the blob storage container.
  • Access the new file through the CDN endpoint. It should give you the new file.
  • Replace or delete the test file from the Blob Container.
  • Using the azure-cli try to purge the file using wildcards. (I tried "/" and "/*", the only thing that worked was --contentpath "/testfile.txt")

Expected behavior
Purging / or /* should purge all files.

Environment summary
azure-cli (2.0.39)
cdn (0.0.14)

Network - CDN Service Attention

Most helpful comment

I've figured out what was causing the issue. I had a URL Rewrite Rule on my CDN that must have been interfering with the purge requests.

Adding the following conditional check to the URL Rewrite Rule fixed everything:

IF -> Request Header Regex -> User-Agent -> Does Not Match -> ECPurge/*

Ignore Case = true

>All comments

I've figured out what was causing the issue. I had a URL Rewrite Rule on my CDN that must have been interfering with the purge requests.

Adding the following conditional check to the URL Rewrite Rule fixed everything:

IF -> Request Header Regex -> User-Agent -> Does Not Match -> ECPurge/*

Ignore Case = true
Was this page helpful?
0 / 5 - 0 ratings