Description:
Encryption keys ,Certificate thumbprints and Managed Identity Credentials can be coded into the APP service, this renders them visible as part of the configuration, to maintain security of these keys it is better to store in an Azure Keyvault and reference them from the Keyvault.
Rationale:
App secrets control access to the application and thus need to be secured externally to the app configuration, storing the secrets externally and referencing them in the configuration also enables key rotation without having to redeploy the app service.
Impact is primarily during the initial setup of the application or redeploying an old app to include this functionality. This will require configuration effort to setup the keyvault and then to configure the app service to use the keyvault.
In Azure Console -
In Terraform -
References:
https://learn.microsoft.com/en-us/azure/key-vault/
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_certificate
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_key
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/key_vault_secret