use Environment variable in project setting

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
timyeung
User
Posts: 8

use Environment variable in project setting

Post by timyeung »

is it a way to remove the database-credential used in the project file in the final code generated?

As the code will be deployed in Cloud, secret shouldn't be placed inside the code. One way to go is to take it from environment variable.
even I use database_connecting() to compose the final connection string from environment variable, the credential used in project is still in the code published.

When config a project database connection credential, is it possible add one more text-box and allow entering environment variable that to be put in the code? the plaintext password in project file will not be put inside the code generated.

The final code will both locally and in Cloud, and contains no database-password.


MichaelG
User
Posts: 1111

Post by MichaelG »

The database credentials are generated in appsettings.json. You can simply clear the settings there and use the Database_Connecting server event to load the credentials from wherever you want.

Another option is to use Tools -> Advanced Settings -> Encrypt user names and passwords so the credentials are stored encrypted.


Post Reply