Reputation: 23
my connection string in user secret No problem at local but is publish and upload in server error
ArgumentNullException: Value cannot be null. (Parameter 'connectionString')
Upvotes: 1
Views: 1879
Reputation: 168
User secrets are not uploaded to azure, so you need to manually add them if you want to use.
If any confusion, please comment.
Upvotes: 0
Reputation: 11
User secrets used for development security and it doesn't transfer/publish with your app (to GitHub or to IIS), they are stored in your local profile. If you are looking for securing your credentials & sensitive data the better way is to use Azure Key Vault (see Manage User Secrets)
Upvotes: 0
Reputation: 27588
user secrets is only for development and not intended for production.It doesn't encrypt the stored secrets and stored in a JSON configuration file in the user profile directory.
For production , usually you can use JSON file(appsettings.json/appsettings.{Environment}.json
), environment variables, and Azure Key Vault(which is recommended), please read below article for more details about configuration providers in asp.net core :
Upvotes: 3
Reputation: 690
It seems the connectionStrings section is not yet configured at production machine. So you must store connection strings into Web.config file at production machine.
Connection Strings and Configuration Files
Besides that, you can protect the configuration by encrypt it using protected configuration.
Encrypting Configuration Information Using Protected Configuration
Upvotes: 0