Using Kudu to Edit a Deployed app.settings file

June 13, 2020

When you deploy an Azure App Service, there are occasions when you may need to change the running values. Exactly how you may do this depends heavily on how the service was deployed, and how you are managing your variables. You can typically overwrite variables inside the app service; however, the running appsettings.json and web.config will be deployed with the app, and you can edit these directly (whether you should or not is a different question).

It’s your foot

These instructions let you change the deployed files on your App Service. Doing so may result in the behaviour of the site changing.

On with the show

Launch Kudu

kudu 1

When you select this, you’ll be given the option to select “Go”, or … not. Select “Go”.

This will take you to the Kudu console.

From here, select “CMD”; this will take you to a hybrid screen with a command console and a file navigator:

kudu 2

Navigate to ```

d:\home\site\wwwroot

:

![](images/kudu-3.png)

# Too Many Files

Initially, you may get the following error:

> There are n items in this directory, but maxViewItems is set to 99. You can increase maxViewItems by setting it to a larger value in localStorage.

![](images/kudu-4.png)

To get around this, select F12 and in the console window type:


window.localStorage[‘maxViewItems’] = 1000




![](images/kudu-5.png)

After you've changed this, refresh the page (F5).

# App Settings

To change the variables, you'll need to locate the ``` 

appsettings.json

in the list (it’s alpha-numerically sorted, so it should be near the top). (Unfortunately, you can’t edit this from the command line).

When you find the file, click the edit button:

kudu 6

And then change the file:

kudu 7

When done, select Save and then restart the app service.

References

https://www.poppastring.com/blog/kudu-error-with-maxviewitems-in-localstorage



Profile picture

A blog about one man's journey through code… and some pictures of the Peak District
Twitter

© Paul Michaels 2024