Front Door Cache clearing in DevOps Pipeline - which command to use?

Torben 20 Reputation points
2023-03-21T10:30:35.34+00:00

Hello,

I have enabled caching on one of my front door routing rules. Now I need to purge the cache while I deploy the application via Azure DevOps to the respective resource.

I've found this option:

- job: purge
  pool:
    vmImage: ubuntu-16.04
  steps:
  - task: AzureCLI@2
    inputs:
      azureSubscription: ${{ parameters.azure_service_connection }}
      scriptType: 'bash'
      scriptLocation: 'inlineScript'
      inlineScript: |
        az extension add --name front-door
        az network front-door purge-endpoint --resource-group ${{ parameters.resource_group}} --name ${{ parameters.front_door}} --content-paths "/"

Now I have two questions:

  1. What is the difference between az network front-door purge-endpoint and az afd endpoint purge?
  2. az network front-door purge-endpoint requires a name . What's the name here explicitly? Is it the name of the routing rule? In this case "staging-multilanguage"?
    CleanShot 2023-03-21 at 11.29.37@2x
Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
576 questions
{count} votes

Accepted answer
  1. GitaraniSharma-MSFT 47,416 Reputation points Microsoft Employee
    2023-03-21T11:06:32.9333333+00:00

    Hello @Torben ,

    Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.

    I understand you have a couple of questions regarding Azure Front Door purge. I've answered them below:

    What is the difference between az network front-door purge-endpoint and az afd endpoint purge?

    az network front-door commands are used to manage Classic Azure Front Doors.

    https://learn.microsoft.com/en-us/cli/azure/network/front-door?view=azure-cli-latest

    az afd commands are used to manage Azure Front Door Standard/Premium.

    https://learn.microsoft.com/en-us/cli/azure/afd?view=azure-cli-latest

    az network front-door purge-endpoint requires a name. What's the name here explicitly? Is it the name of the routing rule? In this case "staging-multilanguage"?

    The name parameter in the az network front-door purge-endpoint command is the name of the Azure Front Door.

    Refer: https://learn.microsoft.com/en-us/cli/azure/network/front-door?view=azure-cli-latest#az-network-front-door-purge-endpoint

    https://learn.microsoft.com/en-us/azure/frontdoor/standard-premium/how-to-cache-purge-cli

    So, if you have a Classic Azure Front Door, you can use az network front-door command.

    If you have a Standard/Premium Azure Front Door, you can use az afd command.

    Kindly let us know if the above helps or you need further assistance on this issue.


    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


0 additional answers

Sort by: Most helpful