简体   繁体   中英

Azure Cloud Service deployment without changing existing configuration

Is it possible to deploy a Cloud Service without changing existing configuration?

What i want to do is to deploy a Cloud Service package to the Dev Cloud Service and then take the same package and upload it to the Production Cloud Service.

Any Ideas?

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.

Rather late to this one:

There is now a "Download" button on the "Configure" tab for your cloud service: 在此输入图像描述

This will generate a ServiceConfiguration.cscfg file that contains the currently configured editable settings, as well as any non-editable settings that were originally included.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM