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

前端 未结 5 674
广开言路
广开言路 2020-12-15 15:54

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

Scenario is like--><

5条回答
  •  隐瞒了意图╮
    2020-12-15 16:31

    Yes, this can be done. The steps are:

    1. Use the environment variable 'RdRoleRoot' to find the root of the role.
    2. Look for 'RoleModel.xml' file
    3. Load the 'RoleModel.xml' file and find the entry for your site under "Sites" node
    4. In this entry look for 'physicalDirectory' attribute which is the relative path to the directory containing your web.config file
    5. Combine role root path with this physicalDirectory path to get the full path

    I wrote a blog post http://anuchandy.blogspot.com/2014/02/changing-webconfig-file-deployed-on.html with sample code.

提交回复
热议问题