'How to access the secrets, keys from azure keyvault in app-configmap.yaml file

I have created AKS based application deployment where all the environment variables of application are defined in app-configmap.yaml file. This file is refered in deployment.yaml file. I would like to store all the credentials those are mentioned in app-configmap.yaml file as environment variable into secrets in keyvault and finally from keyvault , it will be refered in app-configmap.yaml file. I need help to understand it step by step by which I can implement it



Solution 1:[1]

In general I would not recommend to use secrets as environment variables or with configmaps.

With the AZURE KEY VAULT PROVIDER FOR SECRETS STORE CSI DRIVER you should use the secrets as file mounts inside the pod that really needs the secret. With this you can also rotate secrets on-demand or sync own TLS certs etc.

Pro is you dont need AAD-Pod-Identity bcs the CSI handles auth on its own.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Philip Welz