Skip to content

Commit ccdc9df

Browse files
Merge pull request #281622 from halkazwini/nw-nsgflow
Updates
2 parents f5f327a + e44e1ca commit ccdc9df

File tree

8 files changed

+51
-46
lines changed

8 files changed

+51
-46
lines changed
-7.6 KB
Loading
45 KB
Loading
8.73 KB
Loading
51.8 KB
Loading
51.9 KB
Loading
-4.29 KB
Loading
207 KB
Loading

articles/network-watcher/nsg-flow-logs-portal.md

Lines changed: 51 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: halkazwini
66
ms.author: halkazwini
77
ms.service: network-watcher
88
ms.topic: how-to
9-
ms.date: 05/30/2024
9+
ms.date: 07/24/2024
1010

1111
#CustomerIntent: As an Azure administrator, I want to log my virtual network IP traffic using Network Watcher NSG flow logs so that I can analyze it later.
1212
---
@@ -25,14 +25,16 @@ In this article, you learn how to create, change, disable, or delete an NSG flow
2525

2626
- A network security group. If you need to create a network security group, see [Create, change, or delete a network security group](../virtual-network/manage-network-security-group.md?tabs=network-security-group-portal).
2727

28-
- An Azure storage account. If you need to create a storage account, see [Create a storage account using PowerShell](../storage/common/storage-account-create.md?tabs=azure-portal).
28+
- An Azure storage account. If you need to create a storage account, see [Create a storage account using the Azure portal](../storage/common/storage-account-create.md?tabs=azure-portal).
2929

3030
## Register Insights provider
3131

3232
*Microsoft.Insights* provider must be registered to successfully log traffic flowing through a network security group. If you aren't sure if the *Microsoft.Insights* provider is registered, you can check its status by following these steps:
3333

3434
1. In the search box at the top of the portal, enter *subscriptions*. Select **Subscriptions** from the search results.
3535

36+
:::image type="content" source="./media/nsg-flow-logs-portal/subscriptions.png" alt-text="Screenshot that shows how to search for Subscriptions in the Azure portal." lightbox="./media/nsg-flow-logs-portal/subscriptions.png":::
37+
3638
1. Select the Azure subscription that you want to enable the provider for in **Subscriptions**.
3739

3840
1. Under **Settings**, select **Resource providers**.
@@ -55,74 +57,74 @@ Create a flow log for your network security group. This NSG flow log is saved in
5557

5658
:::image type="content" source="./media/nsg-flow-logs-portal/flow-logs.png" alt-text="Screenshot of Flow logs page in the Azure portal." lightbox="./media/nsg-flow-logs-portal/flow-logs.png":::
5759

58-
1. Enter or select the following values in **Create a flow log**:
60+
1. On the **Basics** tab of **Create a flow log**, enter or select the following values:
5961

