Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Will this framework work with Google Cloud Functions / AWS Lambda / Azure Functions? #812

Closed
3 tasks done
piavgh opened this issue Dec 24, 2019 · 4 comments
Closed
3 tasks done
Labels
question Question or problem question-migrate

Comments

@piavgh
Copy link

piavgh commented Dec 24, 2019

First check

  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the FastAPI documentation, with the integrated search.
  • I already searched in Google "How to X in FastAPI" and didn't find any information.

Description

How can I use this framework with some serverless solutions out there (Google Cloud Functions / AWS Lambda / Azure Functions, ...)?

Thank you.

Additional context

@piavgh piavgh added the question Question or problem label Dec 24, 2019
@piavgh piavgh changed the title [QUESTION] Will this framework with Google Cloud Functions / AWS Lambda / Azure Functions? [QUESTION] Will this framework work with Google Cloud Functions / AWS Lambda / Azure Functions? Dec 24, 2019
@koxudaxi
Copy link
Sponsor Contributor

koxudaxi commented Dec 24, 2019

@piavgh
FastAPI supports ASGI protocol to connect a server.

The libraries are ASGI adapter which helps to run FastAPI on the services.

For AWS Lambda:
https://github.com/erm/mangum
For Azure Functions:
https://github.com/erm/bonnette
For Google Cloud Functions:
https://github.com/erm/grevillea

Example for AWS Lambda with mangum:
https://github.com/erm/mangum-examples

@piavgh
Copy link
Author

piavgh commented Dec 24, 2019

@koxudaxi : thank you. I will check those repos

@paul121
Copy link

paul121 commented Mar 5, 2020

Zeit now supports an ASGI Interface for Python.

It was fairly easy to set this up & deploy. Doesn't require making modifications to the application structure. Not sure if this would work well for most deployments (I think WebSockets would be out of question) but may be a good solution for simple apps!

I created a demo repo showcasing what I've found. Hope it can help anyone else that looks into FastAPI + Serverless: https://github.com/paul121/fastapi-zeit-now

@tiangolo
Copy link
Owner

tiangolo commented Apr 7, 2020

Thanks for the help here @koxudaxi and @paul121 ! 🍰 🙇‍♂️

Thanks @piavgh for reporting back and closing the issue 👍

@tiangolo tiangolo changed the title [QUESTION] Will this framework work with Google Cloud Functions / AWS Lambda / Azure Functions? Will this framework work with Google Cloud Functions / AWS Lambda / Azure Functions? Feb 24, 2023
@tiangolo tiangolo reopened this Feb 28, 2023
Repository owner locked and limited conversation to collaborators Feb 28, 2023
@tiangolo tiangolo converted this issue into discussion #7868 Feb 28, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Question or problem question-migrate
Projects
None yet
Development

No branches or pull requests

4 participants