Skip to content

Commit 0f1a71b

Browse files
joshharrinJosh Harrington
andauthored
[ml] support pe fqdns and st address prefixes (#36960)
* addressPrefixes should not be readonly. ARM swagger 30248 * update swagger restclient version of workspace related operations * add new properties support for outbound rules in SDK * managed_network has been GA for long time * update changelog * cspell on appGw and sphinx docs error * linting pt2 --------- Co-authored-by: Josh Harrington <[email protected]>
1 parent ee9ea21 commit 0f1a71b

29 files changed

+243
-6970
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
## 1.20.0 (unreleased)
44

55
### Features Added
6-
- When a workspace is created with `managed_network` enabled or has `public_network_access` set to disabled, the resources created with the workspace (Key Vault, Storage Account) will be set to have restricted network access settings. This is only applicable when the user does not specify existing resources.
6+
- When a workspace is created with `managed_network` enabled or has `public_network_access` set to disabled, the resources created with the workspace (Key Vault, Storage Account) will be set to have restricted network access settings. This is only applicable when the user does not specify existing resources.
7+
- Added support of `fqdns` property for managed network `PrivateEndpointDestination` outbound rule objects. Enabling the support of Application Gateway as a Private Endpoint target in the workspace managed network.
8+
- Added support of `address_prefixes` property for managed network `ServiceTagDestination` outbound rule objects.
9+
- Removed experimental tag from `managed_network` which is a GA feature.
710

811
## 1.19.0 (2024-07-29)
912

sdk/ml/azure-ai-ml/azure/ai/ml/_ml_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ def __init__(
474474

475475
self._workspaces = WorkspaceOperations(
476476
self._ws_operation_scope if registry_reference else self._operation_scope,
477-
self._service_client_08_2023_preview,
477+
self._service_client_07_2024_preview,
478478
self._operation_container,
479479
self._credential,
480480
requests_pipeline=self._requests_pipeline,
@@ -485,7 +485,7 @@ def __init__(
485485

486486
self._workspace_outbound_rules = WorkspaceOutboundRuleOperations(
487487
self._operation_scope,
488-
self._service_client_08_2023_preview,
488+
self._service_client_07_2024_preview,
489489
self._operation_container,
490490
self._credential,
491491
**kwargs,
@@ -702,7 +702,7 @@ def __init__(
702702

703703
self._featurestores = FeatureStoreOperations(
704704
self._operation_scope,
705-
self._service_client_08_2023_preview,
705+
self._service_client_07_2024_preview,
706706
self._operation_container,
707707
self._credential,
708708
**app_insights_handler_kwargs, # type: ignore[arg-type]

sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_models.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26588,8 +26588,6 @@ def __init__(
2658826588
class ServiceTagDestination(msrest.serialization.Model):
2658926589
"""Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace.
2659026590

26591-
Variables are only populated by the server, and will be ignored when sending a request.
26592-
2659326591
:ivar action: The action enum for networking rule. Possible values include: "Allow", "Deny".
2659426592
:vartype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction
2659526593
:ivar address_prefixes: Optional, if provided, the ServiceTag property will be ignored.
@@ -26602,10 +26600,6 @@ class ServiceTagDestination(msrest.serialization.Model):
2660226600
:vartype service_tag: str
2660326601
"""
2660426602

26605-
_validation = {
26606-
'address_prefixes': {'readonly': True},
26607-
}
26608-
2660926603
_attribute_map = {
2661026604
'action': {'key': 'action', 'type': 'str'},
2661126605
'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'},
@@ -26621,6 +26615,8 @@ def __init__(
2662126615
"""
2662226616
:keyword action: The action enum for networking rule. Possible values include: "Allow", "Deny".
2662326617
:paramtype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction
26618+
:keyword address_prefixes: Optional, if provided, the ServiceTag property will be ignored.
26619+
:paramtype address_prefixes: list[str]
2662426620
:keyword port_ranges:
2662526621
:paramtype port_ranges: str
2662626622
:keyword protocol:
@@ -26630,7 +26626,7 @@ def __init__(
2663026626
"""
2663126627
super(ServiceTagDestination, self).__init__(**kwargs)
2663226628
self.action = kwargs.get('action', None)
26633-
self.address_prefixes = None
26629+
self.address_prefixes = kwargs.get('address_prefixes', None)
2663426630
self.port_ranges = kwargs.get('port_ranges', None)
2663526631
self.protocol = kwargs.get('protocol', None)
2663626632
self.service_tag = kwargs.get('service_tag', None)
@@ -31194,6 +31190,9 @@ class WorkspaceUpdateParameters(msrest.serialization.Model):
3119431190
~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings
3119531191
:ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted.
3119631192
:vartype soft_delete_retention_in_days: int
31193+
:ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of
31194+
the workspace.
31195+
:vartype system_datastores_auth_mode: str
3119731196
:ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by
3119831197
the v2 API.
3119931198
:vartype v1_legacy_mode: bool
@@ -31220,6 +31219,7 @@ class WorkspaceUpdateParameters(msrest.serialization.Model):
3122031219
'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'},
3122131220
'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'},
3122231221
'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'},
31222+
'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'},
3122331223
'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'},
3122431224
}
3122531225

@@ -31278,6 +31278,9 @@ def __init__(
3127831278
:keyword soft_delete_retention_in_days: Retention time in days after workspace get soft
3127931279
deleted.
3128031280
:paramtype soft_delete_retention_in_days: int
31281+
:keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of
31282+
the workspace.
31283+
:paramtype system_datastores_auth_mode: str
3128131284
:keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided
3128231285
by the v2 API.
3128331286
:paramtype v1_legacy_mode: bool
@@ -31303,4 +31306,5 @@ def __init__(
3130331306
self.serverless_compute_settings = kwargs.get('serverless_compute_settings', None)
3130431307
self.service_managed_resources_settings = kwargs.get('service_managed_resources_settings', None)
3130531308
self.soft_delete_retention_in_days = kwargs.get('soft_delete_retention_in_days', None)
31309+
self.system_datastores_auth_mode = kwargs.get('system_datastores_auth_mode', None)
3130631310
self.v1_legacy_mode = kwargs.get('v1_legacy_mode', None)

sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_07_01_preview/models/_models_py3.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28837,8 +28837,6 @@ def __init__(
2883728837
class ServiceTagDestination(msrest.serialization.Model):
2883828838
"""Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace.
2883928839

28840-
Variables are only populated by the server, and will be ignored when sending a request.
28841-
2884228840
:ivar action: The action enum for networking rule. Possible values include: "Allow", "Deny".
2884328841
:vartype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction
2884428842
:ivar address_prefixes: Optional, if provided, the ServiceTag property will be ignored.
@@ -28851,10 +28849,6 @@ class ServiceTagDestination(msrest.serialization.Model):
2885128849
:vartype service_tag: str
2885228850
"""
2885328851

28854-
_validation = {
28855-
'address_prefixes': {'readonly': True},
28856-
}
28857-
2885828852
_attribute_map = {
2885928853
'action': {'key': 'action', 'type': 'str'},
2886028854
'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'},
@@ -28867,6 +28861,7 @@ def __init__(
2886728861
self,
2886828862
*,
2886928863
action: Optional[Union[str, "RuleAction"]] = None,
28864+
address_prefixes: Optional[List[str]] = None,
2887028865
port_ranges: Optional[str] = None,
2887128866
protocol: Optional[str] = None,
2887228867
service_tag: Optional[str] = None,
@@ -28875,6 +28870,8 @@ def __init__(
2887528870
"""
2887628871
:keyword action: The action enum for networking rule. Possible values include: "Allow", "Deny".
2887728872
:paramtype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction
28873+
:keyword address_prefixes: Optional, if provided, the ServiceTag property will be ignored.
28874+
:paramtype address_prefixes: list[str]
2887828875
:keyword port_ranges:
2887928876
:paramtype port_ranges: str
2888028877
:keyword protocol:
@@ -28884,7 +28881,7 @@ def __init__(
2888428881
"""
2888528882
super(ServiceTagDestination, self).__init__(**kwargs)
2888628883
self.action = action
28887-
self.address_prefixes = None
28884+
self.address_prefixes = address_prefixes
2888828885
self.port_ranges = port_ranges
2888928886
self.protocol = protocol
2889028887
self.service_tag = service_tag
@@ -33855,6 +33852,9 @@ class WorkspaceUpdateParameters(msrest.serialization.Model):
3385533852
~azure.mgmt.machinelearningservices.models.ServiceManagedResourcesSettings
3385633853
:ivar soft_delete_retention_in_days: Retention time in days after workspace get soft deleted.
3385733854
:vartype soft_delete_retention_in_days: int
33855+
:ivar system_datastores_auth_mode: The auth mode used for accessing the system datastores of
33856+
the workspace.
33857+
:vartype system_datastores_auth_mode: str
3385833858
:ivar v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided by
3385933859
the v2 API.
3386033860
:vartype v1_legacy_mode: bool
@@ -33881,6 +33881,7 @@ class WorkspaceUpdateParameters(msrest.serialization.Model):
3388133881
'serverless_compute_settings': {'key': 'properties.serverlessComputeSettings', 'type': 'ServerlessComputeSettings'},
3388233882
'service_managed_resources_settings': {'key': 'properties.serviceManagedResourcesSettings', 'type': 'ServiceManagedResourcesSettings'},
3388333883
'soft_delete_retention_in_days': {'key': 'properties.softDeleteRetentionInDays', 'type': 'int'},
33884+
'system_datastores_auth_mode': {'key': 'properties.systemDatastoresAuthMode', 'type': 'str'},
3388433885
'v1_legacy_mode': {'key': 'properties.v1LegacyMode', 'type': 'bool'},
3388533886
}
3388633887

@@ -33907,6 +33908,7 @@ def __init__(
3390733908
serverless_compute_settings: Optional["ServerlessComputeSettings"] = None,
3390833909
service_managed_resources_settings: Optional["ServiceManagedResourcesSettings"] = None,
3390933910
soft_delete_retention_in_days: Optional[int] = None,
33911+
system_datastores_auth_mode: Optional[str] = None,
3391033912
v1_legacy_mode: Optional[bool] = None,
3391133913
**kwargs
3391233914
):
@@ -33961,6 +33963,9 @@ def __init__(
3396133963
:keyword soft_delete_retention_in_days: Retention time in days after workspace get soft
3396233964
deleted.
3396333965
:paramtype soft_delete_retention_in_days: int
33966+
:keyword system_datastores_auth_mode: The auth mode used for accessing the system datastores of
33967+
the workspace.
33968+
:paramtype system_datastores_auth_mode: str
3396433969
:keyword v1_legacy_mode: Enabling v1_legacy_mode may prevent you from using features provided
3396533970
by the v2 API.
3396633971
:paramtype v1_legacy_mode: bool
@@ -33986,4 +33991,5 @@ def __init__(
3398633991
self.serverless_compute_settings = serverless_compute_settings
3398733992
self.service_managed_resources_settings = service_managed_resources_settings
3398833993
self.soft_delete_retention_in_days = soft_delete_retention_in_days
33994+
self.system_datastores_auth_mode = system_datastores_auth_mode
3398933995
self.v1_legacy_mode = v1_legacy_mode

sdk/ml/azure-ai-ml/azure/ai/ml/_schema/_feature_store/feature_store_schema.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from azure.ai.ml._schema.workspace.identity import IdentitySchema, UserAssignedIdentitySchema
1212
from azure.ai.ml._utils.utils import snake_to_pascal
1313
from azure.ai.ml.constants._common import PublicNetworkAccess
14-
from azure.ai.ml._schema import ExperimentalField
1514
from azure.ai.ml._schema.workspace.networking import ManagedNetworkSchema
1615
from .compute_runtime_schema import ComputeRuntimeSchema
1716
from .materialization_store_schema import MaterializationStoreSchema
@@ -41,4 +40,4 @@ class FeatureStoreSchema(PathAwareSchema):
4140
)
4241
identity = NestedField(IdentitySchema)
4342
primary_user_assigned_identity = fields.Str()
44-
managed_network = ExperimentalField(NestedField(ManagedNetworkSchema, unknown=EXCLUDE))
43+
managed_network = NestedField(ManagedNetworkSchema, unknown=EXCLUDE)

sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/networking.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class ManagedNetworkStatusSchema(metaclass=PatchedSchemaMeta):
2525

2626
class FqdnOutboundRuleSchema(metaclass=PatchedSchemaMeta):
2727
name = fields.Str(required=True)
28+
parent_rule_names = fields.List(fields.Str(), dump_only=True)
2829
type = fields.Constant("fqdn")
2930
destination = fields.Str(required=True)
3031
category = StringTransformedEnum(
@@ -52,10 +53,12 @@ class ServiceTagDestinationSchema(metaclass=PatchedSchemaMeta):
5253
service_tag = fields.Str(required=True)
5354
protocol = fields.Str(required=True)
5455
port_ranges = fields.Str(required=True)
56+
address_prefixes = fields.List(fields.Str())
5557

5658

5759
class ServiceTagOutboundRuleSchema(metaclass=PatchedSchemaMeta):
5860
name = fields.Str(required=True)
61+
parent_rule_names = fields.List(fields.Str(), dump_only=True)
5962
type = fields.Constant("service_tag")
6063
destination = NestedField(ServiceTagDestinationSchema, required=True)
6164
category = StringTransformedEnum(
@@ -72,7 +75,9 @@ class ServiceTagOutboundRuleSchema(metaclass=PatchedSchemaMeta):
7275

7376
@pre_dump
7477
def predump(self, data, **kwargs):
75-
data.destination = self.service_tag_dest2dict(data.service_tag, data.protocol, data.port_ranges)
78+
data.destination = self.service_tag_dest2dict(
79+
data.service_tag, data.protocol, data.port_ranges, data.address_prefixes
80+
)
7681
return data
7782

7883
@post_load
@@ -86,15 +91,17 @@ def createdestobject(self, data, **kwargs):
8691
service_tag=dest["service_tag"],
8792
protocol=dest["protocol"],
8893
port_ranges=dest["port_ranges"],
94+
address_prefixes=dest.get("address_prefixes", None),
8995
category=_snake_to_camel(category),
9096
status=status,
9197
)
9298

93-
def service_tag_dest2dict(self, service_tag, protocol, port_ranges):
99+
def service_tag_dest2dict(self, service_tag, protocol, port_ranges, address_prefixes):
94100
service_tag_dest = {}
95101
service_tag_dest["service_tag"] = service_tag
96102
service_tag_dest["protocol"] = protocol
97103
service_tag_dest["port_ranges"] = port_ranges
104+
service_tag_dest["address_prefixes"] = address_prefixes
98105
return service_tag_dest
99106

100107

@@ -106,8 +113,10 @@ class PrivateEndpointDestinationSchema(metaclass=PatchedSchemaMeta):
106113

107114
class PrivateEndpointOutboundRuleSchema(metaclass=PatchedSchemaMeta):
108115
name = fields.Str(required=True)
116+
parent_rule_names = fields.List(fields.Str(), dump_only=True)
109117
type = fields.Constant("private_endpoint")
110118
destination = NestedField(PrivateEndpointDestinationSchema, required=True)
119+
fqdns = fields.List(fields.Str())
111120
category = StringTransformedEnum(
112121
allowed_values=[
113122
OutboundRuleCategory.REQUIRED,
@@ -132,13 +141,15 @@ def createdestobject(self, data, **kwargs):
132141
category = data.get("category", OutboundRuleCategory.USER_DEFINED)
133142
name = data.get("name")
134143
status = data.get("status", None)
144+
fqdns = data.get("fqdns", None)
135145
return PrivateEndpointDestination(
136146
name=name,
137147
service_resource_id=dest["service_resource_id"],
138148
subresource_target=dest["subresource_target"],
139149
spark_enabled=dest["spark_enabled"],
140150
category=_snake_to_camel(category),
141151
status=status,
152+
fqdns=fqdns,
142153
)
143154

144155
def pe_dest2dict(self, service_resource_id, subresource_target, spark_enabled):

sdk/ml/azure-ai-ml/azure/ai/ml/_schema/workspace/workspace.py

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

55
from marshmallow import EXCLUDE, fields
66

7-
from azure.ai.ml._schema import ExperimentalField
87
from azure.ai.ml._schema._utils.utils import validate_arm_str
98
from azure.ai.ml._schema.core.fields import NestedField, StringTransformedEnum
109
from azure.ai.ml._schema.core.schema import PathAwareSchema
@@ -41,7 +40,7 @@ class WorkspaceSchema(PathAwareSchema):
4140
identity = NestedField(IdentitySchema)
4241
primary_user_assigned_identity = fields.Str()
4342
workspace_hub = fields.Str(validate=validate_arm_str)
44-
managed_network = ExperimentalField(NestedField(ManagedNetworkSchema, unknown=EXCLUDE))
43+
managed_network = NestedField(ManagedNetworkSchema, unknown=EXCLUDE)
4544
enable_data_isolation = fields.Bool()
4645
allow_roleassignment_on_rg = fields.Bool()
4746
serverless_compute = NestedField(ServerlessComputeSettingsSchema)

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_feature_store/feature_store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from pathlib import Path
1010
from typing import Any, Dict, Optional, Union
1111

12-
from azure.ai.ml._restclient.v2023_08_01_preview.models import Workspace as RestWorkspace
12+
from azure.ai.ml._restclient.v2024_07_01_preview.models import Workspace as RestWorkspace
1313
from azure.ai.ml._schema._feature_store.feature_store_schema import FeatureStoreSchema
1414
from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY
1515
from azure.ai.ml.entities._credentials import IdentityConfiguration, ManagedIdentityConfiguration

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_workspace/_ai_workspaces/hub.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
# pylint: disable=too-many-instance-attributes,protected-access
66
from typing import Any, Dict, List, Optional
77

8-
from azure.ai.ml._restclient.v2023_08_01_preview.models import Workspace as RestWorkspace
9-
from azure.ai.ml._restclient.v2023_08_01_preview.models import WorkspaceHubConfig as RestWorkspaceHubConfig
8+
from azure.ai.ml._restclient.v2024_07_01_preview.models import (
9+
Workspace as RestWorkspace,
10+
WorkspaceHubConfig as RestWorkspaceHubConfig,
11+
)
1012
from azure.ai.ml._schema.workspace import HubSchema
1113
from azure.ai.ml._utils._experimental import experimental
1214
from azure.ai.ml.constants._common import WorkspaceKind

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,11 @@
55
import json
66
from typing import Any, Dict, Optional, List
77

8-
from azure.ai.ml._restclient.v2023_08_01_preview.models import (
8+
from azure.ai.ml._restclient.v2024_07_01_preview.models import (
99
DiagnoseRequestProperties as RestDiagnoseRequestProperties,
10-
)
11-
from azure.ai.ml._restclient.v2023_08_01_preview.models import DiagnoseResponseResult as RestDiagnoseResponseResult
12-
from azure.ai.ml._restclient.v2023_08_01_preview.models import (
10+
DiagnoseResponseResult as RestDiagnoseResponseResult,
1311
DiagnoseResponseResultValue as RestDiagnoseResponseResultValue,
14-
)
15-
from azure.ai.ml._restclient.v2023_08_01_preview.models import DiagnoseResult as RestDiagnoseResult
16-
from azure.ai.ml._restclient.v2023_08_01_preview.models import (
12+
DiagnoseResult as RestDiagnoseResult,
1713
DiagnoseWorkspaceParameters as RestDiagnoseWorkspaceParameters,
1814
)
1915

0 commit comments

Comments
 (0)