achebrol / azdev-akamai-cache-purge

Azure DevOps extension to purge Akamai edge content cache

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Akamai Cache Purge

Overview

NOTE: This extension is currently in public preview. Please bear in mind that some of the task parameters or extension behaviour may suddenly change (this might include breaking changes).

This extension adds Akamai Cache Purge task to Azure DevOps pipleines to purge content cache at the Akamai Edge using Fast Purge API. The extension uses purge content by URL approach with invalidate request method.

Extension Build Code
Extension Build CodeFactor

Features

  • Service connection for Akamai EdgeGrid
  • Target staging or production Akamai network
  • Purge URLs cache using invalidate method
  • Wait for purge request activation

How to use

  1. Add Akamai Cache Purge task to your release pipeline
  2. Select Akamai EdgeGrid endpoint (create if does not exist)
  3. Select target Akamai network
  4. Specify target URLs to purge cache

Make sure all the URLs you provide meet these requirements (as per Akamai documentation):

  • Hostnames must be mapped to ​Akamai​ in the DNS CNAME record
  • URLs must be full, not partial
  • URLs don't include any wild cards
  • URLs must contain a protocol — either http:// or https://
  • A list of URLs cannot exceed 50,000 characters.
  • To successfully purge a URL, you must have permissions to purge content associated with that URL's CP code.

Template: example task configuration

- task: akamaicachepurge@1
  displayName: Akamai Cache Purge
  inputs:
    edgegridEndpoint: My-Endpoint
    network: My-Network # Options: staging, production
    urls: |
      https://my.domain/one
      https://my.domain/two
    wait: false # Options: true, false

Service connection

In order to use the extension you may need to create a new service connection for Akamai EdgeGrid.

To create new service connection, go to Project settings > Service connections and select Create new connection then choose Akamai EdgeGrid service connection type and fill-in your user access details.

You will need to create credentials for authentication with EdgeGrid through Akamai Control Center.

  • Connection URL: https://myhost.purge.akamaiapis.net
  • Client secret: My-Client-Secret
  • Client token: My-Client-Token
  • Access token: My-Access-Token

Support

For aditional information and support please refer to project repository. To enable debug mode to help troubleshooting issues, please configure DEBUG=akamaicachepurge:* custom release variable.

For help with Azure DevOps and release pipelines please refer to official documentation.

References

About

Azure DevOps extension to purge Akamai edge content cache

License:MIT License


Languages

Language:TypeScript 84.0%Language:PowerShell 16.0%