azure-functions-python-worker icon indicating copy to clipboard operation
azure-functions-python-worker copied to clipboard

[Bug]: Consumption Apps failing with "Error: cannot import name 'url_quote' from 'werkzeug.urls"

Open hallvictoria opened this issue 7 months ago • 0 comments

Background

Python Azure Function apps on runtime version 4.1038 on Linux Consumption that are pinned to Flask<=2.2.2 may see ImportError: cannot import name 'url_quote' from 'werkzeug.urls' during function indexing and function execution.

Root Cause

To address a security vulnerability, the 4.1038 Python worker image now brings in Werkzeug~=3.1.3. For consumption, the Werkzeug version brought in the image is loaded first and causes a conflict with older Flask versions.

Mitigations

  1. Add PYTHON_ISOLATE_WORKER_DEPENDENCIES = 1 as an App Setting
  2. Update to Flask >= 3.0

hallvictoria avatar Apr 29 '25 21:04 hallvictoria