6062
| Setting | Value |
6163
| ------- | ----- |
6264
| **Project details** | |
6365
| Subscription | Select the Azure subscription of your network security group that you want to log. |
64-
| Network security group | Select **+ Select resource**. <br> In **Select network security group**, select **myNSG**. Then, select **Confirm selection**. |
65-
| Flow Log Name | Enter a name for the flow log or leave the default name. **myNSG-myResourceGroup-flowlog** is the default name for this example. |
66+
| Flow log type | Select **Network security group** then select **+ Select target resource**. <br> Select the network security group that you want to flow log, then select **Confirm selection**. |
67+
| Flow Log Name | Enter a name for the flow log or leave the default name. Azure portal uses ***{ResourceName}-{ResourceGroupName}-flowlog*** as a default name for the flow log. **myNSG-myResourceGroup-flowlog** is the default name used in this article. |
6668
| **Instance details** | |
6769
| Subscription | Select the Azure subscription of your storage account. |
68-
| Storage Accounts | Select the storage account that you want to save the flow logs to. If you want to create a new storage account, select **Create a new storage account**. |
69-
| Retention (days) | Enter a retention time for the logs. Enter *0* if you want to retain the flow logs data in the storage account forever (until you delete it from the storage account). For information about pricing, see [Azure Storage pricing](https://azure.microsoft.com/pricing/details/storage/). |
70+
| Storage accounts | Select the storage account that you want to save the flow logs to. If you want to create a new storage account, select **Create a new storage account**. |
71+
| Retention (days) | Enter a retention time for the logs (this option is only available with [Standard general-purpose v2](../storage/common/storage-account-overview.md?toc=/azure/network-watcher/toc.json#types-of-storage-accounts) storage accounts). Enter *0* if you want to retain the flow logs data in the storage account forever (until you delete it from the storage account). For information about pricing, see [Azure Storage pricing](https://azure.microsoft.com/pricing/details/storage/). |
7072

7173
:::image type="content" source="./media/nsg-flow-logs-portal/create-nsg-flow-log.png" alt-text="Screenshot of creating an NSG flow log in the Azure portal.":::
7274

7375
> [!NOTE]
74-
> If the storage account is in a different subscription, the network security group and storage account must be associated with the same Azure Active Directory tenant. The account you use for each subscription must have the [necessary permissions](required-rbac-permissions.md).
76+
> If the storage account is in a different subscription, the network security group and storage account must be associated with the same Microsoft Entra tenant. The account you use for each subscription must have the [necessary permissions](required-rbac-permissions.md).
77+
78+
1. To enable traffic analytics, select **Next: Analytics** button, or select the **Analytics** tab. Enter or select the following values:
79+
80+
| Setting | Value |
81+
| ------- | ----- |
82+
| Flow logs version | Select the version of the network security group flow log, available options are: **Version 1** and **Version 2**. The default version is version 2. For more information, see [Flow logging for network security groups](nsg-flow-logs-overview.md). |
83+
| Enable traffic analytics | Select the checkbox to enable traffic analytics for your flow log. |
84+
| Traffic analytics processing interval | Select the processing interval that you prefer, available options are: **Every 1 hour** and **Every 10 mins**. The default processing interval is every one hour. For more information, see [Traffic analytics](traffic-analytics.md). |
85+
| Subscription | Select the Azure subscription of your Log Analytics workspace. |
86+
| Log Analytics Workspace | Select your Log Analytics workspace. By default, Azure portal creates ***DefaultWorkspace-{SubscriptionID}-{Region}*** Log Analytics workspace in ***defaultresourcegroup-{Region}*** resource group. |
87+
88+
:::image type="content" source="./media/nsg-flow-logs-portal/create-nsg-flow-log-analytics.png" alt-text="Screenshot that shows how to enable traffic analytics for a new flow log in the Azure portal.":::
89+
90+
> [!NOTE]
91+
> To create and select a Log Analytics workspace other than the default one, see [Create a Log Analytics workspace](../azure-monitor/logs/quick-create-workspace.md?toc=/azure/network-watcher/toc.json)
7592
7693
1. Select **Review + create**.
7794

7895
1. Review the settings, and then select **Create**.
7996

80-
## Create a flow log and traffic analytics workspace
97+
## Enable or disable traffic analytics
8198

82-
Create a flow log for your network security group and enable traffic analytics. The NSG flow log is saved in an Azure storage account.
99+
Enable traffic analytics for a flow log to analyze the flow log data. Traffic analytics provides insights into your traffic patterns. You can enable or disable traffic analytics for a flow log at any time.
100+
101+
To enable traffic analytics for a flow log, follow these steps:
83102

84103
1. In the search box at the top of the portal, enter *network watcher*. Select **Network Watcher** from the search results.
85104

86105
1. Under **Logs**, select **Flow logs**.
87106

88-
1. In **Network Watcher | Flow logs**, select **+ Create** or **Create flow log** blue button.
89-
90-
:::image type="content" source="./media/nsg-flow-logs-portal/flow-logs.png" alt-text="Screenshot of Flow logs page in the Azure portal." lightbox="./media/nsg-flow-logs-portal/flow-logs.png":::
91-
92-
1. Enter or select the following values in **Create a flow log**:
107+
1. In **Network Watcher | Flow logs**, select the flow log that you want to enable traffic analytics for.
93108

94-
| Setting | Value |
95-
| ------- | ----- |
96-
| **Project details** | |
97-
| Subscription | Select the Azure subscription of your network security group that you want to log. |
98-
| Network security group | Select **+ Select resource**. <br> In **Select network security group**, select **myNSG**. Then, select **Confirm selection**. |
99-
| Flow Log Name | Enter a name for the flow log or leave the default name. By default, Azure portal creates *{network-security-group}-{resource-group}-flowlog* flow log in **NetworkWatcherRG** resource group. |
100-
| **Instance details** | |
101-
| Subscription | Select the Azure subscription of your storage account. |
102-
| Storage Accounts | Select the storage account that you want to save the flow logs to. If you want to create a new storage account, select **Create a new storage account**. |
103-
| Retention (days) | Enter a retention time for the logs. Enter *0* if you want to retain the flow logs data in the storage account forever (until you delete it from the storage account). For information about pricing, see [Azure Storage pricing](https://azure.microsoft.com/pricing/details/storage/). |
104-
105-
:::image type="content" source="./media/nsg-flow-logs-portal/create-nsg-flow-log-basics.png" alt-text="Screenshot of the Basics tab of Create a flow log in the Azure portal.":::
109+
1. In **Flow logs settings**, check the **Enable traffic analytics** checkbox.
106110

107-
> [!NOTE]
108-
> If the storage account is in a different subscription, the network security group and storage account must be associated with the same Azure Active Directory tenant. The account you use for each subscription must have the [necessary permissions](required-rbac-permissions.md).
111+
:::image type="content" source="./media/nsg-flow-logs-portal/enable-traffic-analytics.png" alt-text="Screenshot that shows how to enable traffic analytics for an existing flow log in the Azure portal." lightbox="./media/nsg-flow-logs-portal/enable-traffic-analytics.png":::
109112

110-
1. Select **Next: Analytics** button, or select **Analytics** tab. Then enter or select the following values:
113+
1. Select the following values:
111114

112115
| Setting | Value |
113116
| ------- | ----- |
114-
| Flow Logs Version | Select the flow log version. Version 2 is selected by default when you create a flow log using the Azure portal. For more information about flow logs versions, see [Log format of NSG flow logs](nsg-flow-logs-overview.md#log-format). |
115-
| **Traffic Analytics** | |
116-
| Enable Traffic Analytics | Select the checkbox to enable traffic analytics for your flow log. |
117-
| Traffic Analytics processing interval | Select the processing interval that you prefer, available options are: **Every 1 hour** and **Every 10 mins**. The default processing interval is every one hour. For more information, see [Traffic Analytics](traffic-analytics.md). |
118117
| Subscription | Select the Azure subscription of your Log Analytics workspace. |
119-
| Log Analytics Workspace | Select your Log Analytics workspace. By default, Azure portal creates and selects *DefaultWorkspace-{subscription-id}-{region}* Log Analytics workspace in *defaultresourcegroup-{Region}* resource group. |
118+
| Log Analytics workspace | Select your Log Analytics workspace. By default, Azure portal creates ***DefaultWorkspace-{SubscriptionID}-{Region}*** Log Analytics workspace in ***defaultresourcegroup-{Region}*** resource group. |
119+
| Traffic logging interval | Select the processing interval that you prefer, available options are: **Every 1 hour** and **Every 10 mins**. The default processing interval is every one hour. For more information, see [Traffic analytics](traffic-analytics.md). |
120120

121-
:::image type="content" source="./media/nsg-flow-logs-portal/enable-traffic-analytics.png" alt-text="Screenshot of enabling traffic analytics for a flow log in the Azure portal.":::
121+
:::image type="content" source="./media/nsg-flow-logs-portal/enable-traffic-analytics-settings.png" alt-text="Screenshot that shows configurations of traffic analytics for an existing flow log in the Azure portal." lightbox="./media/nsg-flow-logs-portal/enable-traffic-analytics-settings.png":::
122122

123-
1. Select **Review + create**.
123+
1. Select **Save** to apply the changes.
124124

125-
1. Review the settings, and then select **Create**.
125+
To disable traffic analytics for a flow log, take the previous steps 1-3, then uncheck the **Enable traffic analytics** checkbox and select **Save**.
126+
127+
:::image type="content" source="./media/nsg-flow-logs-portal/disable-traffic-analytics.png" alt-text="Screenshot that shows how to disable traffic analytics for an existing flow log in the Azure portal." lightbox="./media/nsg-flow-logs-portal/disable-traffic-analytics.png":::
126128

127129
## Change a flow log
128130

@@ -136,14 +138,17 @@ You can change the properties of a flow log after you create it. For example, yo
136138

137139
1. In **Flow logs settings**, you can change any of the following settings:
138140

139-
- **Flow Logs Version**: Change the flow log version. Available versions are: version 1 and version 2. Version 2 is selected by default when you create a flow log using the Azure portal. For more information about flow logs versions, see [Log format of NSG flow logs](nsg-flow-logs-overview.md#log-format).
140-
- **Storage Account**: Change the storage account that you want to save the flow logs to. If you want to create a new storage account, select **Create a new storage account**.
141-
- **Retention (days)**: Change the retention time in the storage account. Enter *0* if you want to retain the flow logs data in the storage account forever (until you manually delete the data from the storage account).
142-
- **Traffic Analytics**: Enable or disable traffic analytics for your flow log. For more information, see [Traffic Analytics](traffic-analytics.md).
143-
- **Traffic Analytics processing interval**: Change the processing interval of traffic analytics (if traffic analytics is enabled). Available options are: one hour and 10 minutes. The default processing interval is every one hour. For more information, see [Traffic Analytics](traffic-analytics.md).
144-
- **Log Analytics workspace**: Change the Log Analytics workspace that you want to save the flow logs to (if traffic analytics is enabled).
145-
146-
:::image type="content" source="./media/nsg-flow-logs-portal/change-flow-log.png" alt-text="Screenshot of Flow logs settings page in the Azure portal where you can change some settings." lightbox="./media/nsg-flow-logs-portal/change-flow-log.png":::
141+
| Setting | Value |
142+
| ------- | ----- |
143+
| **Storage account** | |
144+
| Subscription | Change the Azure subscription of the storage account that you want to use. |
145+
| Storage account | Change the storage account that you want to save the flow logs to. If you want to create a new storage account, select **Create a new storage account**. |
146+
| Retention (days) | Change the retention time in the storage account. Enter *0* if you want to retain the flow logs data in the storage account forever (until you manually delete the data from the storage account). |
147+
| **Traffic analytics** | |
148+
| Enable traffic analytics | Enable or disable traffic analytics by checking or unchecking the checkbox. |
149+
| Subscription | Change the Azure subscription of the Log Analytics workspace that you want to use. |
150+
| Log analytics workspace | Change the Log Analytics workspace that you want to save the flow logs to (if traffic analytics is enabled). |
151+
| Traffic logging interval | Change the processing interval of traffic analytics (if traffic analytics is enabled). Available options are: one hour and 10 minutes. The default processing interval is every one hour. For more information, see [Traffic Analytics](traffic-analytics.md). |
147152

148153
## List all flow logs
149154

0 commit comments

Comments
 (0)