Skip to content

Commit f5fce0f

Browse files
Merge pull request #5942 from s-polly/stp-ml-uuf-7-89
ML UUF updates
2 parents 0974707 + 8258622 commit f5fce0f

File tree

1 file changed

+58
-49
lines changed

1 file changed

+58
-49
lines changed

articles/machine-learning/prompt-flow/how-to-secure-prompt-flow.md

Lines changed: 58 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ ms.subservice: prompt-flow
88
ms.custom:
99
- ignite-2023
1010
ms.topic: how-to
11-
author: lgayhardt
12-
ms.author: lagayhar
13-
ms.reviewer: lochen
14-
ms.date: 11/02/2023
11+
author: s-polly
12+
ms.author: scottpolly
13+
ms.reviewer: sooryar
14+
ms.date: 7/10/2025
1515
---
1616

1717
# Network isolation in prompt flow
@@ -20,107 +20,116 @@ You can secure prompt flow using private networks. This article explains the req
2020

2121
## Involved services
2222

23-
When you're developing your LLM application using prompt flow, you want a secured environment. You can make the following services private via network setting.
23+
When you develop AI applications using prompt flow, you need a secured environment. You can configure network isolation for the following services:
2424

25-
- Workspace: you can make Azure Machine Learning workspace as private and limit inbound and outbound of it.
26-
- Compute resource: you can also limit inbound and outbound rule of compute resource in the workspace.
27-
- Storage account: you can limit the accessibility of the storage account to specific virtual network.
28-
- Container registry: you also want to secure your container registry with virtual network.
29-
- Endpoint: you want to limit Azure services or IP address to access your endpoint.
30-
- Related Azure Cognitive Services as such Azure OpenAI, Azure content safety and Azure AI Search, you can use network config to make them as private then using private endpoint to let Azure Machine Learning services communicate with them.
31-
- Other non Azure resources such as SerpAPI etc. If you have strict outbound rule, you need add FQDN rule to access them.
25+
### Core Azure Machine Learning services
3226

33-
## Options in different network set up
27+
- **Workspace**: Configure the Azure Machine Learning workspace as private and restrict its inbound and outbound traffic.
28+
- **Compute resource**: Apply inbound and outbound rules to limit compute resource access within the workspace.
29+
- **Storage account**: Restrict storage account accessibility to a specific virtual network.
30+
- **Container registry**: Secure your container registry using virtual network configuration.
31+
- **Endpoint**: Control which Azure services or IP addresses can access your deployed endpoints.
3432

35-
In Azure machine learning, we have two options to secure network isolation, bring your own network or using workspace managed virtual network. Learn more about [Secure workspace resources](../how-to-network-isolation-planning.md).
33+
### Azure AI Services
3634

37-
Here is table to illustrate the options in different network set up for prompt flow.
35+
- **Azure OpenAI**: Use network configuration to make Azure OpenAI private, then use private endpoints for Azure Machine Learning communication.
36+
- **Azure Content Safety**: Configure private network access and establish private endpoints for secure communication.
37+
- **Azure AI Search**: Enable private network settings and use private endpoints for secure integration.
3838

39-
|Ingress|Egress |Compute type in authoring |Compute type in inference |Network options for workspace|
40-
|-------|-------|----------------------------------------|---------------------------------------------------------|-----------------------------|
41-
|Public |Public |Serverless (recommend), Compute instance| Managed online endpoint (recommend)|Managed (recommend)|
42-
|Public |Public |Serverless (recommend), Compute instance| K8s online endpoint| Bring you own|
43-
|Private|Public |Serverless (recommend), Compute instance| Managed online endpoint (recommend)|Managed (recommend)|
44-
|Private|Public |Serverless (recommend), Compute instance| K8s online endpoint|Bring you own|
45-
|Public |Private|Serverless (recommend), Compute instance| Managed online endpoint |Managed|
46-
|Private|Private|Serverless (recommend), Compute instance| Managed online endpoint |Managed|
39+
### External resources
4740

