Skip to content

Conversation

gavin-aguiar
Copy link
Contributor

@gavin-aguiar gavin-aguiar commented Aug 25, 2025

Problem Description

In Python 3.13 Azure Functions, user logs were not appearing in the function execution logs. This was because the proxy_worker implementation was missing the invocation ID context setup that is required for proper log correlation.

Root Cause Analysis

The issue was specific to Python 3.13 because:

  • Python 3.12 and below: Uses azure_functions_worker directly which properly sets up invocation context
  • Python 3.13: Uses proxy_worker that delegates to runtimes/v2 library worker, but the proxy wasn't bridging the invocation context

The library worker uses thread-local storage for invocation ID tracking, but the proxy worker wasn't setting up this context, causing all user logs to appear without invocation IDs and thus not show up in the function logs.

Fixes #


Pull Request Checklist

Host-Worker Contract

  • Does this PR impact the host-worker contract (e.g., gRPC messages, shared interfaces)?
    • If yes, have the changes been applied to:
      • azure_functions_worker (Python <= 3.12)
      • proxy_worker (Python >= 3.13)
    • If no, please explain why:

Worker Execution Logic

  • Does this PR affect worker execution logic (e.g., function invocation, bindings, lifecycle)?
    If yes, please answer the following:

Python Version Coverage

  • Does this change apply to both Python <=3.12 and 3.13+?
  • If yes, have the changes been made to:
    • azure_functions_worker (Python <= 3.12)
    • runtimes/v1 / runtimes/v2 (Python >= 3.13)
  • If no, please explain why:

Programming Model Compatibility (for Python 3.13+)

  • Does this change apply to both:
    • V1 programming model (runtimes/v1)?
    • V2 programming model (runtimes/v2)?
  • Explanation (if limited to one model):

@gavin-aguiar gavin-aguiar enabled auto-merge (squash) August 25, 2025 22:24
@gavin-aguiar gavin-aguiar merged commit 3a87cb0 into dev Aug 26, 2025
39 checks passed
@gavin-aguiar gavin-aguiar deleted the fix/python313-logging branch August 26, 2025 15:56
@ayelencasamassa
Copy link

Hi, I'm still having this issue, how am i supposed to apply fix?
Thanks.

@hallvictoria
Copy link
Contributor

Hi @ayelencasamassa, the fix has been released as part of runtime version 4.1043, which is currently rolling out. ETA to reach all regions is end of September / early October.

If you need the fix immediately, you can create a function app in one of the following regions: East Asia, West Central US, North Europe, or West US 2.

@ayelencasamassa
Copy link

Hi @ayelencasamassa, the fix has been released as part of runtime version 4.1043, which is currently rolling out. ETA to reach all regions is end of September / early October.

If you need the fix immediately, you can create a function app in one of the following regions: East Asia, West Central US, North Europe, or West US 2.

Hello, any news on this? Is there any way I can check roll out to Canada?
Thanks.

@hallvictoria
Copy link
Contributor

Hi @ayelencasamassa, this has been rolled out to all regions. You can view the runtime version in the portal, and you may need to restart your app to pick up 4.1043.

If you're still facing issues, please open an issue and we can follow up there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants