Client secret and Safe storage

Most of the applications today are using Azure KeyVault to store secrets.

Azure Key Vault is a cloud service for securely storing and accessing secrets. A secret is anything that you want to tightly control access to, such as API keys, passwords, certificates, or cryptographic keys.

Reference: https://docs.microsoft.com/en-us/azure/key-vault/general/basic-concepts#:~:text=Azure%20Key%20Vault%20is%20a,%2C%20certificates%2C%20or%20cryptographic%20keys.

How to configure your local machine

 

https://docs.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-6.0&tabs=windows

  1. Open your Visual Studio > right-click in your project > select the option “Manage User Secrets”
    Note: I created this documentation with Visual Studio 2022

    Note: the secrets are storage on C:\Users\<windowsuser>\AppData\Roaming\Microsoft\UserSecrets. To create a secret by command line, you can use

    dotnet user-secrets set "Movies:ServiceApiKey" "12345"

     

  2. Add this structure and run your project


    Note: If you have this error when you run the project, maybe the structure of the keys is not correct.

 

How to configure pipeline with Azure