Updating web.config file for ASP.NET Core apps hosted on a Linux App Service
Published May 23 2022 06:39 AM 1,471 Views
Microsoft

Working with our customers recently, I came across a situation wherein I had to enable stdout logs for an ASP.NET Core application which was hosted on a Linux App Service. For a Windows App Service, we can simply use App Service Editor, to make both static file changes as well as configuration changes.

 

However, for a Linux App Service we do not have this option! With some trial and error, I found two methods which we can use instead.

 

Method 1: Using FTPS

 

This method is one of the most commonly used methods for changing config files for Linux App services :

 

Outlining the steps below:

1. Go to “Deployment Center” for your app service and then select “FTPS credentials” :

 

ParagHurkat_0-1653305613098.png

 

 

2. Open any FTP client like FileZilla or WinSCP and then connect to the aforementioned FTP location (You would have to trust the certificate when the client prompts you). Once connected, you can view the files and go to the specific location where you want to update (web.config is inside the wwwroot folder)

 

Khanita_11-1652896998326.png

 

3. For the specific file you want to edit, Right click and select the “View/Edit” option and open it in the editor of your choice and update it followed by saving the file and as soon as you save it, Your FTP client will ask if you want to upload the updated file, make sure you select yes and upload the updated file.    

 

Khanita_12-1652896998329.png

 

                

Khanita_13-1652896998332.png

 

  

Khanita_14-1652896998333.png

 

 

 

Method 2 : Using the New Kudu Tool (Public Preview version – Kudu Lite)

 

Steps :

1. To open the new Kudu tool, you need to add “/newui” in front of your existing kudu URL. For example :

 

Existing Kudu URL :  https://linuxdotnetcoretest.scm.azurewebsites.net/

New Kudu URL : https://linuxdotnetcoretest.scm.azurewebsites.net/newui

 

It currently looks like this:

 

Khanita_15-1652896998342.png

 

2. Open up the “File Manager” and then download the file you want to edit :

 

Khanita_16-1652896998353.png

3. Update the file and drag and drop it to the exact location to upload it back

 

Khanita_17-1652896998364.png

4. It will show the updated date/time when you upload the file. You can even check if the upload went successful using the old Kudu console:

 

Khanita_18-1652896998370.png

 

 

Khanita_19-1652896998373.png

 

 

And in this particular case, I wanted stdout logs, which I can now access using either the new Kudu Lite or the old Kudu (Bash).

 

I hope this helps you out! Happy Learning!

 

 

Co-Authors
Version history
Last update:
‎May 23 2022 04:35 AM
Updated by:
www.000webhost.com