ManagedNetwork Class

Managed Network settings for a workspace.

Creating a ManagedNetwork object with one of each rule type.


   from azure.ai.ml.entities import (
       Workspace,
       ManagedNetwork,
       IsolationMode,
       ServiceTagDestination,
       PrivateEndpointDestination,
       FqdnDestination,
   )

   # 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")

   network = ManagedNetwork(
       isolation_mode=IsolationMode.ALLOW_ONLY_APPROVED_OUTBOUND,
       outbound_rules=[blobrule, datafactoryrule, pypirule],
   )

   # Workspace configuration
   ws = Workspace(name="ws-name", location="eastus", managed_network=network)

Inheritance
builtins.object
ManagedNetwork

Constructor

ManagedNetwork(*, isolation_mode: str = 'Disabled', outbound_rules: List[OutboundRule] | None = None, network_id: str | None = None, **kwargs: Any)

Parameters

Name Description
isolation_mode
Required
str

Isolation of the managed network, defaults to Disabled.

outbound_rules
Required

List of outbound rules for the managed network.

network_id
Required
str

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
network_id
Required