Skip to content

Commit 5861568

Browse files
authored
[ML] Fixing bugs related with workspace resource operations. (#34034)
* remove PNA and manage network check for project * add dump support for diagnose result, and fix list key schema issue * Update diagnose json dump method * running black * Add ChangeLog * Update project arm template to support more properties
1 parent 4d1fb59 commit 5861568

File tree

5 files changed

+19
-6
lines changed

5 files changed

+19
-6
lines changed

sdk/ml/azure-ai-ml/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
### Bugs Fixed
99
- Fix pipeline job `outputs` not load correctly when `component: <local-file>` exists in pipeline job yaml.
10+
- Workspace ListKey operation serialization issue fixed.
11+
- Workspace Diagnose result now can be print in to Json format.
1012

1113
### Breaking Changes
1214

sdk/ml/azure-ai-ml/azure/ai/ml/_arm_deployments/arm_templates/workspace_project.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,9 @@
689689
"description": "[parameters('description')]",
690690
"primaryUserAssignedIdentity": "[parameters('primaryUserAssignedIdentity')]",
691691
"hubResourceId": "[parameters('workspace_hub')]",
692+
"enableDataIsolation": "[parameters('enable_data_isolation')]",
693+
"managedNetwork": "[parameters('managedNetwork')]",
694+
"publicNetworkAccess": "[parameters('publicNetworkAccess')]",
692695
"serverlessComputeSettings": "[parameters('serverless_compute_settings')]"
693696
}
694697
}

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/diagnose.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# ---------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# ---------------------------------------------------------
4-
from typing import Any, Dict, List, Optional
4+
5+
import json
6+
from typing import Any, Dict, Optional, List
57

68
from azure.ai.ml._restclient.v2023_08_01_preview.models import (
79
DiagnoseRequestProperties as RestDiagnoseRequestProperties,
@@ -145,6 +147,15 @@ def _to_rest_object(self) -> RestDiagnoseResponseResultValue:
145147
other_results=self.other_results,
146148
)
147149

150+
def __json__(self):
151+
results = self.__dict__.copy()
152+
for k, v in results.items():
153+
results[k] = [item.__dict__ for item in v]
154+
return results
155+
156+
def __str__(self) -> str:
157+
return json.dumps(self, default=lambda o: o.__json__(), indent=2)
158+
148159

149160
class DiagnoseResult:
150161
"""Result of Diagnose."""

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/workspace_keys.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from typing import List, Optional
66

7-
from azure.ai.ml._restclient.v2023_06_01_preview.models import ListWorkspaceKeysResult
7+
from azure.ai.ml._restclient.v2023_08_01_preview.models import ListWorkspaceKeysResult
88

99

1010
class ContainerRegistryCredential:
@@ -93,7 +93,7 @@ def _from_rest_object(cls, rest_obj: ListWorkspaceKeysResult) -> Optional["Works
9393

9494
return WorkspaceKeys(
9595
user_storage_key=rest_obj.user_storage_key,
96-
user_storage_resource_id=rest_obj.user_storage_resource_id,
96+
user_storage_resource_id=rest_obj.user_storage_arm_id,
9797
app_insights_instrumentation_key=rest_obj.app_insights_instrumentation_key,
9898
container_registry_credentials=container_registry_credentials,
9999
notebook_access_keys=notebook_access_keys,

sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_operations_base.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,6 @@ def begin_create(
164164
workspace.storage_account,
165165
workspace.container_registry,
166166
workspace.key_vault,
167-
workspace.public_network_access,
168-
workspace.managed_network,
169-
workspace.customer_managed_key,
170167
]
171168
):
172169
msg = (

0 commit comments

Comments
 (0)