Overview
Azure Functions HTTP triggers let you invoke functions via HTTP requests, enabling you to build serverless APIs and respond to webhooks. When you deploy an HTTP-triggered Function App, the Azure Functions host discovers your functions, registers their routes, and begins listening for incoming requests.
An HTTP 404 (Not Found) error occurs when an incoming request does not match any registered function route. When this happens, you may see one or more of these symptoms:
- HTTP requests to your function return 404 Not Found
- The function URL that previously worked now returns 404 after a deployment or configuration change
- Functions are visible in the Azure Portal but calling them returns 404
- Functions work locally via Azure Functions Core Tools but return 404 in Azure
- The Azure Portal's "Get Function URL" produces a URL that returns 404
- Only some functions return 404 while others work fine
- 404 occurs intermittently — during cold starts or after idle periods
This issue can be especially frustrating because the function app appears healthy, the portal shows the function exists, and there is no obvious error. In this blog, we will explore how HTTP routing works internally, what can cause a 404, and — most importantly — how to systematically diagnose and resolve the problem.
Understanding How HTTP Routing Works
Before diving into troubleshooting, it is important to understand how the Functions runtime matches an incoming HTTP request to a specific function.
Request Processing Pipeline
When an HTTP request arrives at your Function App, it passes through a middleware pipeline before reaching your function code:
Incoming HTTP Request
→ ASP.NET Core Middleware Pipeline
→ HostAvailabilityCheckMiddleware (is the host Running?)
→ If host is NOT Running → 503 "Function host is not running"
→ If host IS Running → continue
→ HomepageMiddleware (handles root "/" requests only)
→ HttpThrottleMiddleware (applies concurrency limits)
→ FunctionInvocationMiddleware
→ Check IFunctionExecutionFeature on HttpContext
→ If matched function found → Execute function → Return response
→ If matched but descriptor is null → 404 Not Found
→ If matched but function is disabled → 404 Not Found
→ HTTP Binding Route Matching (ASP.NET Core routing)
→ Match request path against registered function routes
→ If match → set IFunctionExecutionFeature → invoke function
→ If no match → fall through to MVC controllers (admin APIs)
→ If no controller match → default response
Route Registration
When the Functions host reaches the Running state, it registers routes for all discovered HTTP-triggered functions. The host logs each registered route:
Initializing function HTTP routes
Mapped function route 'api/HttpTrigger1' [get,post] to 'HttpTrigger1'
Mapped function route 'api/products/{category}/{id}' [get] to 'GetProduct'
If no HTTP functions are found, the host logs:
No HTTP routes mapped
The default URL format for an HTTP-triggered function is:
https://<APP_NAME>.azurewebsites.net/api/<FUNCTION_NAME>
This format is composed of three parts:
| Part | Source | Default |
|---|---|---|
| Base URL | Your Function App's hostname | <app-name>.azurewebsites.net |
| Route prefix | extensions.http.routePrefix in host.json | api |
| Function route | Route property on HttpTriggerAttribute, or function name if Route is null | Function name |
Key Settings That Affect HTTP Routing
| Setting | Location | Effect |
|---|---|---|
| extensions.http.routePrefix | host.json | Prefix applied to all function routes. Default is "api". Set to "" to remove. |
| Route | HttpTriggerAttribute / function.json | Per-function route template. Defaults to the function name if not specified. |
| Methods | HttpTriggerAttribute / function.json | HTTP method filter (GET, POST, etc.). If not specified, all methods are accepted. |
| AuthLevel | HttpTriggerAttribute / function.json | anonymous, function, or admin. Determines access key requirements. |
| FUNCTIONS_WORKER_RUNTIME | App Settings | Specifies the language runtime. Must match deployed code for functions to be discovered. |
404 Error Categories
| Category | Typical Symptoms | Root Cause Area |
|---|---|---|
| Route Mismatch | 404 for a specific URL, other functions work | Wrong URL, routePrefix, custom route |
| Function Not Discovered | 404 for all functions, portal shows none | Deployment issue, worker runtime mismatch |
| Function Disabled | 404 for specific function, others work | Function explicitly disabled |
| HTTP Method Mismatch | 404 for POST but GET works (or vice versa) | Methods filter on trigger attribute |
| Deployment/Packaging | 404 after deployment, worked before | Missing files, wrong package structure |
| Networking/Proxy | 404 from external clients, works internally | Reverse proxy, path rewriting, APIM |
| Cold Start / Specialization | Intermittent 404 during scale events | Consumption plan cold start timing |
Common Causes and Solutions
The Azure Function HTTP trigger 404 error can occur due to various reasons, including:
Incorrect Function Name or URL Path
One of the common causes of the Azure Function HTTP trigger 404 error is an incorrect function name or URL path. The function name and URL path should match the values specified in the function code and function.json file. Any mismatch in the function name or URL path can result in a 404 error. This could be due to a typo in the URL.
To solve this issue, navigate to one of your HTTP-triggered functions in the Azure portal and select Get function URL.
Another scenario where you might encounter a 404 error despite using the correct URL and function name could be related to the ROUTE property.
Example:
Suppose you have an Azure Function HTTP trigger with the following function code:
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", Route = "hello")] HttpRequest req,
ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");
return new OkObjectResult("Hello, World!");
}
By default, when you create a function for an HTTP trigger, the function is addressable with a route of the form:
http://<APP_NAME>.azurewebsites.net/api/<FUNCTION_NAME>
In the function code above, the HTTP trigger is configured to respond to a GET request with the URL path "/hello". However, if you try to access the function with a different URL path, such as "/world", you will receive a 404 error.
One more example is, the following function.json file defines a route property for an HTTP trigger with two parameters, category and id:
{
"bindings": [
{
"type": "httpTrigger",
"name": "req",
"direction": "in",
"methods": [
"get"
],
"route": "products/{category:alpha}/{id:int?}"
},
{
"type": "http",
"name": "res",
"direction": "out"
}
]
}
Using this configuration, the function is now addressable with the following route instead of the original route.
http://<APP_NAME>.azurewebsites.net/api/products/electronics/123
Accessing default URL will result 404.
Refer: Customize the HTTP endpoint
Invalid Request Method
The Azure Function HTTP trigger supports only certain HTTP methods, including GET, POST, PUT, DELETE, and PATCH. If you use an invalid HTTP method in your request, the function will return a 404 error.
HTTP Methods property in azure function is “An array of the HTTP methods to which the function responds. If not specified, the function responds to all HTTP methods.”
You must specify the http method at the time of calling http function.
Suppose you have an Azure Function HTTP trigger that only supports POST requests. If you try to access the function with a GET request, you will receive a 404 error. Same explained in below example.
Http trigger supports only POST method,
Getting 404 when called through browser via GET request.
Http Trigger function is disabled.
Calling a disabled http trigger function will result 404 therefore check if function is disabled or not before calling it.
Refer: Disabled Function
Similar to this if you have functions property in host.json which describes a list of functions that the job host runs (An empty array means run all functions.) and you are calling a function which is not listed inside this will result in 404 error.
{
"functions": [ "function1", "function2" ]
}
Custom response from code
Here's an example of an HTTP trigger function in C# that returns a 404 error if the name parameter is missing:
public static class HelloWorld
{
[FunctionName("HelloWorld")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req)
{
string name = req.Query["name"];
if (string.IsNullOrEmpty(name))
{
return new NotFoundResult();
}
return new OkObjectResult($"Hello, {name}");
}
}
If the name parameter is missing, this function will return a 404 error with the message "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."
Please validate the code if it is explicitly returning a 404 error.
Diagnose and solve problems
When you’re running a function app, you want to be prepared for any issues that may arise, from 404 errors to trigger failures.
Azure Functions diagnostics is an intelligent and interactive experience to help you troubleshoot your function app with no configuration or extra cost. When you do run into issues with your function app, Azure Functions diagnostics points out what’s wrong.
It guides you to the right information to more easily and quickly troubleshoot and resolve the issue.
- Navigate to your function app in the Azure portal.
- Select Diagnose and solve problems to open Azure Functions diagnostics.
- Choose a category that best describes the issue of your function app, like in current case it is "HTTP 4XX Errors"
This will not only display information about HTTP 404 error, but also list down details for other 4XX HTTP errors, such as:
- 400 Bad Request
- 401 Unauthorized
- 403 Forbidden
Note: If you have set an authorization level other than "anonymous," you need to specify the function access key in the URL.
Example: https://<APP_NAME>.azurewebsites.net/api/<FUNCTION_NAME>?code=<API_KEY>
If you specify the wrong access key, you may expect a 404 error because it forms an incorrect URL. However, it actually returns a 401 error, indicating that you are unauthorized to access the requested resource.
Quick Troubleshooting Checklist
Use this checklist to systematically diagnose HTTP trigger 404 errors:
- [ ] Host status: Check /admin/host/status — is the state Running?
- [ ] Functions discovered: Check /admin/functions — is your function listed?
- [ ] URL correctness: Does your request URL match <routePrefix>/<route> exactly?
- [ ] Route prefix: Check extensions.http.routePrefix in host.json — is it what you expect?
- [ ] Custom route: If using Route on the trigger attribute, does the URL match the route template?
- [ ] HTTP method: Does the HTTP method match the Methods filter on the trigger?
- [ ] Function disabled: Is AzureWebJobs.<FunctionName>.Disabled set to true?
- [ ] Worker runtime: Does FUNCTIONS_WORKER_RUNTIME match the deployed code?
- [ ] Deployment: Did the latest deployment succeed? Is host.json present at the site root?
- [ ] Startup errors: Check Application Insights for exceptions during host startup.
- [ ] Offline file: Is app_offline.htm present in site/wwwroot?
- [ ] Proxy/APIM: If using a reverse proxy, is the forwarded path correct?
- [ ] Diagnose and Solve: Have you run the built-in detectors in the Azure Portal?
Conclusion
An HTTP 404 from an Azure Function App almost always means the incoming request path does not match any registered function route. The key to efficient troubleshooting is determining why the route is not matched:
Key Takeaways:
- Verify the URL first — Check the route prefix, function name or custom route, and HTTP method. Most 404 errors are caused by an incorrect URL.
- Check if functions are discovered — Use /admin/functions to verify your functions are loaded. If empty, the issue is function discovery, not routing.
- Check host state — If the host is not Running, resolve the startup issue first. A 404 is just a symptom of a deeper problem.
- Review route registration logs — The "Mapped function route..." log entries tell you exactly what routes are available. Compare against your request URL.
- Watch for disabled functions — Disabled functions return 404 to non-admin callers without any error message.
- Apply one fix at a time — Change one setting, restart, and recheck. Avoid multiple simultaneous changes that obscure which fix resolved the issue.
If you continue to experience 404 errors after following these steps, consider opening a support ticket with Microsoft Azure Support, providing:
- Function App name and resource group
- The exact request URL, HTTP method, and headers used
- Timestamp of the 404 occurrence
- Host status endpoint response (copy the full JSON)
- Application Insights query results showing the 404 and any startup errors
- host.json content (especially routePrefix and function routes)
- Recent deployment or configuration changes
References
- Azure Functions HTTP trigger
- Azure Functions HTTP triggers and bindings overview — host.json settings
- Customize the HTTP endpoint
- Azure Functions app settings reference
- Azure Functions host.json reference
- Azure Functions deployment technologies
- Azure Functions networking options
- Azure Functions diagnostics
- Azure Functions Admin API (host status)
- Azure Functions scale and hosting
- Run your functions from a deployment package
- How to Troubleshoot Azure Functions Host Startup Issue
Have questions or feedback? Leave a comment below.