48-
- In private VNet scenario, we would recommend to use workspace enabled managed virtual network. It's the easiest way to secure your workspace and related resources.
49-
- You can also have one workspace for prompt flow authoring with your virtual network and another workspace for prompt flow deployment using managed online endpoint with workspace managed virtual network.
50-
- We didn't support mixed using of managed virtual network and bring your own virtual network in single workspace. And as managed online endpoint is support managed virtual network only, you can't deploy prompt flow to managed online endpoint in workspace which enabled bring your own virtual network.
41+
- **Non-Azure resources**: For external APIs like SerpAPI, add FQDN rules to your outbound traffic restrictions to maintain access.
5142

43+
## Options in different network setups
5244

53-
## Secure prompt flow with workspace managed virtual network
45+
In Azure Machine Learning, we have two options to secure network isolation: bring your own network or use a workspace-managed virtual network. Learn more about [Secure workspace resources](../how-to-network-isolation-planning.md).
5446

55-
Workspace managed virtual network is the recommended way to support network isolation in prompt flow. It provides easily configuration to secure your workspace. After you enable managed virtual network in the workspace level, resources related to workspace in the same virtual network, will use the same network setting in the workspace level. You can also configure the workspace to use private endpoint to access other Azure resources such as Azure OpenAI, Azure content safety, and Azure AI Search. You also can configure FQDN rule to approve outbound to non-Azure resources use by your prompt flow such as SerpAPI etc.
47+
Here's a table to illustrate the options in different network setups for prompt flow.
5648

57-
1. Follow [Workspace managed network isolation](../how-to-managed-network.md) to enable workspace managed virtual network.
49+
| Ingress | Egress | Compute type in authoring | Compute type in inference | Network options for workspace |
50+
|---------|---------|------------------------------------------------|-------------------------------------|-------------------------------|
51+
| Public | Public | Serverless (recommended), Compute instance | Managed online endpoint (recommended) | Managed (recommended) |
52+
| Public | Public | Serverless (recommended), Compute instance | K8s online endpoint | Bring your own |
53+
| Private | Public | Serverless (recommended), Compute instance | Managed online endpoint (recommended) | Managed (recommended) |
54+
| Private | Public | Serverless (recommended), Compute instance | K8s online endpoint | Bring your own |
55+
| Public | Private | Serverless (recommended), Compute instance | Managed online endpoint | Managed |
56+
| Private | Private | Serverless (recommended), Compute instance | Managed online endpoint | Managed |
57+
58+
- In private virtual network scenarios, we recommend using a workspace-enabled managed virtual network. It's the easiest way to secure your workspace and related resources.
59+
- The use of managed vNet and bring your own virtual network in a single workspace isn't supported. Additionally, since managed online endpoint is supported only with a managed virtual network, you can't deploy prompt flow to managed online endpoint in a workspace with an enabled bring your own virtual network.
60+
- You can have one workspace for prompt flow authoring with your own virtual network, and another workspace for prompt flow deployment using a managed online endpoint with a workspace-managed virtual network.
61+
62+
## Secure prompt flow with workspace-managed virtual network
63+
64+
A workspace-managed virtual network is the recommended way to support network isolation in prompt flow. It provides an easy configuration to secure your workspace. After you enable managed vNet at the workspace level, resources related to the workspace in the same virtual network will use the same network settings at the workspace level. You can also configure the workspace to use private endpoints to access other Azure resources such as Azure OpenAI, Azure content safety, and Azure AI Search. You can also configure FQDN rules to approve outbound connections to non-Azure resources used by your prompt flow such as SerpAPI.
65+
66+
1. Follow [workspace-managed network isolation](../how-to-managed-network.md) to enable workspace-managed virtual network.
5867

5968
> [!IMPORTANT]
60-
> The creation of the managed virtual network is deferred until a compute resource is created or provisioning is manually started. You can use following command to manually trigger network provisioning.
69+
> The creation of the managed virtual network is deferred until a compute resource is created or provisioning is manually started. You can use the following command to manually trigger network provisioning.
6170
```bash
6271
az ml workspace provision-network --subscription <sub_id> -g <resource_group_name> -n <workspace_name>
6372
```
6473

65-
2. Add workspace MSI as `Storage File Data Privileged Contributor` to storage account linked with workspace.
74+
2. Add workspace MSI as `Storage File Data Privileged Contributor` to the storage account linked with the workspace.
6675

