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.function_name(name="HttpTrigger1")
@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 https://your_function_app.azurewebsites.net/api/hello
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."