Run func worker natively on Python 3.13 by disabling dependency isolation

Replace the Python 3.12 redirect workaround with the proper fix:
set PYTHON_ISOLATE_WORKER_DEPENDENCIES=0 on Python >=3.13.

The segfault (exit code 139) is caused by the Azure Functions worker's
module isolation mechanism conflicting with protobuf's C extensions
(google._upb) on Python 3.13.  Disabling isolation lets the worker
load dependencies from the app's own environment, which avoids the
crash while keeping everything running on Python 3.13.

See: https://github.com/Azure/azure-functions-python-worker/issues/1797

Co-authored-by: larohra <41490930+larohra@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-26 19:52:06 +00:00
Unverified
parent 29fd8e690d
commit 5532dffec2
2 changed files with 7 additions and 57 deletions
@@ -46,22 +46,3 @@ runs:
echo "Installing Azure Functions Core Tools"
npm install -g azure-functions-core-tools@4 --unsafe-perm true
func --version
- name: Ensure Python 3.12 is available for Azure Functions worker
shell: bash
run: |
# The Azure Functions Python worker may segfault on Python >=3.13
# (protobuf C extension crash). Ensure a compatible Python is
# available so the conftest can redirect the worker to it.
if ! python3.12 --version 2>/dev/null; then
echo "Python 3.12 not found on system, installing via uv..."
uv python install 3.12
FUNC_WORKER_PYTHON="$(uv python find 3.12)"
if [ -n "${FUNC_WORKER_PYTHON}" ] && [ -f "${FUNC_WORKER_PYTHON}" ]; then
echo "FUNC_WORKER_PYTHON=${FUNC_WORKER_PYTHON}" >> "$GITHUB_ENV"
echo "Installed Python 3.12 at ${FUNC_WORKER_PYTHON}"
else
echo "::warning::Could not resolve Python 3.12 path after install"
fi
else
echo "System Python 3.12 found: $(which python3.12)"
fi