【发布时间】:2016-11-02 20:50:18
【问题描述】:
我需要能够在已部署的 Azure Web 应用中修改 appsettings.json 中的设置。
我可以通过以下命令通过 PowerShell 访问 AppConfig 和 Connectionstrings:
$webApp = Get-AzureRmWebApp -ResourceGroupName $resourceGroupName -Name $websiteName
$webApp.SiteConfig.AppSettings
$webApp.SiteConfig.ConnectionStrings
但是,是否可以通过 PowerShell 访问 appsettings.json?
【问题讨论】:
-
你可以,但是你会读/写一个文件,这是你的部署的一部分。您确定要这样做吗,不建议采用最佳做法?我不完全确定您要做什么,但我想不出有什么好的理由让脚本在部署后更新静态配置文件。如果您能告诉我们用例是什么,或许我们可以建议一种更好的方法来实现您的目标。
标签: .net azure asp.net-core azure-powershell