【问题标题】:ASP.NET 5 SecretManager Production Values for AzureAzure 的 ASP.NET 5 SecretManager 生产值
【发布时间】:2016-01-02 09:27:51
【问题描述】:

我只是在 ASP.NET 5 中使用SecretManager,不太明白我是如何在 Azure 网站上为生产/暂存环境设置这些值的。

是否有用户界面,我只是将它们作为 AppSettings 添加到 Azure 门户中,还是需要使用 Kudu 调试控制台来设置它们?

谢谢

马特

【问题讨论】:

    标签: asp.net azure asp.net-core azure-web-app-service secret-manager


    【解决方案1】:

    如果你看一下配置 UserSecrets 的代码 -

            if (env.IsDevelopment())
            {
                builder.AddUserSecrets();
            }
    
            builder.AddEnvironmentVariables();
            Configuration = builder.Build();
    

    只要环境处于开发阶段,它就会简单地将 UserSecrets 添加到环境变量集合中。

    所以是的,您需要在部署到 Azure 时将这些机密添加为标准应用程序设置。

    【讨论】:

    • 请注意,所有 Azure 门户应用设置都成为环境变量。因此,在部署到 Azure We Apps 时,您永远不需要将机密存储为文件。
    猜你喜欢
    • 1970-01-01
    • 2016-04-18
    • 1970-01-01
    • 2018-06-10
    • 1970-01-01
    • 1970-01-01
    • 2016-04-28
    • 1970-01-01
    • 2010-12-12
    相关资源
    最近更新 更多