67-
2.1 Go to Azure portal, find the workspace.
76+
2.1 Go to Azure portal and find the workspace.
6877

6978
:::image type="content" source="./media/how-to-secure-prompt-flow/go-to-azure-portal.png" alt-text="Diagram showing how to go from Azure Machine Learning portal to Azure portal." lightbox = "./media/how-to-secure-prompt-flow/go-to-azure-portal.png":::
7079

71-
72-
2.2 Find the storage account linked with workspace.
80+
2.2 Find the storage account linked with the workspace.
7381

7482
:::image type="content" source="./media/how-to-secure-prompt-flow/linked-storage.png" alt-text="Diagram showing how to find workspace linked storage account in Azure portal." lightbox = "./media/how-to-secure-prompt-flow/linked-storage.png":::
7583

76-
2.3 Jump to role assignment page of storage account.
84+
2.3 Navigate to the role assignment page of the storage account.
7785

7886
:::image type="content" source="./media/how-to-secure-prompt-flow/add-role-storage.png" alt-text="Diagram showing how to jump to role assignment of storage account." lightbox = "./media/how-to-secure-prompt-flow/add-role-storage.png":::
7987

80-
2.4 Find storage file data privileged contributor role.
88+
2.4 Find the storage file data privileged contributor role.
8189

8290
:::image type="content" source="./media/how-to-secure-prompt-flow/storage-file-data-privileged-contributor.png" alt-text="Diagram showing how to find storage file data privileged contributor role." lightbox = "./media/how-to-secure-prompt-flow/storage-file-data-privileged-contributor.png":::
8391

84-
2.5 Assign storage file data privileged contributor role to workspace managed identity.
92+
2.5 Assign the storage file data privileged contributor role to the workspace managed identity.
8593

8694
:::image type="content" source="./media/how-to-secure-prompt-flow/managed-identity-workspace.png" alt-text="Diagram showing how to assign storage file data privileged contributor role to workspace managed identity." lightbox = "./media/how-to-secure-prompt-flow/managed-identity-workspace.png":::
8795

8896
> [!NOTE]
8997
> This operation might take several minutes to take effect.
9098

91-
3. If you want to communicate with [private Azure Cognitive Services](/azure/ai-services/cognitive-services-virtual-networks), you need to add related user defined outbound rules to related resource. The Azure Machine Learning workspace creates private endpoint in the related resource with auto approve. If the status is stuck in pending, go to related resource to approve the private endpoint manually.
99+
3. If you want to communicate with [private Azure AI Services](/azure/ai-services/cognitive-services-virtual-networks), you need to add related user-defined outbound rules to the related resource. The Azure Machine Learning workspace creates a private endpoint in the related resource with autoapproval. If the status is stuck in pending, go to the related resource to approve the private endpoint manually.
92100

93-
:::image type="content" source="./media/how-to-secure-prompt-flow/outbound-rule-cognitive-services.png" alt-text="Screenshot of user defined outbound rule for Azure Cognitive Services." lightbox = "./media/how-to-secure-prompt-flow/outbound-rule-cognitive-services.png":::
101+
:::image type="content" source="./media/how-to-secure-prompt-flow/outbound-rule-cognitive-services.png" alt-text="Screenshot of user defined outbound rule for Azure AI Services." lightbox = "./media/how-to-secure-prompt-flow/outbound-rule-cognitive-services.png":::
94102

95103
:::image type="content" source="./media/how-to-secure-prompt-flow/outbound-private-endpoint-approve.png" alt-text="Screenshot of user approve private endpoint." lightbox = "./media/how-to-secure-prompt-flow/outbound-private-endpoint-approve.png":::
96104

