azure - 如何使用 Azure Powershell 更新 Azure 云服务设置

标签 azure azure-web-roles

是否可以使用 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/

相关文章:

azure - 如何将数据源中for_each循环的key传递给资源配置?

azure - 对 Azure 存储的 RBAC 访问 - 预览角色未按预期运行

sql - 执行查询失败。错误 : String or binary data would be truncated in table xdbo. user_info',列 'uid'

azure - Azure WebRole OnStart 方法中的等待/ sleep

asp.net-mvc-3 - Azure 中的 MVC3 EF 应用程序,为什么我必须每隔一段时间预热一次?

sql-server - SQL Azure/EF Code First - 用户登录失败 'myUserName'

azure - 如何通过terraform将本地文件复制到azure vm?

c# - 如何在Windows Azure中有效扩展?

azure - 构建具有多个角色的 Azure 解决方案

azure - Windows Azure 中的 Web 角色缩放