App Configuration

Overview

The App Configuration builder creates Azure App Configuration stores, which are a central repository for managing application settings and feature flags.

  • Configuration Store (Microsoft.AppConfiguration/configurationStores)
  • Key Values (Microsoft.AppConfiguration/configurationStores/keyValues)

Builder Keywords

configurationStore
KeywordPurpose
nameSets the name of the App Configuration store.
skuSets the SKU of the store. Defaults to Free. Options: Free, Developer, Standard, Premium.
disable_local_authDisables local (access-key) authentication, requiring Azure AD / RBAC only.
enable_purge_protectionEnables purge protection (Standard SKU only). Once enabled, it cannot be disabled.
public_network_accessSets public network access: Enabled or Disabled.
soft_delete_retention_in_daysSets the soft-delete retention period in days (Standard SKU only, 1-7 days).
data_plane_authentication_modeSets the data plane authentication mode: Local or Passthrough.
add_feature_flagAdds a single feature flag to the store.
add_feature_flagsAdds a list of feature flags to the store.
add_key_valueAdds a single key-value item to the store.
add_key_valuesAdds a list of key-value items to the store.
add_tagAdds an ARM tag to the store.
add_tagsAdds multiple ARM tags to the store.
depends_onAdds a dependency to the store.

Key Value Fields

FieldPurpose
KeyThe key name for the item.
LabelAn optional label to distinguish between different environments or configurations.
ValueThe value to store.
ContentTypeOptional MIME content type (e.g. application/json for JSON values).
KeyValueTagsOptional App Configuration item tags (not ARM resource tags).

Feature Flag Fields

FieldPurpose
NameThe name of the feature flag.
DescriptionA human-readable description of the flag.
LabelAn optional label (can be empty string for no label).
Statetrue if the flag is enabled, false if disabled.

Configuration Members

MemberPurpose
ResourceIdThe ARM resource ID of the App Configuration store.
EndpointReturns an ARM expression for the data plane endpoint URL of the store.

Example

open Farmer
open Farmer.Builders
open Farmer.ConfigurationStore

let myConfig = configurationStore {
    name "my-app-config"
    sku Standard
    add_tags [ "env", "prod"; "team", "platform" ]

    add_feature_flags [
        {
            Name = "DarkMode"
            Description = "Enable dark mode UI"
            Label = ""
            State = true
        }
        {
            Name = "BetaFeature"
            Description = "Beta feature available to select users"
            Label = "beta"
            State = false
        }
    ]

    add_key_values [
        {
            Key = "Api:BaseUrl"
            Label = Some "prod"
            Value = "https://api.example.com"
            ContentType = None
            KeyValueTags = Map.empty
        }
        {
            Key = "FeatureSettings"
            Label = None
            Value = """{"timeout":30,"retries":3}"""
            ContentType = Some "application/json"
            KeyValueTags = Map [ "environment", "production" ]
        }
    ]
}

let deployment = arm {
    location Location.NorthEurope
    add_resource myConfig
}