Installation¶
Requirements¶
| Dependency | Version |
|---|---|
| Python | 3.11 -- 3.14 |
| Azure Functions Core Tools | Latest stable |
| Azure Functions programming model | v2 (func.FunctionApp with decorators) |
This library is not compatible with the legacy function.json-based v1 model.
Install from PyPI¶
Verify the installation¶
Optional dependencies¶
Install the dev extras for local development:
Install the docs extras to build the documentation site locally:
If you also use azure-functions-validation for request/response validation,
install it alongside — scan_endpoint_metadata() will auto-discover
validation metadata without any extra configuration:
Add to requirements.txt¶
Azure Functions reads requirements.txt during deployment. Ensure both the runtime
SDK and this library are listed:
If your endpoints use Pydantic models for request or response schemas, add Pydantic as well:
Local Development Setup¶
Clone the repository and create a virtual environment:
git clone https://github.com/yeongseon/azure-functions-openapi-python.git
cd azure-functions-openapi-python
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e .[dev]
Or use the Makefile shortcut:
This creates the Hatch-managed environment and installs pre-commit hooks.
Azure Functions Core Tools¶
The Core Tools provide the func CLI for local development and deployment.
Install using the official Microsoft instructions for your platform:
- Windows: https://learn.microsoft.com/azure/azure-functions/functions-run-local
- macOS:
brew tap azure/functions && brew install azure-functions-core-tools@4 - Linux: https://learn.microsoft.com/azure/azure-functions/functions-run-local
Verify the installation:
Deployment¶
Azure Functions¶
Deploy with the Azure Functions Core Tools:
The requirements.txt in your project root is installed automatically during deployment.
Docker¶
If you deploy via a custom Docker image, install the package in your Dockerfile:
FROM mcr.microsoft.com/azure-functions/python:4-python3.12
COPY requirements.txt /home/site/wwwroot/requirements.txt
RUN pip install -r /home/site/wwwroot/requirements.txt
COPY . /home/site/wwwroot
4-python3.12 is just an example: 4 is the Functions runtime major version
and python3.12 is the interpreter baked into the image. Swap it for whichever
supported interpreter your app targets. This package supports 3.11 through
3.14, and mcr.microsoft.com/azure-functions/python publishes 4-python3.11,
4-python3.12, 4-python3.13, and 4-python3.14. Pick the tag that matches
the version you test against, and keep it in sync with your CI matrix.
Upgrading¶
Upgrade to the latest release:
Check the Changelog for breaking changes before upgrading across major or minor versions.