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
|
|
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Azure SDK for Python