Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot purge all content from a CDN #6722

Closed
grandynguyen opened this issue Jul 4, 2018 · 2 comments
Closed

Cannot purge all content from a CDN #6722

grandynguyen opened this issue Jul 4, 2018 · 2 comments
Labels
Network - CDN az cdn Service Attention This issue is responsible by Azure service team.

Comments

@grandynguyen
Copy link

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)

@tjprescott tjprescott added Network - CDN az cdn bug This issue requires a change to an existing behavior in the product in order to be resolved. labels Jul 5, 2018
@grandynguyen
Copy link
Author

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

@tjprescott tjprescott removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jul 5, 2018
@bsiegel bsiegel added the Service Attention This issue is responsible by Azure service team. label Sep 26, 2018
@haroldrandom haroldrandom added Network - CDN az cdn Service Attention This issue is responsible by Azure service team. labels Oct 25, 2019
@florinvirdol
Copy link

When i had a similar issue in Azure DevOps pipelines, i got this error: Invalid ContentPath "C:/Program Files/Git/LICENSE.txt". ContentPath for purge action must be a relative path: either for a single resource "/path/pic.jpg" or a wild card "/path/*".

The fix was to choose PowerShell as Script type instead of Shell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Network - CDN az cdn Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

5 participants