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.
Why Use It
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. azure-functions-doctor moves that failure left.
Common issues it catches before deployment:
- Python version mismatch with the Azure Functions runtime
- Missing
host.jsonor misconfiguredextensionBundle azure-functionspackage not declared inrequirements.txt- v2 programming model decorators not detected (wrong project structure)
- Azure Functions Core Tools not installed or outdated
- Virtual environment not activated or missing
- Application Insights key not configured (optional but recommended)
- Durable Functions host configuration incomplete
Run it locally, in CI, or as a pre-commit hook.
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.
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
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
Documentation
- docs/index.md
- docs/usage.md
- docs/rules.md
- docs/diagnostics.md
- docs/development.md
- docs/examples/ci_integration.md
Ecosystem
- azure-functions-validation — Request and response validation
- azure-functions-openapi — OpenAPI and Swagger UI
- azure-functions-logging — Invocation-aware observability helper
- azure-functions-scaffold — Project scaffolding
- azure-functions-python-cookbook — Recipes and examples
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.1.tar.gz.
File metadata
- Download URL: azure_functions_doctor-0.16.1.tar.gz
- Upload date:
- Size: 5.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0246a36432def6ac29ccd4086040077bd0833938fb01b8ba32fa86407291db1
|
|
| MD5 |
b111184b57ca622b3a3fd57a4d63e7c3
|
|
| BLAKE2b-256 |
c7606f15b34617743368456106b3298a3e52c52fc0f59b768268439c3e710449
|
Provenance
The following attestation bundles were made for azure_functions_doctor-0.16.1.tar.gz:
Publisher:
release.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.1.tar.gz -
Subject digest:
a0246a36432def6ac29ccd4086040077bd0833938fb01b8ba32fa86407291db1 - Sigstore transparency entry: 1154433247
- Sigstore integration time:
-
Permalink:
yeongseon/azure-functions-doctor@9cac09263d1faa0530bfacd46c67b03a601ae8e3 -
Branch / Tag:
refs/tags/v0.16.1 - Owner: https://github.com/yeongseon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9cac09263d1faa0530bfacd46c67b03a601ae8e3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file azure_functions_doctor-0.16.1-py3-none-any.whl.
File metadata
- Download URL: azure_functions_doctor-0.16.1-py3-none-any.whl
- Upload date:
- Size: 30.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39440119fcdccac578f1b428691db0034a17ae55c23d489dfddb3f832bae7760
|
|
| MD5 |
d9a46114f0e9b1b5ec07fcdb978eb0ef
|
|
| BLAKE2b-256 |
352a0032b4a923caa804dd1ef4c5c40eb7257b42b7fdc458104a5ce84e11adeb
|
Provenance
The following attestation bundles were made for azure_functions_doctor-0.16.1-py3-none-any.whl:
Publisher:
release.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.1-py3-none-any.whl -
Subject digest:
39440119fcdccac578f1b428691db0034a17ae55c23d489dfddb3f832bae7760 - Sigstore transparency entry: 1154433248
- Sigstore integration time:
-
Permalink:
yeongseon/azure-functions-doctor@9cac09263d1faa0530bfacd46c67b03a601ae8e3 -
Branch / Tag:
refs/tags/v0.16.1 - Owner: https://github.com/yeongseon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@9cac09263d1faa0530bfacd46c67b03a601ae8e3 -
Trigger Event:
push
-
Statement type: