Hafiz Hamza
Hafiz Hamza

Reputation: 33

What is the alternate of web.config file in asp.net core

I am started working on asp.net core web application and there is no web.config file in this project. Here is appsettings.json file though. I don't know where to store confidential information (like we store username and passwords of domain in web.config file in .Net Framework). Is it safe to Store confidential data in appsettins.json file?

Upvotes: 3

Views: 1576

Answers (1)

marcusturewicz
marcusturewicz

Reputation: 2494

Yes appsettings.json is like web.config for ASP.NET Core. It’s for storing non secretive data. But there are multiple ways to configure your app, e.g. environment variables, command line arguments, as well as appsettings.json. You can also configure each environment with this file.

You should not store secrets like usernames, passwords or API keys here, as this file gets checked into source control and you might leak these to other parties. You can use User Secrets (only in development) or Azure Key Vault for secretive settings.

This is a big topic so it’s better to check the docs on this, and see which provider(s) works best for your scenario.

Upvotes: 3

Related Questions