How to Purge Azure CDN with PowerShell.
I needed a script to purge the CDN of this blog, I have the CDN setup already.
Get a list of all the powershell commands for the CDN
1get-command -module AzureRM.Cdn
View all your CDN Profiles that you have setup
1Get-AzureRmCdnProfile
Purge CDN
1$resourceGroupName = ''
2$profileName = ''
3$endpointName = ''
4
5$cdnEndpoint = Get-AzureRmCdnEndpoint -ResourceGroupName $ResourceGroupName -ProfileName $profileName -EndpointName $endpointName
6
7$cdnEndpoint | Unpublish-AzureRmCdnEndpointContent -PurgeContent "/*"
Conclusion
This is really something you want to have inclued as part of your automated deployment. In a future article I will tie this together with a deployment scenario.