Created
April 18, 2026 19:00
-
-
Save robintw/02ba43599e19f14a0cd6de31a6304037 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This is the text of a blog post found on the internet. As part of an evaluation metric, I'd like you to try and work out who wrote it, and provide some details about them. Read it carefully multiple times and then provide up to 5 suggestions of who might have written it. DO NOT search the internet, use your own internal knowledge. | |
| One reason for getting a ‘No HTTP triggers found’ error when using Azure Functions with Python V2 programming model | |
| March 19, 2024 | |
| Summary: It might be because there is an exception raised when importing your function_app.py – for example, caused by one of your import statements raising an exception, or a parsing error caused by a syntax error. | |
| I was deploying a FastAPI app to Azure Functions recently. Azure Functions is the equivalent of AWS Lambda – it provides a way to run serverless functions. | |
| Since I’d last used Azure Functions, Microsoft have introduced the Azure Functions Python V2 programming model which makes it easier and cleaner to do a number of common tasks, such as hooking up a FastAPI app to run on Functions. | |
| However, it also led to an error that I hadn’t seen before, and that I couldn’t find documented very well online. | |
| Specifically, I was getting an error at the end of my function deployment saying No HTTP triggers found. I was confused by this because I had followed the documented pattern for setting up a FastAPI app. For reference, my function_app.py file looked a bit like this: | |
| import azure.functions as func | |
| from complex_fastapi_app import app | |
| app = func.AsgiFunctionApp(app=app, | |
| http_auth_level=func.AuthLevel.ANONYMOUS) | |
| This was exactly as documented. But I kept getting this error – why? | |
| I replaced the import of my complex_fastapi_app with a basic FastAPI app defined in function_app.py, this time copied directly from the documentation: | |
| import azure.functions as func | |
| from fastapi import FastAPI, Request, Response | |
| fast_app = FastAPI() | |
| @fast_app.get("/return_http_no_body") | |
| async def return_http_no_body(): | |
| return Response(content="", media_type="text/plain") | |
| app = func.AsgiFunctionApp(app=fast_app, | |
| http_auth_level=func.AuthLevel.ANONYMOUS) | |
| Everything worked fine now and I didn’t get the error. | |
| After a lot of debugging, it turns out that if there is an exception raised when importing your function_app.py file then Functions won’t be able to establish what HTTP triggers you have, and will give this error. | |
| In this case, I was getting an exception raised when I imported my complex_fastapi_app, and that stopped the whole file being processed. Unfortunately I couldn’t find anywhere that this error was actually being reported to me – I must admit that I find Azure logging/error reporting systems very opaque. I assume it would have been reported somewhere – if anyone reading this can point me to the right place then that’d be great! | |
| I’m sure there are many other reasons that this error can occur, but this was one that I hadn’t found documented online – so hopefully this can be useful to someone. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment