ManagedNetwork Class
Managed Network settings for a workspace.
Creating a ManagedNetwork object with one of each rule type.
from azure.ai.ml.constants._workspace import FirewallSku
from azure.ai.ml.entities import (
FqdnDestination,
IsolationMode,
ManagedNetwork,
PrivateEndpointDestination,
ServiceTagDestination,
Workspace,
)
# Example private endpoint outbound to a blob
blobrule = PrivateEndpointDestination(
name="blobrule",
service_resource_id="/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/storage-name",
subresource_target="blob",
spark_enabled=False,
)
# Example service tag rule
datafactoryrule = ServiceTagDestination(
name="datafactory", service_tag="DataFactory", protocol="TCP", port_ranges="80, 8080-8089"
)
# Example FQDN rule
pypirule = FqdnDestination(name="pypirule", destination="pypi.org")
# Example FirewallSku
# FirewallSku is an optional parameter, when unspecified this will default to FirewallSku.Standard
firewallSku = FirewallSku.BASIC
network = ManagedNetwork(
isolation_mode=IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND,
outbound_rules=[blobrule, datafactoryrule, pypirule],
firewall_sku=firewallSku,
)
# Workspace configuration
ws = Workspace(name="ws-name", location="eastus", managed_network=network)
- Inheritance
-
builtins.objectManagedNetwork
Constructor
ManagedNetwork(*, isolation_mode: str = 'Disabled', outbound_rules: List[OutboundRule] | None = None, firewall_sku: str | None = None, network_id: str | None = None, **kwargs: Any)
Parameters
Name | Description |
---|---|
isolation_mode
Required
|
Isolation of the managed network, defaults to Disabled. |
firewall_sku
Required
|
Firewall Sku for FQDN rules in AllowOnlyApprovedOutbound.. |
outbound_rules
Required
|
List of outbound rules for the managed network. |
network_id
Required
|
Network id for the managed network, not meant to be set by user. |
Keyword-Only Parameters
Name | Description |
---|---|
isolation_mode
|
Default value: Disabled
|
outbound_rules
Required
|
|
firewall_sku
Required
|
|
network_id
Required
|
|
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
Azure SDK for Python