Diagnostic tool for Azure Functions Python v2 programming model
Project description
Azure Functions Doctor
Read this in: 한국어 | 日本語 | 简体中文
Azure Functions Doctor is the pre-deploy health gate for Azure Functions Python v2 projects — a diagnostic CLI that catches configuration issues, missing dependencies, and environment problems before they cause runtime failures in production.
Part of the Azure Functions Python DX Toolkit → Bring FastAPI-like developer experience to Azure Functions
Why this exists
Deploying a broken Azure Functions app is expensive — the worker starts, the host reads config, and only then does it surface the issue in a production log. Common problems that slip through:
- Missing dependencies —
azure-functionsnot inrequirements.txt, discovered only at cold start - Invalid configuration —
host.jsonmisconfigured,extensionBundlemissing or outdated - Runtime incompatibilities — Python version mismatch with Azure Functions runtime
- Silent failures — no virtual environment, Core Tools not installed, Application Insights key missing
azure-functions-doctor moves that failure left — catch it locally or in CI, not in production.
What it does
- 14+ diagnostic checks — Python version, dependencies, host.json, Core Tools, Durable Functions, and more
- Multiple output formats — table, JSON, SARIF, JUnit for CI integration
- Profile support —
minimalorfullrulesets depending on your needs - Official GitHub Action —
yeongseon/azure-functions-doctor@v1for CI gates
Scope
This repository targets the decorator-based Azure Functions Python v2 programming model only.
- Supported model:
func.FunctionApp()with decorators such as@app.route() - Unsupported model: legacy
function.json-based Python v1 projects
Use azure-functions-doctor as part of a pre-deployment checklist alongside azure-functions-logging for observability.
What this package does not do
This package does not own:
- Fixing issues — it diagnoses configuration problems but does not auto-fix them
- API documentation — use
azure-functions-openapifor API documentation and spec generation - Request validation — use
azure-functions-validationfor request/response validation and serialization
Installation
From PyPI:
pip install azure-functions-doctor
From source:
git clone https://github.com/yeongseon/azure-functions-doctor.git
cd azure-functions-doctor
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
Quick Start
Run the doctor in the current project:
azure-functions doctor
Run against a specific project:
azure-functions doctor --path ./examples/v2/http-trigger
Use a required-only profile:
azure-functions doctor --profile minimal
Output JSON for CI:
azure-functions doctor --format json
Sample output (excerpt)
azure-functions-doctor doctor --path ./examples/v2/http-trigger
Azure Functions Doctor
Path: ./examples/v2/http-trigger
Programming Model
[✓] Programming model v2: Keyword '@app.|@bp.' found in source code (AST)
Python Env
[✓] Python version: Python 3.10.12 (>=3.10)
[✓] requirements.txt: requirements.txt exists
[✓] azure-functions package: Package 'azure-functions' declared in requirements.txt
Project Structure
[✓] host.json: host.json exists
[✓] host.json version: host.json version is "2.0"
Tooling
[✓] Azure Functions Core Tools (func): func detected
...
Doctor summary:
0 fails, 5 warnings, 15 passed
Exit code: 0
The same command runs in CI pipelines — see CI Integration below and docs/deployment.md for details.
CI Integration
Use azure-functions-doctor as a CI gate to block deployments on required failures.
GitHub Actions (CLI)
- name: Run azure-functions-doctor
run: |
pip install azure-functions-doctor
azure-functions doctor --profile minimal --format json --output doctor.json
- name: Upload report
if: always()
uses: actions/upload-artifact@v4
with:
name: doctor-report
path: doctor.json
Official GitHub Action
- uses: yeongseon/azure-functions-doctor@v1
with:
path: .
profile: minimal
format: sarif
output: doctor.sarif
upload-sarif: "true"
See docs/examples/ci_integration.md for Azure DevOps, pre-commit, VS Code, and SARIF upload examples.
Demo
The demo below is generated from demo/doctor-demo.tape with VHS.
It runs the real azure-functions doctor CLI against the representative example
and then against an intentionally broken copy to show the pass/fail contrast.
The final terminal state is also captured as a static image for quick inspection.
Features
The default ruleset includes checks for:
- Azure Functions Python v2 decorator usage
- Python version
- virtual environment activation
- Python executable availability
requirements.txtazure-functionsdependency declarationhost.jsonlocal.settings.json(optional)- Azure Functions Core Tools presence and version (optional)
- Durable Functions host configuration (optional)
- Application Insights configuration (optional)
extensionBundleconfiguration (optional)- ASGI/WSGI callable exposure (optional)
- common unwanted files in the project tree (optional)
Examples
Requirements
- Python 3.10+
- Hatch for development workflows
- Azure Functions Core Tools v4+ recommended for local runs
When to use
- Before deploying an Azure Functions app (local pre-flight check)
- In CI/CD pipelines as a deployment gate
- When onboarding a new developer to catch environment setup issues
- After upgrading Python version or Azure Functions runtime
- As a pre-commit hook for configuration validation
Documentation
- docs/index.md
- docs/usage.md
- docs/rules.md
- docs/diagnostics.md
- docs/development.md
- docs/examples/ci_integration.md
Ecosystem
This package is part of the Azure Functions Python DX Toolkit.
Design principle: azure-functions-doctor owns pre-deploy diagnostics. It does not fix issues or generate code — it surfaces actionable findings so developers can fix them. Runtime behavior belongs to azure-functions-openapi (API documentation and spec generation), azure-functions-validation (request/response validation), and azure-functions-langgraph (LangGraph runtime exposure).
| Package | Role |
|---|---|
| azure-functions-openapi | OpenAPI spec generation and Swagger UI |
| azure-functions-validation | Request/response validation and serialization |
| azure-functions-db | Database bindings for SQL, PostgreSQL, MySQL, SQLite, and Cosmos DB |
| azure-functions-langgraph | LangGraph deployment adapter for Azure Functions |
| azure-functions-scaffold | Project scaffolding CLI |
| azure-functions-logging | Structured logging and observability |
| azure-functions-doctor | Pre-deploy diagnostic CLI |
| azure-functions-durable-graph | Manifest-first graph runtime with Durable Functions (experimental) |
| azure-functions-python-cookbook | Recipes and examples |
For AI Coding Assistants
This repository includes llms.txt and llms-full.txt for LLM-friendly documentation:
llms.txt— Concise index of package info, CLI commands, quick start, and ecosystem overviewllms-full.txt— Comprehensive API reference with output formats, diagnostic rules, custom rules, and CI integration patterns
When working with this codebase, LLM assistants should:
- Use
llms.txtfor quick reference — package version (0.16.2), Python requirements (>=3.10,<3.15), CLI entry points - Refer to
llms-full.txtfor implementation details — output contracts, rule structure, custom rule patterns, handler types - Check
src/azure_functions_doctor/cli.py— authoritative source for CLI options and validation - Review
src/azure_functions_doctor/assets/rules/v2.json— complete ruleset with check definitions - Consult
src/azure_functions_doctor/handlers.py— diagnostic rule handlers and pattern matchers
For bug reports, feature requests, or documentation improvements, please open an issue or pull request on GitHub.
Disclaimer
This project is an independent community project and is not affiliated with, endorsed by, or maintained by Microsoft.
Azure and Azure Functions are trademarks of Microsoft Corporation.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file azure_functions_doctor-0.16.3.tar.gz.
File metadata
- Download URL: azure_functions_doctor-0.16.3.tar.gz
- Upload date:
- Size: 5.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9388f3fb7d98256fb0c672fb4e35568a8661fb24af2543c4148c6ecd45bcf30
|
|
| MD5 |
aaf438e6920bf6781972939292560c92
|
|
| BLAKE2b-256 |
c5e759a9133122eb32f2c7d30c4c86bdbe616ece2ad69bf6b7e664982fe85eaf
|
Provenance
The following attestation bundles were made for azure_functions_doctor-0.16.3.tar.gz:
Publisher:
publish-pypi.yml on yeongseon/azure-functions-doctor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
azure_functions_doctor-0.16.3.tar.gz -
Subject digest:
d9388f3fb7d98256fb0c672fb4e35568a8661fb24af2543c4148c6ecd45bcf30 - Sigstore transparency entry: 1271477448
- Sigstore integration time:
-
Permalink:
yeongseon/azure-functions-doctor@b5bdb33f94b397a92baa631fdf79b5a5e78d22cb -
Branch / Tag:
refs/tags/v0.16.3 - Owner: https://github.com/yeongseon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@b5bdb33f94b397a92baa631fdf79b5a5e78d22cb -
Trigger Event:
push
-
Statement type:
File details
Details for the file azure_functions_doctor-0.16.3-py3-none-any.whl.
File metadata
- Download URL: azure_functions_doctor-0.16.3-py3-none-any.whl
- Upload date:
- Size: 32.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c21a6b5efd5388b2ca00396112b7f64f11055f22013a8a8161ac836a20381310
|
|
| MD5 |
2c1e83072c8e57dafc46cf242e83cfc0
|
|
| BLAKE2b-256 |
5d58e7fb4d534aabe0951797c861ac22fb38c457b925851ded32bb1b9618f7cf
|
Provenance
The following attestation bundles were made for azure_functions_doctor-0.16.3-py3-none-any.whl:
Publisher:
publish-pypi.yml on yeongseon/azure-functions-doctor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
azure_functions_doctor-0.16.3-py3-none-any.whl -
Subject digest:
c21a6b5efd5388b2ca00396112b7f64f11055f22013a8a8161ac836a20381310 - Sigstore transparency entry: 1271477458
- Sigstore integration time:
-
Permalink:
yeongseon/azure-functions-doctor@b5bdb33f94b397a92baa631fdf79b5a5e78d22cb -
Branch / Tag:
refs/tags/v0.16.3 - Owner: https://github.com/yeongseon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@b5bdb33f94b397a92baa631fdf79b5a5e78d22cb -
Trigger Event:
push
-
Statement type: