Azure Front Door Edge Actions enable you to run your business logic code snippets at edge locations across the world. You can write code snippets in JavaScript that can run against inbound or outbound requests to perform HTTP header manipulations, cookie insertion, A/B experimentation, request rejection, origin selection and many more use cases.
Features
In this preview version of this extension enables you to:
Set context to an Azure subscription and specific resource group within
View AFD profile(s) names
View AFD endpoints within a profile
View AFD routes within a endpoint
Create, view, edit and delete Edge actions
Create, view, edit and delete edge action code versions
Create, view, edit and delete execution filters
Write, test and debug the edge actions code based on a template using dev container
Attach an edge action to a AFD profile and
Deploy the edge action code to production
You will not be able to:
Perform any management of AFD components, please use Azure portal or CLI
Installation
Edge actions use WSL 2 and dev container with Docker for desktop to enable access to CLI and local sandbox for testing the code before deploying it to production. Follow the instructions below to enable dev containers.
Verify WSL integration by navigating to Settings -> Resources -> WSL Integration and ensure the option ‘Enable integration with my default WSL distro’ is enabled
Press F1 or Ctrl+Shift+P to open the command palette.
Type or Select >Dev Containers: Reopen in Container (If you don’t see this option, use either >Dev Containers: Open Folder in Container OR >Dev Containers: Open Workspace in Container option to open the folder/workspace as needed)
Choose whether you want to Add configuration to workspace or Add configuration to user data folder
In the templates selection, enter ghcr.io/Azure/edgeactions-devcontainers/edgeactions into the textbox as the custom template id and click the template name. You will see a ‘OK’ option next to the text box.
Wait for the container to build. This should take care of installing the Edge Actions extension as well.
Once the container is built, the repository opens in the dev container.
Right click in the dev container folder structure space to view the context menu, select ‘Edge Actions’ at the bottom and the option ‘New EdgeAction’ to provide a name your edge action and to load the template files.
Edge Actions Extension Setup
Open the Edge actions extension to perform the below setup steps
Set the subscription by clicking on “Update subscription ID” button and selecting the specific subscription you wish to work with.
Select the resource group in which you want to create the edge actions resources, using “Update resource group” button. This will load the AFD profiles and Edge actions (if any) in the respective panes.
Expand the AFD profile of interest to view the information.
🐛 Feedback and bug reporting
Please reach out to your Microsoft PM contact to share your feedback or report any bugs in the extension