No, you don't need to redeploy the web app when changes are made to the appsettings.json file. The appsettings.json file is typically read at runtime by the application, so any changes made to it will be picked up by the application without requiring a redeployment.
However, there are a few factors to consider:
-
If you are running the web app in a development environment using a local development server (e.g., Visual Studio's IIS Express), changes to the
appsettings.jsonfile will be automatically detected and applied when you run or refresh the application. -
If you are running the web app in a production environment, such as on a web server or a cloud platform, the behavior may vary. Some hosting platforms may automatically detect changes to the
appsettings.jsonfile and reload the application, while others may require manual application restart or configuration reload. -
Certain settings in the
appsettings.jsonfile, such as database connection strings, may require an application restart for the changes to take effect. In such cases, you may need to restart the application or use configuration mechanisms provided by your hosting platform to reload the updated settings.
It's always a good practice to test the behavior of your application when modifying the appsettings.json file in your specific deployment environment to ensure the changes are applied as expected.