本文介绍了是否可以编辑部署在Windows Azure云应用程序的web.config文件而无需重新部署我的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能的修改 的web.config 部署在Windows Azure上我的云应用程序的文件,而无需重新部署我的应用程序?

Is it possible to edit web.config file of my cloud app deployed on Windows Azure without redeploying my app ?

情景就像是 - >


  1. 云应用部署在Azure上有3个实例。

  2. 的web.config 有一些静态文本的 appsetting 这是在主页上持续显示(例如 - 保留的©2009我的网站所有权利。

  3. 现在,我想从 2009年 Web.Config中提到,静态文本更改为 2010

  4. 现在,我想修改 的Web.Config 无需重新部署我的网站。

  5. 我不希望 - >在新股套利与部署我的应用程序更新的的Web.Config ,然后用其交换生产

  1. Cloud app is deployed on Azure with 3 instances.
  2. web.config has some static text in appsetting which is displyed on the Home Page(for example - © 2009 My site. All rights reserved)
  3. Now I wish to change that static text mentioned in Web.Config from 2009 to 2010.
  4. Now I wish to edit Web.Config without redeploying my site.
  5. I do not wish to --> deploy my app on stagging with updated Web.Config and then swap it with production.

有什么诀窍更新包从部署在运行时文件?

Is there any trick to update the files from package deployed at runtime ?

推荐答案

在此回答下面的意见根据马克西姆现在已经过时了。

According Maxim in the comments below this answer is now out of date.

您可以通过编程修改Web角色的web.config设置中使用Microsoft.Web.Administration.ServerManager库的OnStart事件。

You can programmatically modify the web.config settings of a web role in the OnStart event using the Microsoft.Web.Administration.ServerManager library.

* 的离开原来的答案,因为它是在时间和为正确,我没有因为回答这个问题使用Azure的,我不是100%确定有效的答案。

* leaving the original answer as it was correct at the time and as, I have not used Azure since answering this question, and I am not 100% sure of the valid answer.

在一个字没有。

您必须使用服务配置文件来完成这些设置。

You must use the service configuration file for such settings.

要决定是否将钥匙在服务配置设置与Web配置设置。

To decide on whether to place keys in the service configuration settings versus web configuration settings.

您可以问自己以下问题:

You could ask yourself the following questions:

是否与每个部署此设置的变化?如果是这样那么的网站的配置设置是此信息的正确位置。

Does this setting change with every deployment? If so then the web configuration settings is the correct place for this information.

将在部署后,该设置的变化?如果是这样那么的服务的配置设置是此信息的正确位置。

Will this setting change after deployment? If so then the service configuration settings is the correct place for this information.

在Web.config文件的部署包的一部分,因此是只读的,当部署到Azure中,以更新,您将需要重新部署的设置。

The Web.config file is part of the deployment package and so is read-only when deployed to Azure, in order to update the settings you will need to redeploy.

而服务配置文件上传的,但不与,部署包包装的,因此,你可以上传或编辑文件,而不用重新部署服务。

Whereas the service configuration file is uploaded with, but not packaged with, the deployment package, and therefore you can upload or edit the file without redeploying your service.

这篇关于是否可以编辑部署在Windows Azure云应用程序的web.config文件而无需重新部署我的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 09:18