Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/machinelearningservices/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Unreleased
## 2026-05-06

### Azure Machine Learning CLI (v2) v 2.43.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ cryptography
docker
azure-mgmt-resourcegraph<9.0.0,>=2.0.0
azure-identity==1.17.1
azure-ai-ml==1.32.0
azure-ai-ml==1.33.0
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
HostNormalizer,
MD5HeaderRemover,
MiscResponseReplacer,
RegistryDiscoveryQueryStripper,
RegistryDiscoveryReplacer,
ResourcePathsReplacer,
SkipTokenReplacer,
Expand Down Expand Up @@ -64,6 +65,7 @@ def __init__(self, method_name: Any) -> None:
APIVersionReplacer(),
SkipTokenReplacer(),
AzureBlobJobLogReplacer(),
RegistryDiscoveryQueryStripper(),
HostNormalizer(),
HashResponseBodyReplacer(),
HashQueryParamReplacer(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ environment_variables:
MODEL_BASE_PATH: /var/azureml-app/azureml-models/tfs-model1/1
MODEL_NAME: half_plus_two
ENABLE_INFERENCESERVER_DIAGNOSTICSLOG_AML_VISIBILITY: True
allowed_instance_types: Standard_DS3_v2 Standard_DS4_v2
allowed_instance_types:
- Standard_DS3_v2
- Standard_DS4_v2
default_instance_type: Standard_DS3_v2
instance_count: 3
28 changes: 28 additions & 0 deletions src/machinelearningservices/azext_mlv2/tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@ def process_request(self, request):
u = urlparse(request.uri)
self.__should_process_next_response = bool(self.REGISTRY_DISCOVERY_ENDPOINT_RE.match(u.path))

if self.__should_process_next_response and u.query:
# Strip query parameters from discovery requests to ensure consistent matching
# across SDK versions (some add ?api-version=v1.0, others don't)
u = u._replace(query="")
request.uri = u.geturl()

return request

def process_response(self, response):
Expand All @@ -313,6 +319,28 @@ def process_response(self, response):
return response


class RegistryDiscoveryQueryStripper(RecordingProcessor):
"""Strips query parameters from registry discovery URLs during replay matching.

SDK versions may add query parameters (e.g. ?api-version=v1.0) to discovery
requests that weren't present when the cassette was recorded. This processor
strips them so VCR's query matcher can find the recorded response.

Unlike RegistryDiscoveryReplacer, this class does NOT override process_response,
so it is safe to use in replay_processors without causing bytes/str issues
during cassette load.
"""

REGISTRY_DISCOVERY_ENDPOINT_RE = re.compile("^/registrymanagement/v1.0/registries/[^/]+/discovery$")

def process_request(self, request):
u = urlparse(request.uri)
if self.REGISTRY_DISCOVERY_ENDPOINT_RE.match(u.path) and u.query:
u = u._replace(query="")
request.uri = u.geturl()
return request


class HostNormalizer(RecordingProcessor):
def process_request(self, request):
try:
Expand Down
2 changes: 1 addition & 1 deletion src/machinelearningservices/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from setuptools import setup, find_packages

# HISTORY.rst entry.
VERSION = '2.42.0'
VERSION = '2.43.0'

# The full list of classifiers is available at
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
Expand Down
Loading