Skip to content

Instantly share code, notes, and snippets.

@jyotsnaravikumar
jyotsnaravikumar / purge_frontdoor_cdn.yml
Last active August 11, 2022 03:12
Programmatically Purge Frontdoor CDN
## Programmatically Purging Azure Frontdoor CDN With AzDevops
1. Create a Azure Service Connection by creating a service principal so that devops process has access to perform pruging operation on frontdoor resource
1. Create a App Registration -> as spn-devops-dev
2. Goto Certificates and Secrets -> Add secret , note the ApplicationId and Secret
3. Goto Frontdoor instance -> open Access Control (IAM) -> Add Role Assignment -> Role as "Contributor" -> Assign Access To-> "user, groups or service principal" -> Select -> search for service principal spn-devops-dev -> Select
4. Note the Azure Service Connection name - as mymap-dev-service-connection
2. Add environment variables for Azure FrontDoor, ResourceGroup and Service Connection
3. Add a purging step which depends on the successly deploy. This ensure the cdn cache is refreshed with newer contents from the build after every build.