5

是否可以在不更改现有配置的情况下部署云服务?

我想要做的是将云服务包部署到开发云服务,然后获取相同的包并将其上传到生产云服务。

有任何想法吗?

4

2 回答 2

0

If I understand the question correctly, yes this is possible. All the configuration settings that you'd like to be different between the two environments (like connection strings, app settings, etc.) should be defined in the Service Definition file and set in the service configuration file. When Visual Studio uploads the package it uploads the package and service configuration file separately (the service definition is inside the package). When you do an update or deployment from the command line or from the portal you provide the package and service configuration file separately as well. This allows you to push the same package, but provide different configuration. If you don't have any differences between the deployments, which would be rare I would think, you just deploy the same package and configuration file.

If you are performing an update to the production system and you don't want to "override" the configuration that is already there for production you just need to upload the same file you previouly uploaded. This is why it is important to keep track of all your deployments over time, for rollback purposes or for something like this where you want to push up the same configuration as before.

The MSDN Documentation covers how to upload from the portal, which includes selecting the configuration file separately: https://www.windowsazure.com/en-us/manage/services/cloud-services/how-to-create-and-deploy-a-cloud-service/#deploy. You may also want to look at doing this via a command line tool like powerShell or the other Windows Azure CLI tools.

Note, that if you have settings that are in the web.config or app.config of a web role that must be different per environment, you will need to research a way to move those settings either into the service configuration or at runtime pull them for a specific location based on environment.

于 2013-08-26T12:32:05.927 回答
0

这个比较晚:

现在,您的云服务的“配置”选项卡上有一个“下载”按钮: 在此处输入图像描述

这将生成一个 ServiceConfiguration.cscfg 文件,其中包含当前配置的可编辑设置,以及最初包含的任何不可编辑设置。

于 2015-07-02T15:02:22.680 回答