Editing Application Host File (host.json) in Azure Portal
    • Dark
      Light
    • PDF

    Editing Application Host File (host.json) in Azure Portal

    • Dark
      Light
    • PDF

    Article Summary

    #ServerlessTips - Azure Functions
    Author: Rahul Rai Microsoft MVP

    The host.json file contains the configuration values affecting all functions in a function app. As soon as we add an Azure Function project, this file is created with at least one field indicating the runtime version of Azure Functions. You can find out more about the features of the hosts.json file from the Azure Functions documentation.

    You can edit the host.json file from the App Service Editor in Azure Portal to test changes quickly without republishing the function app. However, it is essential to note that the App Service Editor should only be used for non-production applications. For production deployments, you should use CI/CD pipelines.

    Here are the steps you need to follow to edit the host.json configuration file for an Azure Function App:

    1. Open the Azure Function App in the Azure Portal.

    2. Under the Development Tools section in the options menu, select the App Service Editor option, then click the Open Editor link to launch the App Service Editor.

    MicrosoftTeams-image 511

    Figure 1: Select the App Service Editor option.

    1. You will be taken to the App Service Editor in a new browser tab, which has the familiar interface of Visual Studio Code.

    2. The host.json file is located underneath the WWWROOT directory within the app. The file contains the details of the platform version and, in some cases, the extension bundle installed in the function app.

    MicrosoftTeams-image 521

    Figure 2: Application host file in App Service Editor

    It is essential to know that the editor will automatically save changes to the hosts.json file. If you are making changes to a production application, you must be extremely careful since typos or misconfigurations can cause the application to go down.

    MicrosoftTeams-image 491


    Was this article helpful?