-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Open
Labels
Azure.Corecustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-author-feedbackWorkflow: More information is needed from author to address the issue.Workflow: More information is needed from author to address the issue.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Description
- Package Name:
azure-core - Package Version: Installed via virtual environment (1.38.0)
- Operating System: macOS 26.2 (25C56)
- Python Version: 3.13
Describe the bug
A TypeError is raised when the Azure SDK polling framework attempts to generate a continuation token for a long-running operation. The exception indicates that the payload used for token generation is not JSON-serializable, which prevents continuation tokens from being created.
This issue disrupts workflows that rely on resuming, retrying, or persisting long-running operations using continuation tokens.
To Reproduce
Steps to reproduce the behavior:
- Execute an Azure SDK operation that uses the polling mechanism (long-running operation).
- Allow the operation to reach a point where a continuation token is requested (e.g., calling poller.continuation_token()).
- The SDK attempts to serialize the initial response to generate the continuation token.
- A runtime exception is thrown.
Exception stack trace:
TypeError: Unable to generate a continuation token for this operation. Payload is not JSON-serializable.
File ".../azure/core/polling/_poller.py", line 283, in continuation_token
return self._polling_method.get_continuation_token()
File ".../azure/core/polling/_poller.py", line 165, in get_continuation_token
return _encode_continuation_token(self._initial_response)
File ".../azure/core/polling/_utils.py", line 138, in _encode_continuation_token
raise TypeError(
"Unable to generate a continuation token for this operation. "
"Payload is not JSON-serializable."
)
Expected behavior
The SDK should either:
- Gracefully handle non-JSON-serializable fields when generating continuation tokens, or
- Provide a documented mechanism to customize or override continuation token generation, or
- Clearly document which operations or payload structures are incompatible with continuation tokens.
At a minimum, the error should provide actionable guidance on how to mitigate or work around the issue.
Additional context
- This issue occurs at runtime and is not detectable during development or static analysis.
- The failure prevents safe retry or resume of long-running operations in production environments.
- The error message does not indicate which part of the response payload is non-serializable, making diagnosis difficult.
- Guidance on known limitations, recommended workarounds, or planned fixes would be highly appreciated.
- This issue is coming for
begin_deleteand begin_create_or_update operations.
Metadata
Metadata
Assignees
Labels
Azure.Corecustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.needs-author-feedbackWorkflow: More information is needed from author to address the issue.Workflow: More information is needed from author to address the issue.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that