Skip to content

Latest commit

 

History

History
315 lines (233 loc) · 12 KB

File metadata and controls

315 lines (233 loc) · 12 KB

CDN-Accelerated Configuration Delivery with Azure Front Door

App Configuration gives developers a single, consistent place to define configuration settings and feature flags. By integrating Azure App Configuration with Azure Front Door, your configuration data is centrally managed through Azure App Configuration while being cached and distributed through Azure's content delivery network. This architecture is valuable for client-facing applications including mobile, desktop, and browser-based applications.

Documentation links

Request scoping filter samples

The key-value filters used by your application must match exactly the filters configured for the Azure Front Door endpoint; any mismatch will cause the request to be rejected. For example, if your endpoint is configured to allow access to keys starting with an "App1:" prefix, the application code must also load keys starting with "App1:". However, if your application loads keys starting with a more specific prefix like "App1:Prod:", the request is rejected.

Here are some examples to help you set up the right filters.

Application uses default key-values

If your application has the following set up:

builder.Configuration.AddAzureAppConfiguration(options =>
{
    options.ConnectAzureFrontDoor(new Uri("{YOUR-AFD-ENDPOINT}"))
            .ConfigureRefresh(refreshOptions =>
            {
                refreshOptions.RegisterAll()
                    .SetRefreshInterval(TimeSpan.FromMinutes(1));
            });
});

Then your Azure Front Door filters should look like this:

Filter Type Operator Value Operator Value
Key value Key All * Label Equal (No label)

Application uses key-values selector

If your application has the following set up for loading specific key-values:

builder.Configuration.AddAzureAppConfiguration(options =>
{
    options.ConnectAzureFrontDoor(new Uri("{YOUR-AFD-ENDPOINT}"))
            .Select("App1:*")
            .ConfigureRefresh(refreshOptions =>
            {
                refreshOptions.RegisterAll()
                    .SetRefreshInterval(TimeSpan.FromMinutes(1));
            });
});

Then your Azure Front Door filters should look like this:

Filter Type Operator Value Operator Value
Key value Key Starts with App1: Label Equal (No label)

AFD Portal Filters


Application uses default feature flags

If your application has the following set up for loading default feature flags:

builder.Configuration.AddAzureAppConfiguration(options =>
{
    options.ConnectAzureFrontDoor(new Uri("{YOUR-AFD-ENDPOINT}"))
            .UseFeatureFlags(ffOptions =>
            {
                ffOptions.SetRefreshInterval(TimeSpan.FromMinutes(1));
            });
});

Then your Azure Front Door filters should look like this:

Filter Type Operator Value Operator Value
Key value Key All * Label Equal (No label)
Feature flag Key All * Label Equal (No label)

Application uses feature flags selector

If your application has the following set up for loading specific feature flags:

builder.Configuration.AddAzureAppConfiguration(options =>
{
    options.ConnectAzureFrontDoor(new Uri("{YOUR-AFD-ENDPOINT}"))
            .UseFeatureFlags(ffOptions =>
            {
                ffOptions.Select("MyFeatures*")
                    .SetRefreshInterval(TimeSpan.FromMinutes(1));
            });
});

Then your Azure Front Door filters should look like this:

Filter Type Operator Value Operator Value
Key value Key All * Label Equal (No label)
Feature flag Key Starts with MyFeatures Label Equal (No label)

Application uses key-values and feature flags

If your application has the following set up for loading key-values and feature flags:

builder.Configuration.AddAzureAppConfiguration(options =>
{
    options.ConnectAzureFrontDoor(new Uri("{YOUR-AFD-ENDPOINT}"))
            .Select("App1:*")
            .ConfigureRefresh(refreshOptions =>
            {
                refreshOptions.RegisterAll()
                    .SetRefreshInterval(TimeSpan.FromMinutes(1));
            })
            .UseFeatureFlags(ffOptions =>
            {
                ffOptions.Select("MyFeatures*")
                    .SetRefreshInterval(TimeSpan.FromMinutes(1));
            });
});

Then your Azure Front Door filters should look like this:

Filter Type Operator Value Operator Value
Key value Key Starts with App1: Label Equal (No label)
Feature flag Key Starts with MyFeatures Label Equal (No label)

