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.
after some search I found that under APP SETTING KEY value should be 0 instead 1
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.
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
:
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.
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!!!
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)
4.Drag and drop local parenttest.zip
into online SitePackages
folder in kudu-debug console
and we can get a childtest.zip
now:
5.Modify the packagename.txt
, change the content from 20200929072235.zip
to childtest.zip
and Save:
Done~
Check and test:
Now let's open App Service Editor
to check the changes:
In addition: Though it answers the original question, I recommend using other deployment methods(web deploy...) as a workaround. It could be much easier~