【发布时间】:2020-10-14 23:20:33
【问题描述】:
我的 asp.net 核心 MVC Web 应用程序中有以下 appsettings.json:-
{
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\ProjectsV13;Database=LandingPage;Trusted_Connection=True;"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"SMTP": {"
"pass": "************"
}
}
我在哪里存储 smtp 密码 + 当我将应用程序发布到共享主机提供商时,我将在 appsettings.json 的连接字符串中添加一个 sql server 用户名和密码。
所以我的问题是如何加密我的appsettings.json 内托管在 IIS 内的远程共享托管服务提供商内的部分?我可以将密码保存在 Visual Studio 项目中,但我想加密托管的 appsettings.json?这可能吗?
谢谢
【问题讨论】:
-
Similar Question 在 SO
-
@शेखर 感谢您的链接,但它没有提到我们如何加密 appsettings.json 的部分
标签: asp.net asp.net-core iis encryption asp.net-core-mvc