Skip to content

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

pip install azure-functions-openapi

Verify the installation

python -c "import azure_functions_openapi; print(azure_functions_openapi.__version__)"

Optional dependencies

Install the dev extras for local development:

pip install azure-functions-openapi[dev]

Install the docs extras to build the documentation site locally:

pip install azure-functions-openapi[docs]

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:

pip install azure-functions-openapi azure-functions-validation

Add to requirements.txt

Azure Functions reads requirements.txt during deployment. Ensure both the runtime SDK and this library are listed:

azure-functions
azure-functions-openapi

If your endpoints use Pydantic models for request or response schemas, add Pydantic as well:

pydantic>=2.0

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:

make install

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:

Verify the installation:

func --version

Deployment

Azure Functions

Deploy with the Azure Functions Core Tools:

func azure functionapp publish <app-name>

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:

pip install --upgrade azure-functions-openapi

Check the Changelog for breaking changes before upgrading across major or minor versions.