Application uses multiple key-value selectors

If your application has the following set up with multiple selectors:

builder.Configuration.AddAzureAppConfiguration(options =>
{
    options.ConnectAzureFrontDoor(new Uri("{YOUR-AFD-ENDPOINT}"))
            .Select("App1:*")
            .Select("Global*", "App1Label")
            .ConfigureRefresh(refreshOptions =>
            {
                refreshOptions.RegisterAll()
                    .SetRefreshInterval(TimeSpan.FromMinutes(1));
            });
});

Then your Azure Front Door filters should look like this:

Filter Type Operator Value Operator Value
Key value Key Starts with App1: Label Equal (No label)
Key value Key Starts with Global Label Equal App1Label

Application uses key-values and snapshot selectors

If your application has the following set up with key-values and snapshot:

builder.Configuration.AddAzureAppConfiguration(options =>
{
    options.ConnectAzureFrontDoor(new Uri("{YOUR-AFD-ENDPOINT}"))
            .Select("App1:*")
            .SelectSnapshot("MySnapshot")
            .ConfigureRefresh(refreshOptions =>
            {
                refreshOptions.RegisterAll()
                    .SetRefreshInterval(TimeSpan.FromMinutes(1));
            });
});

Then your Azure Front Door filters should look like this:

Filter Type Operator Value Operator Value
Key value Key Starts with App1: Label Equal (No label)
Snapshot Snapshot name MySnapshot - -

Application uses snapshot reference

If your application loads a key-value that is a snapshot reference, Azure Front Door must be configured to allowlist the referenced snapshot. Include the snapshot name in your Azure Front Door filters to enable snapshot resolution. For example, if you have the following set up:

builder.Configuration.AddAzureAppConfiguration(options =>
{
    options.ConnectAzureFrontDoor(new Uri("{YOUR-AFD-ENDPOINT}"))
            .Select("App1:*")
            .ConfigureRefresh(refreshOptions =>
            {
                refreshOptions.RegisterAll()
                    .SetRefreshInterval(TimeSpan.FromMinutes(1));
            });
});

Lets say, one of the loaded key-values is a snapshot reference that looks like this:

{
    "key": "App1:MySnapshotReference",
    "label": null,
    "value": "{\"snapshot_name\":\"snapshot1\"}",
    "content_type": "application/json; profile=\"https://azconfig.io/mime-profiles/snapshot-ref\"; charset=utf-8",
    "tags": {}
}

Then you need to add "snapshot1" to your Azure Front Door filters, in addition to the key-value filter.

Filter Type Operator Value Operator Value
Key value Key Starts with App1: Label Equal (No label)
Snapshot Snapshot name snapshot1 - -

Application loads key-values with reserved characters

If your application has the following set up where your key filter contains App Config reserved characters:

builder.Configuration.AddAzureAppConfiguration(options =>
{
    options.ConnectAzureFrontDoor(new Uri("{YOUR-AFD-ENDPOINT}"))
            .Select("App1\\*Prefix*")
            .ConfigureRefresh(refreshOptions =>
            {
                refreshOptions.RegisterAll()
                    .SetRefreshInterval(TimeSpan.FromMinutes(1));
            });
});

Then your Azure Front Door filters should look like this:

Filter Type Operator Value Operator Value
Key value Key Starts with App1\*Prefix Label Equal (No label)

AFD Portal Filters


Application loads key-values with tag filters

If your application has the following set up with tag filters:

builder.Configuration.AddAzureAppConfiguration(options =>
{
    options.ConnectAzureFrontDoor(new Uri("{YOUR-AFD-ENDPOINT}"))
            .Select("App1:*", tagFilters: new[] { "Env=Dev" })
            .ConfigureRefresh(refreshOptions =>
            {
                refreshOptions.RegisterAll()
                    .SetRefreshInterval(TimeSpan.FromMinutes(1));
            });
});

Then your Azure Front Door filters should look like this:

Filter Type Operator Value Operator Value Operator Value
Key value Key Starts with App1: Label Equal (No label) Tags Name: Env, Value: Dev

AFD Portal Filters


Sample Applications