Posts

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...

Interview Questions for Developers — Plain-Word Answers, One Question at a Time

Image
Interview questions stop being scary the moment someone explains them from the very beginning, in plain words. That is exactly what this page does. Every Monday and Wednesday we take one real interview question for developers, explain it from first principles — no assumed background, no jargon before its time — and finish with the short version you can actually say out loud in the interview room. Every answer also comes with a two-minute video, linked right under the question. Bookmark this page and come back: it grows by one question every Monday and Wednesday, and the newest question always sits at the top. Everything here is free, in full — no sign-up, no gated answers. The questions so far Q2 · Walk me through RAG end to end — and if the answers are wrong, where do you look first? Q1. Clustered vs non-clustered index — what's the actual difference? (SQL Server) Q2 · Walk me through RAG end to end. If users say the answers are wrong, where do you look first? AI engi...

Why Is My SQL Server Slow? A 4-Step Diagnosis with Blocking, Wait Stats, Execution Plans and Missing Indexes (2026)

Image
Your SQL Server is slow — but "slow" is a symptom, not a diagnosis. In this tutorial you will diagnose one genuinely slow query the way a mechanic finds a car fault: with four checks, in a fixed order , each producing evidence instead of a guess. The four checks are: (1) is anything blocking the query, (2) what is the server waiting on, (3) what does the execution plan say, and (4) which index is missing. Our test query starts out touching 12,388 pages to return about 2,061 rows. By the end of this post it touches 15 pages — and you will know exactly which check found the problem, because every number here was measured on the demo server while writing this post. What you need A SQL Server you can practise on — this post uses SQL Server 2025 (17.x) , measured build 17.0.5065.9 (RTM-CU11) on Linux, driven from a terminal with sqlcmd . Every query below also runs unchanged in a query window in SQL Server Management Studio (SSMS) 22 on Windows — a section near the end ma...

Build Your Own Coding Agent in Python (It Fixes Real Code — Behind an Approval Gate)

Image
Build your own coding agent — in one Python file, with three tools and one rule that makes it safe to use: it cannot change a single line of code until a human approves the change . In this tutorial we build the agent on the Gemini API's function-calling loop, point it at a real project with a real failing test, and watch it find the bug, propose the fix, stop at the approval gate, and — only after a yes — apply it and prove the suite green. Then it prints its own bill. Every step has its own real screenshot, taken from the run you are reading about. Versions used in this tutorial Python 3.12 google-genai 3.0.0 (the Gemini SDK, pinned) and pytest 9.2.0 (pinned) Model: gemini-3.8-flash — rate card verified on Google's official pricing page on 2026-11-07: $0.75 per 1M input tokens, $3.75 per 1M output tokens (Standard tier, in effect through Dec 31, 2026); a free tier exists Companion code: topic-09-coding-agent in the Visual Studio Learn code repo Step 0 — Setup from zer...

Monitor a FastAPI App with Prometheus + Grafana (Metrics, Dashboards, Alerts)

Image
Your FastAPI app is slow, and you cannot see it. There is no graph of your traffic, no counter of your errors, and nothing that tells you which endpoint is the slow one. The first symptom is a user complaint — and by then you are debugging blind. In this tutorial you will fix that, end to end, on your own machine: instrument a FastAPI app so it publishes its own metrics, collect them with Prometheus, and build a Grafana dashboard that catches a slow endpoint live — then set an alert that fires when it happens again. Everything is local and free: no accounts, no API keys, no cloud. What we are using (pinned, so your install matches this post exactly): prometheus-fastapi-instrumentator 8.1.0 · Prometheus 3.16.0 · Grafana OSS 13.3.0 · FastAPI 0.162.4 · uvicorn 0.54.0 · Python 3.12. The complete companion code — the app, the Prometheus config, the load script, the exported dashboard JSON and the alert rule — is in the companion repository , folder topic-10-prometheus-grafana/ . S...