是否可以使用 Azure Powershell 更新 Azure 云服务中的设置值?
最佳答案
到目前为止,还没有办法只更新单个设置(服务管理 API 不允许 - 它只接受整个服务配置)。因此,为了更新单个设置,您必须更新整个配置。您可以使用 PowerShell 执行此操作:
# Add the Azure Account first - this will create a login promppt
Add-AzureAccount
# when you have more then one subscription - you have explicitly select the one
# which holds your cloud service you want to update
Select-AzureSubscription "<Subscription name with spaces goes here>"
# then Update the configuration for the cloud service
Set-AzureDeployment -Config -ServiceName "<cloud_service_name_goes_here>" `
-Configuration "D:/tmp/cloud/ServiceConfiguration.Cloud.cscfg" `
-Slot "Production"
对于“-Configuration”参数,我提供了我想要与云服务一起使用的新配置文件的完整本地路径。
这是经过验证且有效的解决方案。
关于azure - 如何使用 Azure Powershell 更新 Azure 云服务设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26611660/