Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

code4mk/azure-function-fastapi

Repository files navigation

azure-function-fastapi

Deploy Python FastAPI serverless application on Azure Functions.

  • Good project structure

local development (fastapi)

venv

# create virtual environment
python3 -m venv .azure_function_fastapi_venv
# activate virtual environment
source .azure_function_fastapi_venv/bin/activate

run fast api project

# install packages
pip3 install -r requirements.txt
# run project with uvicorn
uvicorn "fastapi_project.main:app" --reload --port=8000
# or, run bash with shell
./run_fastapi_project.sh

deploy on production

vscode extension

Screenshot 2024年05月19日 at 5 50 24 PM

sql project enable

set the environment variable azure (Settings >> Environment variables (app settings))

  • DATABASE_URL
  • LOAD_SQL_PROJECT value will be yes

Project route

http://localhost:8000/api/v1/users
http://localhost:8000/health

About

Deploy Python FastAPI serverless application on Azure Functions

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /