Share via

What should I change in my host.json in my Azure Functions project so that I can use it in production?

Kim Strasser 2,286 Reputation points
2026-03-31T19:41:56.8666667+00:00

I use the following host.json file in my Azure Functions project in debug mode:

{
  "version": "2.0",
  "extensions": {
    "http": {
      "routePrefix": "api"
    }
  },
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request,Trace"
      }
    },
    "logLevel": {
      "default": "Information"     
    }   
  } 
}

Now I want to change the host.json file so that I can use it in my Azure Functions project when I will submit my game in the Apple App Store and Google Play Store for app review.

I have already changed the logLevel to Warning. What else should I change in my host.json before I can use it with a game that I will publish in the store?

I have two different Azure Function projects in Azure Portal, one for debug and one for production.

Production host.json:

{
  "version": "2.0",
  "extensions": {
    "http": {
      "routePrefix": "api"
    }
  },
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request,Trace"
      }
    },
    "logLevel": {
      "default": "Warning"     
     }   
   }   
}
Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.


Answer accepted by question author
  1. Pravallika KV 12,575 Reputation points Microsoft External Staff Moderator
    2026-03-31T20:01:51.2366667+00:00

    Hi @Kim Strasser ,

    Thanks for reaching out to Microsoft Q&A.

    For mobile apps, ensure that your functions respond quickly; long-running functions can cause client timeouts.

    • In host.json, you can set a timeout for HTTP functions:
    "functionTimeout": "00:05:00"  
    
    • If you are using premium or dedicated plan, you can allow longer timeouts. For consumption plan, max is 5 minutes.

    Consider enabling CORS via the Azure Function App settings or via host.json

    You can add maxOutstandingRequests and maxConcurrentRequests which helps throttle and prevent your Function from being overwhelmed if your game suddenly has high traffic, refer MSDOC.

    host.json:

    {
      "version": "2.0",
      "extensions": {
        "http": {
          "routePrefix": "api",
          "maxOutstandingRequests": 200,
          "maxConcurrentRequests": 100
        }
      },
      "logging": {
        "applicationInsights": {
          "samplingSettings": {
            "isEnabled": true,
            "excludedTypes": "Trace"
          }
        },
        "logLevel": {
          "default": "Warning"
        }
      },
      "functionTimeout": "00:05:00"
    }
    

    Hope this helps!


    If the resolution was helpful, kindly take a moment to click on User's imageand click on Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Q&A Assist
    2026-03-31T19:42:12.1666667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    For a production Azure Functions app, the main change in host.json is to reduce logging verbosity and ensure Application Insights sampling is configured appropriately. The production host.json shown is already aligned with recommended guidance.

    Key points based on current configuration:

    1. version is correct
         "version": "2.0"
      
      This is required for Functions v2.x+ and is valid for production.
    2. Log level is appropriate for production
         "logging": {
           "logLevel": {
             "default": "Warning"
           }
         }
      
      Using Warning as the default is explicitly recommended to avoid excessive logging while still capturing important issues.
    3. Application Insights sampling is enabled
         "applicationInsights": {
           "samplingSettings": {
             "isEnabled": true,
             "excludedTypes": "Request,Trace"
           }
         }
      
      Sampling is enabled (isEnabled: true), which is appropriate for production to control telemetry volume. Excluding Request from sampling is a documented pattern when all requests must be visible in monitoring.
    4. No additional mandatory changes for store submission There is nothing in host.json that must be changed specifically for Apple App Store or Google Play Store review. Store submission requirements are independent of Azure Functions logging configuration.

    Optional production refinements (not required, but available if needed):

    • If telemetry volume is still high, adjust Application Insights sampling settings (for example, maxTelemetryItemsPerSecond, initialSamplingPercentage, or excludedTypes/includedTypes) as documented under applicationInsights.samplingSettings.
    • If specific categories need different log levels (for example, function-level overrides), extend logging.logLevel with entries like "Function": "Information" while keeping default at Warning.
    • If a quick logging change is needed in production without redeploying, override host.json values via app settings using the AzureFunctionsJobHost__... pattern, as described in the monitoring configuration guidance.

    Given the context, the production host.json provided is already suitable for a production Azure Functions app backing a published game.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.