Repository: hashicorp/terraform-provider-azurerm

Issue #5840: Support for managing keys and values in app configuration
Created: 2020-02-21T14:01:03Z
Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment


Description
Provide resources for managing keys and values in app configuration servers (such as azurerm_key_vault_key and azurerm_key_vault_secret allow me to manage keys and secrets in a vault).
New or Affected Resource(s)

azurerm_app_configuration

Duplicate issue #8337: New Resource: azurerm_app_configuration_key_value 
Created: 2020-09-03T03:42:38Z
Community Note

Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment


Description

A new resource for setting a key-value in an Azure App Configuration with support for optionally setting its label and content type.
New or Affected Resource(s)


azurerm_app_configuration_key_value

Potential Terraform Configuration

resource "azurerm_resource_group" "example" {
  name     = "example-rg"
  location = "East US"
}

resource "azurerm_app_configuration" "example" {
  name                = "example-conf"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
}

resource "azurerm_app_configuration_key_value" "simple_kv" {
  app_configuration_name = azurerm_app_configuration.example.name

  key   = "sampleKey"
  value = "sampleValue"
}

resource "azurerm_app_configuration_key_value" "label_kv" {
  app_configuration_name = azurerm_app_configuration.example.name

  key   = "sampleKey"
  label = "myLabel"
  value = "anotherSampleValue"
}

resource "azurerm_app_configuration_key_value" "content_type_kv" {
  app_configuration_name = azurerm_app_configuration.example.name

  key          = "sampleKeyWithContentType"
  content_type = "application/json"
  value        = "[1, 2, 3, 4]"
}
References

A couple of possibly interesting notes. Today, App Configuration doesn't really support doing anything with key-values through the Azure management APIs. Based on this GitHub comment, it also sounds like the App Config team's preferred approach is to manage key-values through the service's data plane APIs instead. Those APIs are documented here.
Also, apparently very recently, the App Config team released support for setting key-values via ARM templates (ref). The above GitHub comment is part of a PR that is supposed to expose the relevant management APIs that ARM would use. However, it looks like what is scheduled for release won't support the complete lifecycle for a Terraform resource (namely, you can't delete a key-value through any of the soon-to-be-released management APIs). So even though some APIs will get exposed through ARM for setting key-values, it may be better for use the data plane APIs for the proposed resource.

Closing comment (2020-09-03T15:06:56Z): @mvromer actually taking a look through here this is a duplicate of #5840 - mind if we consolidate this issue into that one / subscribing to that one for updates?