Skip to content

Commit 9565ba3

Browse files
ML ext Release 2.40.1 - Adding integration tests for DT, preview feature and command update t… (#9408)
* Adding integration tests for DT, preview feature and command update to show * azdev lint fix * Adding license * Adding release version and changelog
1 parent 34fcc6e commit 9565ba3

20 files changed

+4587
-8
lines changed

src/machinelearningservices/CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 2025-11-11
2+
3+
### Azure Machine Learning CLI (v2) v 2.40.1
4+
- `az ml deployment-template show` instead of `az ml deployment-template get`
5+
- Show details of a specific deployment template by name and version.
6+
- Make deployment templates as preview feature
7+
8+
19
## 2025-11-04
210

311
### Azure Machine Learning CLI (v2) v 2.40.0

src/machinelearningservices/azext_mlv2/manual/_help/_deployment_template_help.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ def get_deployment_template_help():
3737
text: az ml deployment-template list --registry-name myregistry --output table
3838
"""
3939

40-
helps['ml deployment-template get'] = """
40+
helps['ml deployment-template show'] = """
4141
type: command
4242
short-summary: Get a specific deployment template by name and version.
4343
long-summary: |
4444
Retrieve detailed information about a specific deployment template. If version is not
4545
specified, the latest version will be returned.
4646
examples:
4747
- name: Get a specific version of a deployment template
48-
text: az ml deployment-template get --name my-template --version 1 --registry-name myregistry
48+
text: az ml deployment-template show --name my-template --version 1 --registry-name myregistry
4949
"""
5050

5151
helps['ml deployment-template create'] = """

src/machinelearningservices/azext_mlv2/manual/_params/_deployment_template_params.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def load_deployment_template_params(self):
4242
),
4343
)
4444

45-
with self.argument_context("ml deployment-template get") as c:
45+
with self.argument_context("ml deployment-template show") as c:
4646
add_common_params(c)
4747
add_deployment_template_common_param(c, name_required=True, version_required=True)
4848
c.argument(

src/machinelearningservices/azext_mlv2/manual/commands.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,11 @@ def load_command_table(self, _):
226226
supports_no_wait=True,
227227
)
228228

229-
with self.command_group("ml deployment-template", client_factory=cf_ml_cl) as g:
229+
with self.command_group("ml deployment-template", client_factory=cf_ml_cl, is_preview=True) as g:
230230
custom_tmpl = "azext_mlv2.manual.custom.deployment_template#{}"
231231
custom_deployment_template = CliCommandType(operations_tmpl=custom_tmpl)
232232
g.custom_command("list", "ml_deployment_template_list", command_type=custom_deployment_template)
233-
g.custom_command("get", "ml_deployment_template_get", command_type=custom_deployment_template)
233+
g.custom_show_command("show", "ml_deployment_template_show")
234234
g.custom_command("create", "ml_deployment_template_create", supports_no_wait=True,
235235
command_type=custom_deployment_template)
236236
g.generic_update_command(

src/machinelearningservices/azext_mlv2/manual/custom/deployment_template.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def ml_deployment_template_list(cmd, registry_name=None):
5454
log_and_raise_error(err, debug)
5555

5656

57-
def ml_deployment_template_get(cmd, name, version=None, registry_name=None):
57+
def ml_deployment_template_show(cmd, name, version=None, registry_name=None):
5858
"""Get a specific deployment template by name and version."""
5959
ml_client, debug = get_ml_client(
6060
cli_ctx=cmd.cli_ctx, registry_name=registry_name
@@ -120,7 +120,7 @@ def ml_deployment_template_create(
120120
if no_wait:
121121
module_logger.warning(
122122
"Deployment template create/update request initiated. "
123-
"Status can be checked using `az ml deployment-template get -n %s -v %s`",
123+
"Status can be checked using `az ml deployment-template show -n %s -v %s`",
124124
deployment_template.name if hasattr(deployment_template, 'name') else name or "unknown",
125125
deployment_template.version if hasattr(deployment_template, 'version') else version or "unknown"
126126
)
Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
interactions:
2+
- request:
3+
body: null
4+
headers:
5+
Accept:
6+
- application/json, text/json
7+
Accept-Encoding:
8+
- gzip, deflate
9+
Connection:
10+
- keep-alive
11+
User-Agent:
12+
- azureml-cli-v2/2.38.1 azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.10.11
13+
(Windows-10-10.0.26200-SP0)
14+
method: GET
15+
uri: https://eastus.api.azureml.ms/registrymanagement/v1.0/registries/test-cli-reg/discovery
16+
response:
17+
body:
18+
string: '{"registryId": "f8c25193-1c5b-4477-9d64-b99d2e48967c", "registryName":
19+
"test-cli-reg", "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", "primaryRegion":
20+
"eastus2", "regions": ["eastus2"], "subscriptionId": "00000000-0000-0000-0000-000000000000",
21+
"resourceGroup": "test-cli-rg", "workspaceName": null, "primaryRegionResourceProviderUri":
22+
"https://cert-eastus2.experiments.azureml.net/", "registryFqdns": {"eastus2":
23+
{"uri": "https://eastus2.api.azureml.ms"}}, "intellectualPropertyPublisher":
24+
null, "isTradeRestricted": false}'
25+
headers:
26+
azureml-served-by-cluster:
27+
- vienna-eastus-02
28+
connection:
29+
- keep-alive
30+
content-length:
31+
- '528'
32+
content-type:
33+
- application/json; charset=utf-8
34+
date:
35+
- Fri, 07 Nov 2025 16:40:00 GMT
36+
mise-correlation-id:
37+
- 2fd78ad7-f32f-4339-af31-cbe718d58194
38+
request-context:
39+
- appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d
40+
strict-transport-security:
41+
- max-age=31536000; includeSubDomains; preload
42+
transfer-encoding:
43+
- chunked
44+
vary:
45+
- Accept-Encoding
46+
x-content-type-options:
47+
- nosniff
48+
x-ms-response-type:
49+
- standard
50+
x-request-time:
51+
- '0.439'
52+
status:
53+
code: 200
54+
message: OK
55+
- request:
56+
body: null
57+
headers:
58+
Accept:
59+
- application/json
60+
Accept-Encoding:
61+
- gzip, deflate
62+
Connection:
63+
- keep-alive
64+
User-Agent:
65+
- azsdk-python-mgmt-machinelearningservices/0.1.0 Python/3.10.11 (Windows-10-10.0.26200-SP0)
66+
method: GET
67+
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/000000000000000/providers/Microsoft.MachineLearningServices/registries/test-cli-reg?api-version=0000-00-00
68+
response:
69+
body:
70+
string: '{"tags": {}, "location": "eastus2", "identity": {"type": "SystemAssigned",
71+
"principalId": "b265b0dc-d87f-4730-98f5-6a62e5d6830c", "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47"},
72+
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/000000000000000/providers/Microsoft.MachineLearningServices/registries/test-cli-reg",
73+
"name": "test-cli-reg", "type": "Microsoft.MachineLearningServices/registries",
74+
"properties": {"registryId": "f8c25193-1c5b-4477-9d64-b99d2e48967c", "regionDetails":
75+
[{"location": "eastus2", "storageAccountDetails": [{"userCreatedStorageAccount":
76+
null, "systemCreatedStorageAccount": {"storageAccountName": "974d4d59413",
77+
"storageAccountType": "Standard_LRS", "storageAccountHnsEnabled": false, "armResourceId":
78+
{"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/000000000000000/providers/Microsoft.Storage/storageAccounts/974d4d59413"}}}],
79+
"acrDetails": [{"userCreatedAcrAccount": null, "systemCreatedAcrAccount":
80+
{"acrAccountName": "3d8edf7d5bb", "acrAccountSku": "Premium", "armResourceId":
81+
{"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/000000000000000/providers/Microsoft.ContainerRegistry/registries/3d8edf7d5bb"}}}]}],
82+
"intellectualPropertyPublisher": null, "publicNetworkAccess": "Enabled", "discoveryUrl":
83+
"https://eastus2.api.azureml.ms/registrymanagement/v1.0/registries/test-cli-reg/discovery",
84+
"managedResourceGroup": {"resourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/000000000000000"},
85+
"mlFlowRegistryUri": "azureml://eastus2.api.azureml.ms/mlflow/v1.0/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/000000000000000/providers/Microsoft.MachineLearningServices/registries/test-cli-reg",
86+
"privateEndpointConnections": [], "managedResourceGroupSettings": null, "syndicatedRegistries":
87+
[]}, "systemData": null}'
88+
headers:
89+
azureml-served-by-cluster:
90+
- vienna-eastus2-01
91+
cache-control:
92+
- no-cache
93+
content-length:
94+
- '1883'
95+
content-type:
96+
- application/json; charset=utf-8
97+
date:
98+
- Fri, 07 Nov 2025 16:40:10 GMT
99+
expires:
100+
- '-1'
101+
pragma:
102+
- no-cache
103+
request-context:
104+
- appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d
105+
strict-transport-security:
106+
- max-age=31536000; includeSubDomains
107+
vary:
108+
- Accept-Encoding
109+
x-cache:
110+
- CONFIG_NOCACHE
111+
x-content-type-options:
112+
- nosniff
113+
x-ms-ratelimit-remaining-subscription-global-reads:
114+
- '16499'
115+
x-ms-response-type:
116+
- standard
117+
x-msedge-ref:
118+
- 'Ref A: 74FF24F9EFBD4893BBF1D952EFBA4577 Ref B: MAA201060516039 Ref C: 2025-11-07T16:40:11Z'
119+
x-request-time:
120+
- '0.024'
121+
status:
122+
code: 200
123+
message: OK
124+
- request:
125+
body: '{"description": "deployment template - 2", "tags": {"stage": "Open"}, "deploymentTemplateType":
126+
"Managed", "environmentId": "azureml://registries/kchawla-reg/environments/kchawla-environment/versions/1",
127+
"environmentVariables": {"MODEL_BASE_PATH": "/var/azureml-app/azureml-models/tfs-model1/1",
128+
"MODEL_NAME": "half_plus_two", "ENABLE_INFERENCESERVER_DIAGNOSTICSLOG_AML_VISIBILITY":
129+
"True"}, "modelMountPath": "/var/azureml-app", "requestSettings": {"requestTimeout":
130+
"PT6S", "maxConcurrentRequestsPerInstance": 2}, "livenessProbe": {"initialDelay":
131+
"PT5M", "period": "PT10S", "timeout": "PT2S", "failureThreshold": 30, "successThreshold":
132+
1, "path": "/v1/models/half_plus_two", "port": 8501, "scheme": "HTTP", "httpMethod":
133+
"GET"}, "readinessProbe": {"initialDelay": "PT5M", "period": "PT10S", "timeout":
134+
"PT2S", "failureThreshold": 30, "successThreshold": 1, "path": "/v1/models/half_plus_two",
135+
"port": 8501, "scheme": "HTTP", "httpMethod": "GET"}, "allowedInstanceType":
136+
["Standard_DS3_v2", "Standard_DS4_v2"], "defaultInstanceType": "Standard_DS3_v2",
137+
"instanceCount": 3, "scoringPath": "/v1/models/half_plus_two:predict", "scoringPort":
138+
8501, "type": "deploymenttemplates"}'
139+
headers:
140+
Accept:
141+
- application/json
142+
Accept-Encoding:
143+
- gzip, deflate
144+
Connection:
145+
- keep-alive
146+
Content-Length:
147+
- '1178'
148+
Content-Type:
149+
- application/json
150+
User-Agent:
151+
- azureml-cli-v2/2.38.1 azure-ai-ml/1.30.0 azsdk-python-mgmt-machinelearningservices/0.1.0
152+
Python/3.10.11 (Windows-10-10.0.26200-SP0)
153+
method: POST
154+
uri: https://eastus2.api.azureml.ms/genericasset/v2.0/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/000000000000000/providers/Microsoft.MachineLearningServices/registries/test-cli-reg/test-deployment-template/versions/1?api-version=0000-00-00
155+
response:
156+
body:
157+
string: '{"location": "https://eastus2.api.azureml.ms:443/assetstore/v1.0/operations/1jwV-Zpp5iHgcMM2idIHA46nZ9diqOy7X69ese40_88"}'
158+
headers:
159+
azureml-served-by-cluster:
160+
- vienna-eastus2-02
161+
connection:
162+
- keep-alive
163+
content-length:
164+
- '121'
165+
content-type:
166+
- application/json; charset=utf-8
167+
date:
168+
- Fri, 07 Nov 2025 16:40:13 GMT
169+
location:
170+
- https://eastus2.api.azureml.ms/assetstore/v1.0/operations/1jwV-Zpp5iHgcMM2idIHA46nZ9diqOy7X69ese40_88
171+
mise-correlation-id:
172+
- b1005edf-5b68-4d33-8025-957b42f778e1
173+
request-context:
174+
- appId=cid-v1:2d2e8e63-272e-4b3c-8598-4ee570a0e70d
175+
strict-transport-security:
176+
- max-age=31536000; includeSubDomains; preload
177+
x-content-type-options:
178+
- nosniff
179+
x-ms-response-type:
180+
- standard
181+
x-request-time:
182+
- '0.318'
183+
status:
184+
code: 202
185+
message: Accepted
186+
version: 1

0 commit comments

Comments
 (0)