Azure Function error on Data Factory , 3608 Error - Call to provided Azure function 'testhttpmohsen' failed with status-'NotFound' and message - 'Invoking Azure function failed with HttpStatusCode - NotFound.'

Mohsen Akhavan 771 Reputation points

I have an Azure function (HTTP Trigger) and run correctly. When I add this function to Azure Data Factory and run Debug, I received this error.


my code is:

import logging  
import azure.functions as func  
def main(req: func.HttpRequest) -> func.HttpResponse:'Python HTTP trigger function processed a request.')  
    name = req.params.get('name')  
    if not name:  
            req_body = req.get_json()  
        except ValueError:  
            name = req_body.get('name')  
    if name:  
        return func.HttpResponse(f"Hello, {name}. This HTTP triggered function executed successfully.")  
        return func.HttpResponse(  
             "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.",  
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,653 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,161 questions
{count} votes

2 answers

Sort by: Most helpful
  1. ellishar 10 Reputation points

    Just a note for anyone else encountering this problem after following the quickstart guide for Python V2 Quickstart: Create a function in Azure with Python using Visual Studio Code and then trying to use that demo function in an ADF pipeline:

    The V2 demo code provided includes some decorators above the function def

    app = func.FunctionApp()
    @app.route(route="hello", auth_level=func.AuthLevel.ANONYMOUS)

    The app route decorator sets the URL of the function to use the specified route name, instead of the function name (default), so when you deploy the function, the URL will be

    When adding an Azure Function activity to an ADF pipeline, you must specify the name used in the route arg (in this case "hello") of app.route() as the function name in order for ADF to correctly locate the function. If you use the name of your function as it appears in Azure (assuming that differs from the route arg), ADF will return the error "Invoking Azure function failed with HttpStatusCode - NotFound."

    1 person found this answer helpful.

  2. MayankBargali-MSFT 70,006 Reputation points

    Hi @Mohsen Akhavan

    I have looked into the backend logs and I can see that your function app is in the "Stopped" state. Please start your function app by navigating to your function app. The error is expected if there is no function found with the request URL.


    Once you see the status as "Running" please test it and let me know if you are still facing the issue.