CI/CD for a FastAPI App — GitHub Actions to Azure App Service
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...