diff --git a/.github/actions/azure-functions-integration-setup/action.yml b/.github/actions/azure-functions-integration-setup/action.yml index 99b8207a82..f0de0f6797 100644 --- a/.github/actions/azure-functions-integration-setup/action.yml +++ b/.github/actions/azure-functions-integration-setup/action.yml @@ -56,8 +56,12 @@ runs: echo "Python 3.12 not found on system, installing via uv..." uv python install 3.12 FUNC_WORKER_PYTHON="$(uv python find 3.12)" - echo "FUNC_WORKER_PYTHON=${FUNC_WORKER_PYTHON}" >> "$GITHUB_ENV" - echo "Installed Python 3.12 at ${FUNC_WORKER_PYTHON}" + 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 diff --git a/python/packages/azurefunctions/tests/integration_tests/conftest.py b/python/packages/azurefunctions/tests/integration_tests/conftest.py index acfe59c313..7045ce4930 100644 --- a/python/packages/azurefunctions/tests/integration_tests/conftest.py +++ b/python/packages/azurefunctions/tests/integration_tests/conftest.py @@ -370,6 +370,7 @@ def _find_func_worker_python() -> str | None: return explicit # Try versioned system executables (python3.12, python3.11, python3.10). + # Azure Functions v4 supports Python 3.10–3.12. for minor in range(12, 9, -1): path = shutil.which(f"python3.{minor}") if path: @@ -394,6 +395,9 @@ def _start_function_app(sample_path: Path, port: int) -> subprocess.Popen[Any]: # a compatible Python when one is available. worker_python = _find_func_worker_python() if worker_python: + # Azure Functions uses double-underscore separators for nested config + # keys passed as environment variables (host.json equivalent: + # languageWorkers.python.defaultExecutablePath). env["languageWorkers__python__defaultExecutablePath"] = worker_python # On Windows, use CREATE_NEW_PROCESS_GROUP to allow proper termination