Posts

Showing posts with the label Azure

CI/CD for a FastAPI App — GitHub Actions to Azure App Service

Image
CI/CD for a FastAPI App — GitHub Actions to Azure App Service Direct answer: Put one workflow file in .github/workflows/ . Run your tests on every pull_request , and deploy to Azure App Service only on a push to main , after the tests pass, logging in with OIDC so no Azure password is ever stored in GitHub. That is the whole pipeline — this post builds it step by step. Versions used (November 2026): Python 3.12.3, FastAPI 0.115.6, pytest 8.3.4, actions/checkout@v4, actions/setup-python@v5, azure/login@v2, azure/webapps-deploy@v3. What you will build Two jobs, one gate between them. The test job runs on every pull request and holds no secrets. The deploy job runs only when code lands on main and only after the test job passes. Environment setup (prerequisites first) A GitHub account and a repository for the app (public or private — the pipeline is identical). An Azure account. The free account includes an F1 Free App Service plan; the spending limit stays ON. Creating the ac...

How Do I Deploy a FastAPI App to Azure App Service? Step by Step, From Zero

Image
Versions used in this post — read this first: Python 3.12.3 · Azure CLI 2.91.0 · fastapi 0.162.0 · uvicorn 0.54.0 · gunicorn 26.2.0 · uvicorn-worker 0.4.0 · App Service runtime PYTHON:3.12 . Everything runs from one file, main.py , printed in full below — the exact file in the companion repo. Recorded October 2026; the free-tier limits and prices below are Microsoft's published figures as of that date. The direct answer Deploy a FastAPI app to Azure App Service, step by step, on the free tier: put the app in a folder with requirements.txt at the root, create a resource group, a free (F1) App Service plan, and a Python 3.12 web app, set two app settings, deploy a zip of the code, and — the step most tutorials skip — set the startup command . On Python 3.13 and earlier, App Service auto-detects Django and Flask only; a FastAPI app with no startup command doesn't error, it silently serves a built-in default page. The startup command is one line, and this post explains every piec...