1

If we are using our secrets through authenticating the key vault in our code, we can see the exact value of connection string provided in Secrets while debugging the code, then what are the benefits to store secrets in Azure?

Any help would much appreciated.

Munavvar Husein
  • 549
  • 5
  • 20

1 Answers1

3

If a service requires a shared secret to access, that secret must be visible to your code so it can use it. Naturally if you connect a debugger you can see it as well.

By storing the secrets in Key Vault, they are not available in the hosting environment's configuration (e.g. App Service's app settings). They are also not stored in your version control system. So it helps prevent unwanted access. They'll still be loaded into the app's memory when it gets them from the vault, but that is kind of unavoidable.

To access Key Vault, a good practice is to use Managed Identities in Azure so that you have no secrets in your code/configuration.

juunas
  • 41,356
  • 5
  • 86
  • 118