97105
4. If you're restricting outbound traffic to only allow specific destinations, you must add a corresponding user-defined outbound rule to allow the relevant FQDN.
98106
99107
:::image type="content" source="./media/how-to-secure-prompt-flow/outbound-rule-non-azure-resources.png" alt-text="Screenshot of user defined outbound rule for non Azure resource." lightbox = "./media/how-to-secure-prompt-flow/outbound-rule-non-azure-resources.png":::
100108
101-
5. In workspaces that enable managed VNet, you can only deploy prompt flow to managed online endpoint. You can follow [Secure your managed online endpoints with network isolation](../how-to-secure-kubernetes-inferencing-environment.md) to secure your managed online endpoint.
109+
5. In workspaces that enable managed VNet, you can only deploy prompt flow to managed online endpoints. You can follow [Secure your managed online endpoints with network isolation](../how-to-secure-kubernetes-inferencing-environment.md) to secure your managed online endpoint.
102110
103-
## Secure prompt flow use your own virtual network
111+
## Secure prompt flow using your own virtual network
104112
105113
- To set up Azure Machine Learning related resources as private, see [Secure workspace resources](../how-to-secure-workspace-vnet.md).
106-
- If you have strict outbound rule, make sure you have open the [Required public internet access](../how-to-secure-workspace-vnet.md#required-public-internet-access).
107-
- Add workspace MSI as `Storage File Data Privileged Contributor` to storage account linked with workspace. Please follow step 2 in [Secure prompt flow with workspace managed virtual network](#secure-prompt-flow-with-workspace-managed-virtual-network).
108-
- If you are using serverless compute type in flow authoring, you need set the custom virtual network in workspace level. Learn more about [Secure an Azure Machine Learning training environment with virtual networks](../how-to-secure-training-vnet.md)
114+
- If you have strict outbound rules, make sure you have opened the [Required public internet access](../how-to-secure-workspace-vnet.md#required-public-internet-access).
115+
- Add workspace MSI as `Storage File Data Privileged Contributor` to the storage account linked with the workspace. Follow step 2 in [Secure prompt flow with workspace managed vNet](#secure-prompt-flow-with-workspace-managed-virtual-network).
116+
- If you're using serverless compute type in flow authoring, you need to set the custom virtual network at the workspace level. Learn more about [Secure an Azure Machine Learning training environment with virtual networks](../how-to-secure-training-vnet.md)
109117

110118
```yaml
111119
serverless_compute:
112120
custom_subnet: /subscriptions/<sub id>/resourceGroups/<resource group>/providers/Microsoft.Network/virtualNetworks/<vnet name>/subnets/<subnet name>
113121
no_public_ip: false # Set to true if you don't want to assign public IP to the compute
114122
```
115123

116-
- Meanwhile, you can follow [private Azure Cognitive Services](/azure/ai-services/cognitive-services-virtual-networks) to make them as private.
117-
- If you want to deploy prompt flow in workspace which secured by your own virtual network, you can deploy it to AKS cluster which is in the same virtual network. You can follow [Secure Azure Kubernetes Service inferencing environment](../how-to-secure-kubernetes-inferencing-environment.md) to secure your AKS cluster. Learn more about [How to deploy prompt flow to ASK cluster via code](./how-to-deploy-to-code.md).
118-
- You can either create private endpoint to the same virtual network or leverage virtual network peering to make them communicate with each other.
124+
- Meanwhile, you can follow [private Azure AI Services](/azure/ai-services/cognitive-services-virtual-networks) to make them private.
125+
- If you want to deploy prompt flow in a workspace that is secured by your own virtual network, you can deploy it to an AKS cluster that is in the same virtual network. You can follow [Secure Azure Kubernetes Service inferencing environment](../how-to-secure-kubernetes-inferencing-environment.md) to secure your AKS cluster. Learn more about [How to deploy prompt flow to AKS cluster via code](./how-to-deploy-to-code.md).
126+
- You can either create a private endpoint to the same virtual network or use virtual network peering to make them communicate with each other.
119127

120128
## Known limitations
121129

122-
- Azure AI Foundry doesn't support bring your own virtual network, it only supports workspace managed virtual network.
123-
- Managed online endpoint with selected egress only supports workspace with managed virtual network. If you want to use your own virtual network, you might need one workspace for prompt flow authoring with your virtual network and another workspace for prompt flow deployment using managed online endpoint with workspace managed virtual network.
130+
- Managed online endpoints with selected egress require a workspace with managed vNet. If you're using your own virtual network, consider this two-workspace approach:
131+
- Use one workspace with your virtual network for prompt flow authoring
132+
- Use a separate workspace with managed vNet for prompt flow deployment via managed online endpoint
124133
125134
## Next steps
126135

0 commit comments

Comments
 (0)