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

freeliver54 阅读:305 2025-06-02 22:19:02 评论:0

是否可以使用 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”参数,我提供了我想要与云服务一起使用的新配置文件的完整本地路径。

这是经过验证且有效的解决方案。


标签:Shell
声明

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

关注我们

一个IT知识分享的公众号