Azure App Configuration Key

This page shows how to write Terraform and Azure Resource Manager for App Configuration Key and write them securely.

azurerm_app_configuration_key (Terraform)

The Key in App Configuration can be configured in Terraform with the resource name azurerm_app_configuration_key. The following sections describe 1 example of how to use the resource and its parameters.

Example Usage from GitHub

configuration.tf#L1
resource "azurerm_app_configuration_key" "cosmosdb_account_endpoint" {
  configuration_store_id = data.azurerm_app_configuration.common.id
  label                  = local.app_config_label
  key                    = "Cosmos:Endpoint"
  value                  = data.azurerm_cosmosdb_account.common.endpoint
}

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

The following arguments are supported:

  • configuration_store_id - (Required) Specifies the id of the App Configuration. Changing this forces a new resource to be created.

  • key - (Required) The name of the App Configuration Key to create. Changing this forces a new resource to be created.

  • content_type - (Optional) The content type of the App Configuration Key. This should only be set when type is set to kv.

  • label - (Optional) The label of the App Configuration Key. Changing this forces a new resource to be created.

  • value - (Optional) The value of the App Configuration Key. This should only be set when type is set to kv.

  • locked - (Optional) Should this App Configuration Key be Locked to prevent changes?

  • type - (Optional) The type of the App Configuration Key. It can either be kv (simple key/value) or vault (where the value is a reference to a Key Vault Secret.

  • vault_key_reference - (Optional) The ID of the vault secret this App Configuration Key refers to, when type is set to vault.

  • tags - (Optional) A mapping of tags to assign to the resource.


The following attributes are exported:

  • id - The App Configuration Key ID.

  • etag - The ETag of the key.

Explanation in Terraform Registry

Manages an Azure App Configuration Key. -> Note: App Configuration Keys are provisioned using a Data Plane API which requires the role App Configuration Data Owner on either the App Configuration or a parent scope (such as the Resource Group/Subscription). More information can be found in the Azure Documentation for App Configuration.

Microsoft.AppConfiguration/configurationStores (Azure Resource Manager)

The configurationStores in Microsoft.AppConfiguration can be configured in Azure Resource Manager with the resource name Microsoft.AppConfiguration/configurationStores. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

template.json
{
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workbookDisplayName": {
      "type": "string",
template.json
{
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workbookDisplayName": {
      "type": "string",
AzureInventory.json
{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
        "workbookName": {
template.json
{
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workbookDisplayName": {
      "type": "string",
template.json
{
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workbookDisplayName": {
      "type": "string",
template.json
{
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workbookDisplayName": {
      "type": "string",
template.json
{
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workbookDisplayName": {
      "type": "string",
dash.json
{
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workbookDisplayName": {
      "type": "string",
template.json
{
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workbookDisplayName": {
      "type": "string",

Parameters

  • apiVersion required - string
  • identity optional
      • type optional - string

        The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities.

      • userAssignedIdentities optional - undefined

        The list of user-assigned identities associated with the resource. The user-assigned identity dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.

  • location required - string

    The location of the resource. This cannot be changed after the resource is created.

  • name required - string

    The name of the configuration store.

  • properties required
      • encryption optional
          • keyVaultProperties optional
              • identityClientId optional - string

                The client id of the identity which will be used to access key vault.

              • keyIdentifier optional - string

                The URI of the key vault key used to encrypt data.

      • publicNetworkAccess optional - string

        Control permission for data plane traffic coming from public networks while private endpoint is enabled.

  • sku required
      • name required - string

        The SKU name of the configuration store.

  • tags optional - string

    The tags of the resource.

  • type required - string

Frequently asked questions

What is Azure App Configuration Key?

Azure App Configuration Key is a resource for App Configuration of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure App Configuration Key?

For Terraform, the arkiaconsulting/booliba source code example is useful. See the Terraform Example section for further details.

For Azure Resource Manager, the HasanIftakher/Azure-Monitor, tulpy/Azure and gaelor/SentinelAsCode source code examples are useful. See the Azure Resource Manager Example section for further details.