Open Corendiel opened 2 years ago
@Corendiel Did you try this:
credentials {
header = {
"x-functions-key" = "{{Named_value_name}}"
}
}
It will automatically add it as a named value reference instead of a string value.
credentials { header = { "x-functions-key" = "{{Named_value_name}}" } }
It will automatically add it as a named value reference instead of a string value.
In case someone stumbles on this issue, you can use string interpolation to reference an azurerm_api_management_named_value resource. Example:
credentials {
header = {
"x-functions-key" = "{{${azurerm_api_management_named_value.example.name}}}"
}
}
@emocibob If we use the below code in the backend credentials { header = { "x-functions-key" = "{{${azurerm_api_management_named_value.example.name}}}" } }
and refer the backend in the api operation , will the named-value secret get added in the function app host key as *"apim-
Community Note
Description
Some Backend configurations are not possible via Terraform. Currently, it only supports a string value and doesn't support the Named Value option. Storing backend credentials in terraform script is not ideal Named Value opens the path to the Key Vault option.
New or Affected Resource(s)
Potential Terraform Configuration
References
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management_backend#header
0000