Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/code4mk/azure-function-fastapi
Deploy Python FastAPI serverless application on Azure Functions
https://github.com/code4mk/azure-function-fastapi
azure azure-functions devops sdeops
Last synced: about 2 months ago
JSON representation
Deploy Python FastAPI serverless application on Azure Functions
- Host: GitHub
- URL: https://github.com/code4mk/azure-function-fastapi
- Owner: code4mk
- Created: 2024-05-18T18:26:21.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-31T20:09:30.000Z (8 months ago)
- Last Synced: 2024-06-01T20:57:35.563Z (7 months ago)
- Topics: azure, azure-functions, devops, sdeops
- Language: Python
- Homepage:
- Size: 24.4 KB
- Stars: 18
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# azure-function-fastapi
Deploy Python FastAPI serverless application on Azure Functions.* Good project structure
# local development (fastapi)
## venv
```bash
# create virtual environment
python3 -m venv .azure_function_fastapi_venv# activate virtual environment
source .azure_function_fastapi_venv/bin/activate
```## run fast api project
```bash
# 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
* [Azure Function Extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions)
## sql project enable
set the environment variable azure (Settings >> Environment variables (app settings))
* `DATABASE_URL`
* `LOAD_SQL_PROJECT` value will be `yes`## Project route
```bash
http://localhost:8000/api/v1/users
http://localhost:8000/health
```