Installation¶
azure-functions-validation targets the Azure Functions Python v2 programming model.
Requirements¶
- Python 3.10+
azure-functions- Azure Functions Python v2 (
func.FunctionAppwith decorators)
This package does not support the legacy
function.json-based v1 programming model.
Version Compatibility¶
| Component | Supported Range | Notes |
|---|---|---|
| Python | 3.10+ | Project metadata currently declares >=3.10,<3.15. |
| Pydantic | v2 (>=2.0,<3.0) |
Validation models should inherit from pydantic.BaseModel. |
azure-functions |
Required | Use with Python v2 decorator-based FunctionApp. |
Compatibility expectations:
- Request and response models are based on Pydantic v2 behavior.
- Function definitions should follow the Python v2 decorator style.
- Validation errors are returned as HTTP
422with a JSONdetaillist.
From PyPI¶
Ensure your Function App dependencies include:
If you pin dependencies, keep pydantic in the v2 major version.
Verify Installation¶
Run the following command after installation:
Expected outcome:
- the command prints a version string such as
0.5.0 - no import errors are raised
You can also verify package metadata from your environment:
Check that your active environment is the same one used by your Function App.
Local Development¶
git clone https://github.com/yeongseon/azure-functions-validation.git
cd azure-functions-validation
make install
All project maintenance commands should go through the Makefile.
Upgrading¶
Upgrade to the latest published version:
Recommended upgrade workflow:
- Upgrade in a dedicated virtual environment.
- Reinstall or confirm compatible
azure-functionsand Pydantic v2 versions. - Run your local Azure Functions smoke tests.
- Confirm validation and response contracts still match your API expectations.
For deterministic deployments, pin an explicit version in your dependency file.
Troubleshooting¶
ImportError: No module named azure_functions_validation¶
- Confirm installation ran in the correct environment.
- Run
python -m pip install azure-functions-validation. - Verify with
python -c "import azure_functions_validation".
Pydantic version mismatch¶
- Ensure Pydantic is v2 (
pip show pydantic). - If v1 is installed transitively, pin
pydantic>=2,<3and reinstall.
Function app starts but validation decorator behavior is missing¶
- Confirm you are using the Python v2 programming model (
func.FunctionApp()). - Confirm your handler uses decorator registration (
@app.route,@validate_http).
Runtime dependency drift in Azure¶
- Rebuild deployment artifacts from a clean environment.
- Confirm
requirements.txtincludes bothazure-functionsandazure-functions-validation. - Verify the deployed Python runtime version is compatible with your lockfile.