Modern web applications often serve users from different geographical locations. When every request must travel to a central application server, network latency can affect response times and the overall user experience.
Content Delivery Networks (CDNs) help reduce this problem by distributing content across locations closer to users. However, some applications need more than content caching. They need to execute custom logic before a request reaches the origin server.
Azure Front Door Edge Actions address this requirement by allowing developers to run custom JavaScript at Azure Front Door edge locations. Developers can modify HTTP requests, apply routing logic, validate tokens, and implement other lightweight operations without sending every decision to the application backend.
Microsoft provides the Azure Resource Manager Edge Actions library for .NET to manage these resources programmatically.
This article explains how Azure Edge Actions work, how to install the new .NET SDK, create and list Edge Action resources, understand versions and execution filters, and integrate edge processing into a real application architecture.
1. What Are Azure Edge Actions?
Azure Edge Actions are serverless JavaScript functions that execute on Azure Front Door infrastructure.
Instead of sending every request directly to an application server for processing, developers can execute supported custom logic at the edge.
An edge location, also called a Point of Presence (PoP), is a location in the Azure Front Door network that receives and processes client traffic.
Consider an application with users in India, Europe, and the United States.
Without edge processing, a request might follow this path:
User
|
v
Azure Front Door
|
v
Application Server
|
v
Process Request
|
v
Return Response
With an Edge Action, Azure Front Door can execute custom logic before continuing its normal request processing.
User
|
v
Azure Front Door Edge Location
|
v
Edge Action
|
v
Modify or Validate Request
|
v
Azure Front Door
|
v
Application Server
The Edge Action runs inside an isolated execution environment at the Front Door edge.
This makes it possible to handle certain lightweight operations closer to the user instead of adding another round trip to the origin application.
2. Why Use Azure Edge Actions?
Traditional application middleware executes inside the application hosting environment.
For example, ASP.NET Core middleware can inspect incoming requests, validate authentication tokens, add response headers, and perform routing decisions.
However, requests must first reach the application infrastructure before this middleware can execute.
Edge Actions move supported request-processing logic closer to the network edge.
Consider an application that needs to redirect users based on their country.
Without edge processing, the request might reach the backend, where application code determines the redirect destination.
With an Edge Action, this decision can be made at Azure Front Door before the request continues to the origin.
Other useful scenarios include:
- Adding or removing HTTP headers.
- Validating JSON Web Tokens.
- Redirecting requests.
- Rewriting URLs.
- Selecting an origin dynamically.
- Rejecting requests based on custom conditions.
- Supporting A/B experimentation.
These capabilities are useful when the logic is small, executes quickly, and does not require a complete backend application.
3. Understand the Azure Edge Actions Architecture
Before using the .NET SDK, it is important to understand the main components.
EdgeAction
An EdgeAction represents the Azure resource that contains the configuration for an edge function.
It is managed through Azure Resource Manager and belongs to an Azure resource group.
EdgeActionVersion
An EdgeActionVersion represents a particular version of the JavaScript code associated with an Edge Action.
Versions allow developers to maintain multiple implementations and release updates incrementally.
For example:
RequestProcessor
|
+-- Version 1
|
+-- Version 2
|
+-- Version 3
Azure Front Door can use the default version or a version selected through an execution filter.
An Edge Action can have up to three versions.
EdgeActionExecutionFilter
An EdgeActionExecutionFilter controls which version executes based on configured conditions, such as custom request headers.
This is useful when developers need to test a new version with selected traffic rather than immediately changing the default version for everyone.
Azure Front Door Route
Creating an Edge Action does not automatically make it execute.
The Edge Action must be attached to an Azure Front Door route or invoked through an appropriate rule-set configuration.
This distinction is important. An Edge Action resource can exist successfully in Azure while receiving no traffic because it has not been associated with a route.
4. Understand the New Azure Resource Manager .NET SDK
Microsoft provides a dedicated management library for Azure Edge Actions.
The NuGet package is:
Azure.ResourceManager.EdgeActions
The library follows the Azure SDK design guidelines and uses the Azure Resource Manager programming model.
It supports managing Edge Action resources and integrates with the standard Azure SDK infrastructure.
Important capabilities include:
- Azure Identity authentication.
- Edge Action resource management.
- Edge Action version management.
- Execution filter management.
- Asynchronous operations.
- HTTP pipeline customization.
- OpenTelemetry-based distributed tracing support.
The SDK separates resource management from the JavaScript code that runs at the edge.
This means a .NET application can manage Azure resources programmatically, while the actual edge function remains JavaScript.
Install the NuGet Package
Create a console application:
dotnet new console -n AzureEdgeActionsDemo
cd AzureEdgeActionsDemo
Install the Edge Actions management package:
dotnet add package Azure.ResourceManager.EdgeActions --version 1.0.0
Install Azure Identity:
dotnet add package Azure.Identity
The stable Azure.ResourceManager.EdgeActions 1.0.0 package is listed in the November 2026 Azure SDK release.
If you are working with an older package version or testing unreleased SDK functionality, check the NuGet version and release notes before selecting a prerelease package.
5. Configure Azure Authentication
The SDK needs an authenticated identity before it can manage Azure resources.
For local development, DefaultAzureCredential is a convenient option.
It supports multiple authentication methods and selects an available credential based on the execution environment.
For example, it can use Azure CLI credentials during local development and managed identity credentials when deployed to an appropriately configured Azure environment.
Sign In to Azure
Install Azure CLI if it is not already available.
Run:
az login
Select the subscription:
az account set --subscription "YOUR-SUBSCRIPTION-ID"
Verify the selected subscription:
az account show
The application can now use the authenticated Azure CLI identity through DefaultAzureCredential.
Configure Permissions
Authentication does not automatically provide permission to create or modify Azure resources.
The identity must have the appropriate Azure role assignments.
For example, creating an Edge Action requires permission to create or update the relevant resource under the selected resource group.
Use a role with the minimum permissions required by the application.
For production workloads, managed identity is generally preferable to storing client secrets in application configuration.
6. Create an Azure Edge Action Using C#
Now let's create an Edge Action resource through the .NET SDK.
Assume that you are building a web application and want to manage an Edge Action named RequestProcessor.
The resource will be created inside an existing resource group.
Step 1: Create an ArmClient
The ArmClient is the primary client for interacting with Azure Resource Manager.
using Azure.Identity;
using Azure.ResourceManager;
var credential = new DefaultAzureCredential();
var client = new ArmClient(credential);
DefaultAzureCredential provides the authentication mechanism.
ArmClient uses that credential to communicate with Azure Resource Manager.
Step 2: Retrieve the Subscription
Get the default subscription associated with the authenticated Azure account.
var subscription =
await client.GetDefaultSubscriptionAsync();
For applications that manage multiple subscriptions, retrieve the intended subscription explicitly rather than depending on whichever subscription is selected as the default.
Step 3: Retrieve the Resource Group
The Edge Action resource belongs to a resource group.
var resourceGroup =
await subscription.GetResourceGroups()
.GetAsync("production-rg");
Replace production-rg with the name of an existing resource group.
Step 4: Create the Edge Action
Use the resource group's Edge Action collection to create the resource.
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.EdgeActions;
using Azure.ResourceManager.EdgeActions.Models;
using Azure.ResourceManager.Resources;
var credential = new DefaultAzureCredential();
var client = new ArmClient(credential);
var subscription =
await client.GetDefaultSubscriptionAsync();
var resourceGroup =
await subscription.GetResourceGroups()
.GetAsync("production-rg");
var edgeActions = resourceGroup.GetEdgeActions();
var data = new EdgeActionData(
new AzureLocation("WestUS"))
{
Sku = new EdgeActionSkuType(
"Standard",
"Standard")
};
ArmOperation<EdgeActionResource> operation =
await edgeActions.CreateOrUpdateAsync(
WaitUntil.Completed,
"RequestProcessor",
data);
EdgeActionResource edgeAction = operation.Value;
Console.WriteLine(
$"Created Edge Action: {edgeAction.Data.Name}");
The example follows the resource-creation pattern documented for the SDK.
The EdgeActionData object defines the resource configuration, including its location and SKU.
The CreateOrUpdateAsync method creates the resource or updates an existing resource with the same name.
WaitUntil.Completed instructs the SDK to wait for the long-running Azure operation to finish before returning the completed resource.
The location shown is an example. Select a location supported by the Azure Edge Actions service for your deployment.
Important: Creating the Resource Is Not the Same as Deploying Code
The previous example creates the Edge Action resource.
It does not automatically upload JavaScript code, create a code version, or attach the resource to an Azure Front Door route.
These are separate steps in the Edge Actions lifecycle.
This distinction helps avoid a common deployment mistake: assuming that a successfully created resource is already processing production requests.
7. List Existing Edge Actions
A monitoring or administration application may need to retrieve all Edge Actions inside a resource group.
The SDK provides the GetEdgeActions collection for this purpose.
Example:
using Azure.Identity;
using Azure.ResourceManager;
var credential = new DefaultAzureCredential();
var client = new ArmClient(credential);
var subscription =
await client.GetDefaultSubscriptionAsync();
var resourceGroup =
await subscription.GetResourceGroups()
.GetAsync("production-rg");
await foreach (
var edgeAction in resourceGroup.GetEdgeActions())
{
Console.WriteLine(
$"Name: {edgeAction.Data.Name}");
Console.WriteLine(
$"Location: {edgeAction.Data.Location}");
Console.WriteLine(
$"Provisioning State: {edgeAction.Data.ProvisioningState}");
}
The GetEdgeActions method returns an asynchronous collection.
The await foreach statement iterates through the available resources without requiring developers to manually handle pagination.
This is useful for administration dashboards that display Edge Actions deployed across different environments.
For example, an internal platform team could use this approach to build a dashboard containing development, staging, and production Edge Action resources.
8. Understand Edge Action Versions
Version management is an important part of deploying custom edge logic.
An Edge Action must have at least one JavaScript code version before it can process traffic.
Versions allow developers to introduce changes without immediately replacing the existing implementation.
For example:
RequestProcessor
|
+-- Version 1
| |
| +-- Existing request validation
|
+-- Version 2
| |
| +-- Updated request validation
|
+-- Version 3
|
+-- Experimental implementation
You can maintain up to three versions for each Edge Action.
A new version can be selected as the default version after testing.
If the new implementation causes a problem, developers can switch back to a previous version.
Create and Test a JavaScript Version
Azure provides a portal-based workflow for creating and testing versions.
The general process is:
- Open the Edge Action resource in Azure Portal.
- Navigate to Settings and select Versions.
- Select Add.
- Enter a version name.
- Choose the browser editor or upload a JavaScript file.
- Add the JavaScript implementation.
- Configure test inputs.
- Run the test and inspect the output.
- Set the version as default when appropriate.
The test interface allows developers to provide request or response inputs, headers, origins, and execution context.
The test results are local test results. They do not represent a live request passing through Azure Front Door.
After deployment and route association, validate the implementation through the actual Front Door endpoint.
9. Write a Simple JavaScript Edge Action
Although the management SDK is written for .NET, Edge Action code itself uses JavaScript.
For example, consider a requirement to add a custom request header before the request continues to the origin.
A simplified Edge Action implementation looks like this:
export function onRequest(request, context) {
request.headers.set(
"x-edge-processed",
"true"
);
return request;
}
The example demonstrates a lightweight request-processing operation.
The function receives the request and execution context.
It adds a custom header and returns the modified request.
This header can be useful for identifying requests that passed through the Edge Action.
The exact supported interfaces and methods must follow the Azure Edge Actions execution environment. This is not a general-purpose Node.js runtime, so developers should not assume that Node.js modules, filesystem APIs, or arbitrary network libraries are available.
For more complex implementations, use the official Edge Actions JavaScript samples and execution-environment documentation.
10. Understand Execution Filters
An execution filter determines which Edge Action version should execute when configured conditions match.
This is particularly useful when releasing new code gradually.
Imagine that Version 1 is currently handling all production traffic.
You have created Version 2 with improved request validation.
Instead of immediately replacing Version 1, you want to test Version 2 for selected requests.
An execution filter can select the version based on a configured header or condition.
The workflow can look like this:
Incoming Request
|
v
Check Execution Filter
|
+----------------------+
| |
v v
Matching Condition No Match
| |
v v
Version 2 Default Version 1
| |
+----------+-----------+
|
v
Continue Processing
For example, a testing client might send a custom header that identifies it as part of an internal test group.
The filter can be configured to select the experimental version for matching requests.
This approach helps teams validate changes without immediately switching every production request.
Execution filters should be configured and tested carefully. They are not a replacement for a complete traffic-management or deployment strategy.
11. Attach an Edge Action to an Azure Front Door Route
Creating an Edge Action and creating its code version are not enough.
The Edge Action must be associated with an Azure Front Door route before it can process client traffic.
Azure provides multiple ways to configure this association.
Attach Through the Azure Portal
Open your Azure Front Door profile.
Navigate to Front Door manager and select the required endpoint and route.
Open the route configuration.
Find the Edge Actions association option and select the Edge Action you want to attach.
Choose the appropriate version and save the route configuration.
Use a Rule Set
Another approach is to configure an Azure Front Door rule set.
Create a rule and select Invoke Edge Action as the action.
Configure the invocation point and select the required Edge Action.
Associate the rule set with the intended Front Door route.
The rule-set approach is useful when execution should depend on specific request conditions.
Choose the Correct Invocation Point
Azure Edge Actions support two invocation points:
- Client Request.
- Client Response.
Client Request executes while Azure Front Door processes an incoming client request.
Client Response is intended to execute while processing a response from the origin or cache.
Important platform limitation: As of December 4, 2026, Microsoft documents that Client Response invocations are temporarily unavailable because of a known issue. The documentation lists December 11, 2026, as the targeted fix date. Existing Edge Actions configured for this phase will not execute until the issue is resolved.
For a new implementation, use Client Request for supported scenarios and verify the current service status before depending on Client Response.
12. Understand Azure Edge Actions Limits
Edge Actions are designed for lightweight processing.
They are not intended to replace application servers or execute long-running business operations.
The documented service limits include:
| Limit | Maximum |
|---|
| JavaScript code size | 16 KB |
| Versions per Edge Action | 3 |
| Execution time | 10 milliseconds |
| Edge Action resources per subscription | 100 |
| Supported language | JavaScript |
These limits should influence how developers design edge functions.
For example, an Edge Action should not perform complex database operations or attempt to execute a large business workflow.
Instead, move suitable operations to the edge and keep the main application responsible for complex processing.
Why the Execution Time Limit Matters
The maximum execution time is 10 milliseconds.
If an Edge Action exceeds this limit, Azure Front Door stops its execution and continues without Edge Action processing.
This means the edge function should perform small, predictable operations.
Good examples include:
- Checking a request header.
- Rewriting a URL.
- Adding a response or request header.
- Performing lightweight token validation.
- Selecting a destination based on request information.
Avoid using an Edge Action for expensive calculations or processing that requires external services.
13. Build a Practical .NET Management Application
Let's combine the SDK capabilities into a simple management workflow.
Assume an organization has several Azure Front Door environments.
The operations team wants an internal .NET application that can:
- Connect to an Azure subscription.
- Retrieve a resource group.
- Create an Edge Action when required.
- List existing Edge Actions.
- Display their resource information.
A simplified service can encapsulate the Azure management logic.
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.EdgeActions;
using Azure.ResourceManager.EdgeActions.Models;
using Azure.ResourceManager.Resources;
public class EdgeActionManagementService
{
private readonly ArmClient _client;
public EdgeActionManagementService()
{
_client = new ArmClient(
new DefaultAzureCredential());
}
public async Task<EdgeActionResource> CreateAsync(
string resourceGroupName,
string edgeActionName)
{
var subscription =
await _client.GetDefaultSubscriptionAsync();
var resourceGroup =
await subscription.GetResourceGroups()
.GetAsync(resourceGroupName);
var collection =
resourceGroup.GetEdgeActions();
var data = new EdgeActionData(
new AzureLocation("WestUS"))
{
Sku = new EdgeActionSkuType(
"Standard",
"Standard")
};
var operation =
await collection.CreateOrUpdateAsync(
WaitUntil.Completed,
edgeActionName,
data);
return operation.Value;
}
public async Task<List<string>> GetAllAsync(
string resourceGroupName)
{
var subscription =
await _client.GetDefaultSubscriptionAsync();
var resourceGroup =
await subscription.GetResourceGroups()
.GetAsync(resourceGroupName);
var names = new List<string>();
await foreach (
var item in resourceGroup.GetEdgeActions())
{
names.Add(item.Data.Name);
}
return names;
}
}
This example separates Azure resource management from the rest of the application.
The constructor creates the ArmClient once for the service instance.
The CreateAsync method creates or updates an Edge Action.
The GetAllAsync method retrieves resource names from the selected resource group.
In a production application, register the ArmClient through dependency injection, configure the Azure credential centrally, and avoid hardcoding the Azure location.
You can also introduce interfaces and structured result models to make the service easier to test.
14. Common Problems and Troubleshooting
Authentication Failed
If DefaultAzureCredential cannot authenticate, verify your local Azure CLI session.
Run:
az login
For Azure-hosted applications, verify that the managed identity is enabled and correctly configured.
Authorization Failed
A successful login does not mean the identity has permission to create Edge Actions.
Check the role assignment at the resource-group or subscription level.
Confirm that the assigned role allows the required resource operations.
Resource Group Not Found
Verify that the resource group exists in the selected subscription.
Also check whether the application is using the expected subscription.
az account show
Edge Action Created but Not Executing
This is one of the most important configuration problems.
Creating the resource does not automatically attach it to a route.
Verify that:
- A JavaScript version exists.
- The version is successfully provisioned.
- A default version is selected.
- The Edge Action is attached to the intended route or invoked through a configured rule set.
- The correct invocation point is configured.
- The request matches the route and any execution filters.
JavaScript Execution Fails
Review the execution environment and verify that the code uses supported APIs.
Check the 16 KB code-size limit and 10-millisecond execution limit.
Do not assume that Node.js-specific functionality is available.
New Version Does Not Receive Traffic
Check whether the version was marked as default.
If an execution filter is configured, verify that the incoming request matches its conditions.
Also confirm that the Edge Action is associated with the correct Front Door route.
15. Best Practices for Production Applications
Keep Edge Logic Small
Edge Actions are designed for lightweight request and response processing.
Keep the implementation focused on one responsibility.
Use Versioning for Controlled Releases
Maintain a previous working version before introducing changes.
Test the new version and select it as the default only after validating its behavior.
Avoid Sensitive Information in Headers
Headers can be logged or forwarded to other services.
Do not expose passwords, secrets, or sensitive authentication information through custom diagnostic headers.
Validate JWTs Carefully
JWT validation at the edge can reduce unnecessary requests to the backend.
However, implement signature, issuer, audience, and expiration validation correctly.
Do not treat the presence of a token as proof of authentication.
Monitor Edge Behavior
Test Edge Actions with representative requests.
Review Front Door logs and application telemetry to understand whether requests are reaching the intended route and origin.
Keep Resource Management Separate From Request Processing
Use the .NET SDK for resource management and automation.
Use JavaScript for the actual edge execution logic.
This separation keeps infrastructure administration independent from request-time processing.
Plan for Rollback
Keep the previous working version available.
If a new deployment produces unexpected results, restore the previous default version and verify the route configuration.
16. Advantages and Limitations
Advantages
- Low-latency processing: Custom request logic can execute closer to users at Azure Front Door edge locations.
- Programmatic management: The .NET SDK allows teams to create and manage Edge Action resources from applications and automation workflows.
- Version management: Multiple versions support controlled updates and rollback.
- Flexible request processing: Developers can implement URL rewriting, redirects, header manipulation, and other supported operations.
- Integration with Azure Identity: The SDK supports standard Azure authentication mechanisms.
- Better deployment automation: Resource management can be integrated into internal .NET tools and deployment workflows.
Limitations
- JavaScript only: Edge Action code currently supports JavaScript rather than arbitrary .NET assemblies.
- Small code size: The maximum code size is 16 KB.
- Short execution time: The 10-millisecond execution limit makes the service unsuitable for complex workloads.
- Version limit: Each Edge Action supports up to three versions.
- Route association required: Creating a resource does not automatically enable request processing.
- Front Door dependency: Edge Actions are designed for Azure Front Door Standard and Premium.
- Invocation limitations: Client Response execution is temporarily unavailable as of December 4, 2026, according to the current Microsoft documentation.
Conclusion
Azure Edge Actions provide a way to execute lightweight JavaScript logic at Azure Front Door edge locations.
They help developers handle operations such as request validation, URL rewriting, header manipulation, redirects, and dynamic origin selection closer to users.
The Azure.ResourceManager.EdgeActions library brings resource management capabilities into .NET applications. Developers can use ArmClient, Azure Identity, and the Edge Action resource collections to create and list resources programmatically.
However, resource creation is only one part of the deployment process. Developers must also create JavaScript versions, configure the default version or execution filters, and attach the Edge Action to an Azure Front Door route.
For production applications, the best approach is to keep edge logic lightweight, use versioning for controlled releases, and leave complex business processing to the backend application.
This combination allows .NET teams to manage Azure infrastructure programmatically while using Azure Front Door to execute selected operations closer to their users.
Join the conversation! Your thoughts help the community grow.