From the course: Managing App Secrets in .NET Core

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Replacing and removing secrets

Replacing and removing secrets - ASP.NET Core Tutorial

From the course: Managing App Secrets in .NET Core

Start my 1-month free trial

Replacing and removing secrets

- [Instructor] When working with app secrets, you might need to update an existing one or even remove if you are not using it anymore. So let us go to our project, and see how we can update an existing secret, or remove it. Here on Visual Studio before we do any operations, let us see all the secrets that we have in our solution. So for that, go to the package manager console, and in here write dotnet user-secrets list, that is right we need to define which project we want to use because in our solution we have two projects. So for that we write in here --project Secrets project. So these are all the secrets that we have in our secrets.json file. Let us say we want to remove the connectionString, because the connectionString doesn't normally need to be in our secrets file. Only the password or the database name. So to remove the connectionString from here write dotnet user-secrets remove and here we need to define the key, and the key for the connectionString is the connectionString…

Contents