You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-network-manager/how-to-define-network-group-membership-azure-policy.md
+14-13Lines changed: 14 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,30 +65,31 @@ List of supported operators:
65
65
66
66
## Basic editor
67
67
68
-
Assume you have the following virtual networks in your subscription. Each virtual network has an associated tag named **environment** with the respective value of *Production* or *Test*.
68
+
Assume you have the following virtual networks in your subscription. Each virtual network has an associated tag named **environment** with the respective value of *production* or *test*.
69
69
70
-
|**Virtual Network**|**Tag**|
71
-
| ------------------- | ------- |
72
-
| myVNet01-EastUS |Production|
73
-
| myVNet01-WestUS |Production|
74
-
| myVNet02-WestUS |Test|
75
-
| myVNet03-WestUS |Test|
70
+
|**Virtual Network**|**Tag Name**|**Tag Value**|
71
+
| ------------------- | ------- | ------------ |
72
+
| myVNet01-EastUS |environment | production|
73
+
| myVNet01-WestUS |environment | production|
74
+
| myVNet02-WestUS |environment | test|
75
+
| myVNet03-WestUS |environment | test|
76
76
77
-
You only want to select virtual networks that contain **WestUS**in the name. To begin using the basic editor to create your conditional statement, you need to create a new network group.
77
+
You only want to select virtual networks that whose tag has a key value pair of **environment**equal to **production**. To begin using the basic editor to create your conditional statement, you need to create a new network group.
78
78
79
79
1. Go to your Azure Virtual Network Manager instance and select **Network Groups** under **Settings**. Then select **+ Create** to create a new network group.
80
80
1. Enter a **Name** and an optional **Description** for the network group, and select **Add**.
81
81
1. Select the network group from the list and select **Create Azure Policy**.
82
82
1. Enter a **Policy name** and leave the **Scope** selections unless changes are needed.
83
-
1. Under **Criteria**, select **Name** from the drop-down under **Parameter** and then select **Contains** from the drop-down under *Operator*.
84
-
1. Enter **WestUS** under **Condition** and select **Preview Resources**. You should see myVNet01-WestUS, myVNet02-WestUS, and myVNet03-WestUS show up in the list.
83
+
1. Under **Criteria**, select **Tags** from the drop-down under **Parameter** and then select **Key value pair** from the drop-down under **Operator**.
84
+
1. Enter **environment** and **production** under **Condition** and select **Preview Resources**. You should see myVNet01-EastUS and myVNet01-WestUS show up in the list.
85
+
86
+
:::image type="content" source="media/how-to-define-network-group-membership-azure-policy/add-key-value-pair-tag.png" alt-text="Screenshot of Create Azure Policy window setting tag with key value pair.":::
87
+
85
88
1. Select **Close** and **Save**.
86
-
1. After a few minutes, select your network group and select **Group Members** under **Settings**. You should only see myVNet01-WestUS, myVNet02-WestUS, and myVNet03-WestUS show up in the list.
89
+
1. After a few minutes, select your network group and select **Group Members** under **Settings**. You should only see myVNet01-WestUSand myVNet01-WestUS.
87
90
88
91
> [!IMPORTANT]
89
92
> The **basic editor** is only available during the creation of an Azure Policy. Once a policy is created, all edits will be done using JSON in the **Policies** section of virtual network manager or via Azure Policy.
90
-
>
91
-
> When using the basic editor, your condition options are limited through the portal experience. For complex conditions like creating a network group for VNets based on a [customer-defined tag](#example-3-using-custom-tag-values-with-advanced-editor), you must use the advanced editor. Learn more about [Azure Policy definition structure](../governance/policy/concepts/definition-structure.md).
0 commit comments