Skip to main content

Diagnostic tool for Azure Functions Python v2 programming model

Project description

Azure Functions Doctor

PyPI Python Version CI Release Security Scans codecov pre-commit Docs License: MIT

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.json or misconfigured extensionBundle
  • azure-functions package not declared in requirements.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.

Doctor demo

The final terminal state is also captured as a static image for quick inspection.

Doctor final output

Features

The default ruleset includes checks for:

  • Azure Functions Python v2 decorator usage
  • Python version
  • virtual environment activation
  • Python executable availability
  • requirements.txt
  • azure-functions dependency declaration
  • host.json
  • local.settings.json (optional)
  • Azure Functions Core Tools presence and version (optional)
  • Durable Functions host configuration (optional)
  • Application Insights configuration (optional)
  • extensionBundle configuration (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

Ecosystem

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

azure_functions_doctor-0.16.0.tar.gz (5.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

azure_functions_doctor-0.16.0-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

Details for the file azure_functions_doctor-0.16.0.tar.gz.

File metadata

  • Download URL: azure_functions_doctor-0.16.0.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

Hashes for azure_functions_doctor-0.16.0.tar.gz
Algorithm Hash digest
SHA256 e9695e1ce31c25d9b2b71f143bab614f972614e5ad91d7209e3db382f24c3260
MD5 d249355968e40865b51800a62d239eb9
BLAKE2b-256 38c04ad287e41de24b3d91e902e4eaf7dafa3d2054991d5a29b0af03255c2ac0

See more details on using hashes here.

Provenance

The following attestation bundles were made for azure_functions_doctor-0.16.0.tar.gz:

Publisher: release.yml on yeongseon/azure-functions-doctor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file azure_functions_doctor-0.16.0-py3-none-any.whl.

File metadata

File hashes

Hashes for azure_functions_doctor-0.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ffd75380c795024652ee53a35a22ff558a78a46e8cf91f678b581e220d9e162e
MD5 cedd477e66617541b90d836775869d76
BLAKE2b-256 80f12a43fc185e81d0c80549da651dd48f93e054521f76ae692a96e53fd4960b

See more details on using hashes here.

Provenance

The following attestation bundles were made for azure_functions_doctor-0.16.0-py3-none-any.whl:

Publisher: release.yml on yeongseon/azure-functions-doctor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page