Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sdk/core/azure-mgmt-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 1.6.1 (Unreleased)

### Bugs Fixed

- `ARMPolling` now includes the `azure-asyncoperation` header in the continuation token to ensure proper LRO rehydration.

## 1.6.0 (2025-07-02)

### Other Changes
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/azure-mgmt-core/azure/mgmt/core/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "1.6.0"
VERSION = "1.6.1"
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#
# --------------------------------------------------------------------------
from enum import Enum
from typing import Optional, Union, TypeVar, Dict, Any, Sequence
from typing import Optional, Union, TypeVar, Dict, Any, Sequence, Mapping

from azure.core import CaseInsensitiveEnumMeta
from azure.core.polling.base_polling import (
Expand All @@ -47,6 +47,24 @@
)
from azure.core.rest import HttpRequest, HttpResponse, AsyncHttpResponse

# ARM-specific LRO headers - azure-asyncoperation is ARM-specific
_ARM_LRO_HEADERS = frozenset(["azure-asyncoperation"])


def _add_arm_headers(filtered: Dict[str, str], headers: Mapping[str, str]) -> Dict[str, str]:
"""Add ARM-specific headers to the filtered headers dict.

:param filtered: The base filtered headers from parent class.
:type filtered: dict[str, str]
:param headers: The original response headers.
:type headers: Mapping[str, str]
:return: Updated filtered dictionary with ARM headers included.
:rtype: dict[str, str]
"""
filtered.update({k: v for k, v in headers.items() if k.lower() in _ARM_LRO_HEADERS})
return filtered


ResponseType = Union[HttpResponse, AsyncHttpResponse]
PipelineResponseType = PipelineResponse[HttpRequest, ResponseType]
HttpRequestType = Union[LegacyHttpRequest, HttpRequest]
Expand Down Expand Up @@ -208,6 +226,18 @@ def __init__(
**operation_config
)

def _filter_headers_for_continuation_token(self, headers: Mapping[str, str]) -> Dict[str, str]:
"""Filter headers to include in the continuation token.

ARM-specific override that includes the azure-asyncoperation header.

:param headers: The response headers to filter.
:type headers: Mapping[str, str]
:return: A filtered dictionary of headers to include in the continuation token.
:rtype: dict[str, str]
"""
return _add_arm_headers(super()._filter_headers_for_continuation_token(headers), headers)


__all__ = [
"AzureAsyncOperationPolling",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------
from typing import Optional, Dict, Any, Sequence
from typing import Optional, Dict, Any, Sequence, Mapping

from azure.core.polling.base_polling import LocationPolling, StatusCheckPolling, LongRunningOperation
from azure.core.polling.async_base_polling import AsyncLROBasePolling

from .arm_polling import AzureAsyncOperationPolling, BodyContentPolling, HttpRequestTypeVar, AllHttpResponseTypeVar
from .arm_polling import AzureAsyncOperationPolling, BodyContentPolling, HttpRequestTypeVar, AllHttpResponseTypeVar, _add_arm_headers


class AsyncARMPolling(AsyncLROBasePolling):
Expand All @@ -54,5 +54,17 @@ def __init__(
**operation_config
)

def _filter_headers_for_continuation_token(self, headers: Mapping[str, str]) -> Dict[str, str]:
"""Filter headers to include in the continuation token.

ARM-specific override that includes the azure-asyncoperation header.

:param headers: The response headers to filter.
:type headers: Mapping[str, str]
:return: A filtered dictionary of headers to include in the continuation token.
:rtype: dict[str, str]
"""
return _add_arm_headers(super()._filter_headers_for_continuation_token(headers), headers)


__all__ = ["AsyncARMPolling"]
2 changes: 1 addition & 1 deletion sdk/core/azure-mgmt-core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"pytyped": ["py.typed"],
},
install_requires=[
"azure-core>=1.32.0",
"azure-core>=1.38.0",
],
python_requires=">=3.9",
)
Loading