Solution Secrets extension for Visual Studio

Solution Secrets extension for Visual Studio

As already mentioned in my previous post, as a good practices, secrets (sensitive data like passwords, connection strings, access keys, etc.) must not be committed with your code in any case and must not be deployed with the apps. That's why we must use the User Secrets Manager feature in Visual Studio that let us store secrets out of the solution folder. The User Secrets Manager hides implementation details, but essentially it stores secrets in files located in the workstation's user profile folder.

This extension adds some new features to the secrets management for the entire solution. The capabilities of this extension are accessible trough the Solution Context Menu:

image.png

Features

  • Solution secrets synchronization across user's development workstations.
  • Deletion of user secrets for when you need to dismiss secrets from a development workstation.

image.png

Why this extension?

When you change your development workstation usually you clone your project code from a remote repository and then you would like to be up and running for developing and testing your code in a matter of seconds.

But if you have managed secrets with the tool User Secrets Manager you will not be immediatly able to test your code because you will miss something very important on your new workstation: the secret settings that let your code work.

Using the Solution Secrets extension you can be immediatley ready to start developing and testing on the new workstation or you can just sync secrets between different workstations.

Secrets synchronization

The synchronization is implemented through a cloud repository that in this case is GitHub Gist. The secrets are encrypted and pushed on GitHub in a secret Gist, so that only you can see them.

image.png

The encryption key is generated from a passphrase or a key file. Once you change the development workstation, you don't have to copy any file from the old one. Just install the extension, recreate the encryption key with your passphrase or your key file, authorize access to GitHub Gists and you are ready.

image.png

Cross platform secrets sharing

Sharing secrets between Windows, macOS and Linux is possible thanks to the .NET tool Visual Studio Solution Secrets. The tool is cross platform and since it shares settings and format with this extension, is possible to push secrets from Windows using the Solution Secrets extension and pulling the secrets from macOS or Linux using the CLI tool.


Download from the Visual Studio Marketplace


Solution Secrets extension is free and open source and its code is available on GitHub.