Change HomePage Azure Function .NET : Your Functions 4.0 app is up and running
I have some panic when I search from the internet to see how can we change the home page of Azure Function under .NET. In this post I will help you easy to change it some config and setting . You can change it by modifying the content using the host.json. You need to add "extensions": { "http": { "routePrefix": "" } } in your host.json, Example : { "version": "2.0", "logging": { "applicationInsights": { "samplingSettings": { "isEnabled": true, "excludedTypes": "Request" }, "enableLiveMetricsFilters": true } }, "extensions": { "http": { "routePrefix": "" } } } And now, you need to define a function return the home page information, in this example we will return the home page with result Hello from Azure Function! [Function("RootFunction")] public IActionResult Run( [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "{ignored:maxlength(0)?}")] HttpRequest req, string ignored = "") { _logger.LogInformation($"C# HTTP trigger function processed a request."); return new OkObjectResult("Hello from Azure Function!"); } Now when you look back after deployment, you can see the result. Enjoy ! Reference https://stackoverflow.com/questions/67180247/azure-functions-serving-content-for-root-url/76419027#76419027

I have some panic when I search from the internet to see how can we change the home page of Azure Function under .NET. In this post I will help you easy to change it some config and setting .
You can change it by modifying the content using the host.json
.
You need to add "extensions": { "http": { "routePrefix": "" } } in your host.json, Example :
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
},
"enableLiveMetricsFilters": true
}
},
"extensions": { "http": { "routePrefix": "" } }
}
And now, you need to define a function return the home page information, in this example we will return the home page with result Hello from Azure Function!
[Function("RootFunction")]
public IActionResult Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "get",
Route = "{ignored:maxlength(0)?}")]
HttpRequest req,
string ignored = "")
{
_logger.LogInformation($"C# HTTP trigger function processed a request.");
return new OkObjectResult("Hello from Azure Function!");
}
Now when you look back after deployment, you can see the result.
Enjoy !