0
votes

I would like to add rewrite URL code on azure web app's web.config without redeploying the whole app again. for this I am using 'app service editor' and 'kudu- debug console' for editing the web.config, first I cant save the file and gives me error. enter image description here

after some search I found that under APP SETTING KEY value should be 0 instead 1

enter image description here

edited the value 1 to 0 and save the APP SETTING KEY, after that I am able to edited the config file, in order to test the code again I changed the value 0 to 1 and save the setting. but when I refresh the file which is opened in editor or kudu the pasted code disappeared, the site is connected with automatic azure deployment pipeline

How I can edited the web.config file without redeploying the app again.
1
Would you consider using other deploy method like web deploy, zip deploy instead of run from package? It's possible to do what you want, but the workaround is a bit complex. So I think a redeployment would be better if you don't have specific reason to avoid redeploying... (PS: I'll post my detailed workaround later for you)LoLance
Details workaround updated, feel free to let me know if you meet any issue when trying my workaround. PS: 1. My workaround doesn't require any changes to the wwwroot, so we don't need to change the value of xxx to 0 to make wwwroot editable. 2.After all changes, you may need to restart the app service. (Not necessary, but recommended~)LoLance
Yes exactly workaround is bit strange and complex, so I would go the option-- deployment method 'WebDeploy' instead Zip Package in azure release pipeline taskSaad Awan

1 Answers

1
votes

Yes, it's possible to make changes without redeploying the app.

Some details:

Check Run the package document and we can find:

1.The zip package won't be extracted to D:\home\site\wwwroot, instead it will be uploaded directly to D:\home\data\SitePackages.

2.A packagename.txt which contains the name of the ZIP package to load at runtime will be created in the same directory.

3.App Service mounts the uploaded package as the read-only wwwroot directory and runs the app directly from that mounted directory. (That's why we can't edit the read-only wwwroot directory directly)

So my workaround is:

1.Navigate to D:\home\data\SitePackages in via kudu- debug console:

enter image description here

Download the zip(In my case it's 20200929072235.zip) which represents your deployed app, extract this zip file and do some changes to web.config file.

enter image description here

2.Zip those files(choose those files and right-click...) into a childtest.zip, please follow my steps carefully here!!! The folder structure of Run-from-package is a bit strange!!!

enter image description here

3.Then zip the childtest.zip into parenttest.zip(When uploading the xx.zip, the kudu always automatically extra them. So we have to zip the childtest.zip into parenttest.zip first)

enter image description here

4.Drag and drop local parenttest.zip into online SitePackages folder in kudu-debug console and we can get a childtest.zip now:

enter image description here

5.Modify the packagename.txt, change the content from 20200929072235.zip to childtest.zip and Save:

enter image description here

Done~

Check and test:

Now let's open App Service Editor to check the changes:

enter image description here

In addition: Though it answers the original question, I recommend using other deployment methods(web deploy...) as a workaround. It could be much easier~