Skip to content

Commit fcde54b

Browse files
committed
screenshots and tweaks
1 parent d06fd2b commit fcde54b

File tree

5 files changed

+37
-35
lines changed

5 files changed

+37
-35
lines changed
67.8 KB
Loading
135 KB
Loading
114 KB
Loading
40.1 KB
Loading

articles/network-watcher/vnet-flow-logs-tutorial.md

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Virtual network flow logging is a feature of Azure Network Watcher that allows y
1717

1818
This tutorial helps you use VNet flow logs to log a virtual machine's network traffic that flows through the virtual network.
1919

20-
:::image type="content" source="./media/nsg-flow-logs-tutorial/nsg-flow-logs-tutorial-diagram.png" alt-text="Diagram shows the resources created during the tutorial.":::
20+
:::image type="content" source="./media/vnet-flow-logs-tutorial/flow-logs-tutorial-diagram.png" alt-text="Diagram shows the resources created during the tutorial.":::
2121

2222
In this tutorial, you learn how to:
2323

@@ -64,7 +64,7 @@ In this section, you create **myVM** virtual machine.
6464

6565
1. In the search box at the top of the portal, enter ***virtual machines***. Select **Virtual machines** from the search results.
6666

67-
1. Select **+ Create** and then select **Azure virtual machine**.
67+
1. Select **+ Create** and then select **Virtual machine**.
6868

6969
1. In **Create a virtual machine**, enter or select the following values in the **Basics** tab:
7070

@@ -78,8 +78,8 @@ In this section, you create **myVM** virtual machine.
7878
| Region | Select **(US) East US**. |
7979
| Availability Options | Select **No infrastructure redundancy required**. |
8080
| Security type | Select **Standard**. |
81-
| Image | Select **Windows Server 2022 Datacenter: Azure Edition - x64 Gen2**. |
82-
| Size | Choose a size or leave the default setting. |
81+
| Image | Select the image that you prefer. This tutorial uses **Windows Server 2022 Datacenter: Azure Edition - x64 Gen2**. |
82+
| Size | Choose a VM size or leave the default setting. |
8383
| **Administrator account** | |
8484
| Username | Enter a username. |
8585
| Password | Enter a password. |
@@ -116,7 +116,7 @@ In this section, you create **myVM** virtual machine.
116116

117117
## Register Insights provider
118118

119-
NSG flow logging requires the **Microsoft.Insights** provider. To check its status, follow these steps:
119+
Flow logging requires the **Microsoft.Insights** provider. To check its status, follow these steps:
120120

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

@@ -144,16 +144,17 @@ In this section, you create a storage account to use it to store the flow logs.
144144
| Subscription | Select your Azure subscription. |
145145
| Resource Group | Select **myResourceGroup**. |
146146
| **Instance details** | |
147-
| Storage account name | Enter a unique name. This tutorial uses **mynwstorageaccount**. |
147+
| Storage account name | Enter a unique name. This tutorial uses **nwteststorageaccount**. |
148148
| Region | Select **(US) East US**. The storage account must be in the same region as the virtual machine and its network security group. |
149-
| Performance | Select **Standard**. NSG flow logs only support Standard-tier storage accounts. |
150-
| Redundancy | Select **Locally-redundant storage (LRS)** or different replication strategy that matches your durability requirements. |
149+
| Primary service | Select **Azure Blob Storage or Azure Data Lake Storage Gen 2**. |
150+
| Performance | Select **Standard**. Flow logs only support Standard-tier storage accounts. |
151+
| Redundancy | Select the redundancy you prefer. This tutorial uses **Locally-redundant storage (LRS)**. |
151152

152153
1. Select the **Review** tab or select the **Review** button at the bottom.
153154

154155
1. Review the settings, and then select **Create**.
155156

156-
## Create an NSG flow log
157+
## Create a flow log
157158

158159
In this section, you create an NSG flow log that's saved into the storage account created previously in the tutorial.
159160

@@ -171,25 +172,26 @@ In this section, you create an NSG flow log that's saved into the storage accoun
171172
| ------- | ----- |
172173
| **Project details** | |
173174
| Subscription | Select the Azure subscription of your network security group that you want to log. |
174-
| Network security group | Select **+ Select resource**. <br> In **Select network security group**, select **myVM-nsg**. Then, select **Confirm selection**. |
175-
| Flow Log Name | Leave the default of **myVM-nsg-myResourceGroup-flowlog**. |
175+
| Flow log type | Select **Virtual network**. |
176+
| Virtual Network | Select **+ Select target resource**. <br> In **Select virtual network**, select **myVNet**. Then, select **Confirm selection**. |
177+
| Flow Log Name | Leave the default of **myVNet-myresourcegroup-flowlog**. |
176178
| **Instance details** | |
177179
| Subscription | Select the Azure subscription of your storage account. |
178-
| Storage Accounts | Select the storage account you created in the previous steps. This tutorial uses **mynwstorageaccount**. |
179-
| Retention (days) | Enter ***0*** to retain the flow logs data in the storage account forever (until you delete it from the storage account). To apply a retention policy, enter the retention time in days. For information about storage pricing, see [Azure Storage pricing](https://azure.microsoft.com/pricing/details/storage/). |
180+
| Storage accounts | Select the storage account you created in the previous steps. |
181+
| Retention (days) | Enter ***10*** to retain the flow logs data in the storage account for 10 days. To keep the flow logs data in the storage account forever (until you delete it), enter ***0***. For information about storage pricing, see [Azure Storage pricing](https://azure.microsoft.com/pricing/details/storage/). |
180182

181-
:::image type="content" source="./media/nsg-flow-logs-tutorial/create-nsg-flow-log.png" alt-text="Screenshot of create NSG flow log page in the Azure portal.":::
183+
:::image type="content" source="./media/vnet-flow-logs-tutorial/create-vnet-flow-log.png" alt-text="Screenshot of create a flow log page in the Azure portal." lightbox="./media/vnet-flow-logs-tutorial/create-vnet-flow-log.png":::
182184

183185
> [!NOTE]
184-
> The Azure portal creates NSG flow logs in the **NetworkWatcherRG** resource group.
186+
> The Azure portal creates virtual network flow logs in the **NetworkWatcherRG** resource group.
185187
186188
1. Select **Review + create**.
187189

188190
1. Review the settings, and then select **Create**.
189191

190192
1. Once the deployment is complete, select **Go to resource** to confirm the flow log created and listed in the **Flow logs** page.
191193

192-
:::image type="content" source="./media/nsg-flow-logs-tutorial/flow-logs-list.png" alt-text="Screenshot of Flow logs page in the Azure portal showing the newly created flow log." lightbox="./media/nsg-flow-logs-tutorial/flow-logs-list.png":::
194+
:::image type="content" source="./media/vnet-flow-logs-tutorial/flow-logs-list.png" alt-text="Screenshot of Flow logs page in the Azure portal showing the newly created flow log." lightbox="./media/vnet-flow-logs-tutorial/flow-logs-list.png":::
193195

194196
1. Go back to your RDP session with **myVM** virtual machine.
195197

@@ -201,21 +203,21 @@ In this section, you go to the storage account you previously selected and downl
201203

202204
1. In the search box at the top of the portal, enter ***storage accounts***. Select **Storage accounts** from the search results.
203205

204-
2. Select **mynwstorageaccount** or the storage account you previously created and selected to store the logs.
206+
2. Select **nwteststorageaccount** or the storage account you previously created and selected to store the logs.
205207

206208
3. Under **Data storage**, select **Containers**.
207209

208-
4. Select the **insights-logs-networksecuritygroupflowevent** container.
210+
4. Select the **insights-logs-flowlogflowevent** container.
209211

210-
5. In the container, navigate the folder hierarchy until you get to the `PT1H.json` file. NSG log files are written to a folder hierarchy that follows the following naming convention:
212+
5. In the container, navigate the folder hierarchy until you get to the `PT1H.json` file that you want to download. Virtual network flow log files follow the following path::
211213

212214
```
213-
https://{storageAccountName}.blob.core.windows.net/insights-logs-networksecuritygroupflowevent/resourceId=/SUBSCRIPTIONS/{subscriptionID}/RESOURCEGROUPS/{resourceGroupName}/PROVIDERS/MICROSOFT.NETWORK/NETWORKSECURITYGROUPS/{networSecurityGroupName}/y={year}/m={month}/d={day}/h={hour}/m=00/macAddress={acAddress}/PT1H.json
215+
https://{storageAccountName}.blob.core.windows.net/insights-logs-flowlogflowevent/flowLogResourceID=/{subscriptionID}_NETWORKWATCHERRG/NETWORKWATCHER_{Region}_{ResourceName}-{ResourceGroupName}-FLOWLOGS/y={year}/m={month}/d={day}/h={hour}/m=00/macAddress={macAddress}/PT1H.json
214216
```
215217
216218
6. Select the ellipsis **...** to the right of the PT1H.json file, then select **Download**.
217219
218-
:::image type="content" source="./media/nsg-flow-logs-tutorial/nsg-log-file.png" alt-text="Screenshot showing how to download nsg flow log from the storage account container in the Azure portal." lightbox="./media/nsg-flow-logs-tutorial/nsg-log-file.png":::
220+
:::image type="content" source="./media/vnet-flow-logs-tutorial/flow-log-file.png" alt-text="Screenshot showing how to download VNet flow log data from the storage account in the Azure portal." lightbox="./media/vnet-flow-logs-tutorial/flow-log-file.png":::
219221
220222
> [!NOTE]
221223
> You can use Azure Storage Explorer to access and download flow logs from your storage account. Fore more information, see [Get started with Storage Explorer](../vs-azure-tools-storage-manage-with-storage-explorer.md).
@@ -226,22 +228,22 @@ Open the downloaded `PT1H.json` file using a text editor of your choice. The fol
226228
227229
```json
228230
{
229-
"time": "2023-02-26T23:45:44.1503927Z",
230-
"systemId": "00000000-0000-0000-0000-000000000000",
231+
"time": "2025-08-06T20:39:33.3186341Z",
232+
"flowLogGUID": "00000000-0000-0000-0000-000000000000",
231233
"macAddress": "112233445566",
232-
"category": "NetworkSecurityGroupFlowEvent",
233-
"resourceId": "/SUBSCRIPTIONS/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/RESOURCEGROUPS/MYRESOURCEGROUP/PROVIDERS/MICROSOFT.NETWORK/NETWORKSECURITYGROUPS/MYVM-NSG",
234-
"operationName": "NetworkSecurityGroupFlowEvents",
235-
"properties": {
236-
"Version": 2,
234+
"category": "FlowLogFlowEvent",
235+
"resourceId": "/SUBSCRIPTIONS/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e//RESOURCEGROUPS/NETWORKWATCHERRG/PROVIDERS/MICROSOFT.NETWORK/NETWORKWATCHERS/NETWORKWATCHER_EASTUS/FLOWLOGS/MYVNET-MYRESOURCEGROUP-FLOWLOG",
236+
"flowLogVersion": 4,
237+
"operationName": "FlowLogFlowEvent",
238+
"flowRecords": {
237239
"flows": [
238240
{
239-
"rule": "DefaultRule_AllowInternetOutBound",
240-
"flows": [
241-
{
242-
"mac": "112233445566",
241+
"aclID": "00000000-0000-0000-0000-000000000000",
242+
"flowGroups": [
243+
{
244+
"rule": "DefaultRule_AllowInternetOutBound",
243245
"flowTuples": [
244-
"1677455097,10.0.0.4,13.107.21.200,49982,443,T,O,A,C,7,1158,12,8143"
246+
"1754512773,10.0.0.4,13.107.21.200,49982,443,T,O,A,C,7,1158,12,8143"
245247
]
246248
}
247249
]
@@ -255,7 +257,7 @@ The comma-separated information for **flowTuples** is as follows:
255257

256258
| Example data | What data represents | Explanation |
257259
| ------------ | -------------------- | ---------- |
258-
| 1677455097 | Time stamp | The time stamp of when the flow occurred in UNIX EPOCH format. In the previous example, the date converts to February 26, 2023 11:44:57 PM UTC/GMT. |
260+
| 1754512773 | Time stamp | The time stamp of when the flow occurred in UNIX EPOCH format. In the previous example, the date converts to February 26, 2023 11:44:57 PM UTC/GMT. |
259261
| 10.0.0.4 | Source IP address | The source IP address that the flow originated from. 10.0.0.4 is the private IP address of the VM you previously created.
260262
| 13.107.21.200 | Destination IP address | The destination IP address that the flow was destined to. 13.107.21.200 is the IP address of `www.bing.com`. Since the traffic is destined outside Azure, the security rule **DefaultRule_AllowInternetOutBound** processed the flow. |
261263
| 49982 | Source port | The source port that the flow originated from. |
@@ -282,7 +284,7 @@ When no longer needed, delete **myResourceGroup** resource group and all of the
282284
1. Select **Delete** to confirm the deletion of the resource group and all its resources.
283285

284286
> [!NOTE]
285-
> The **myVM-nsg-myResourceGroup-flowlog** flow log is in the **NetworkWatcherRG** resource group, but it'll be deleted after deleting the **myVM-nsg** network security group (by deleting the **myResourceGroup** resource group).
287+
> The **NetworkWatcher_eastus/myVNet-myresourcegroup-flowlog** resource is in the **NetworkWatcherRG** resource group, but it'll be deleted after deleting the **myVNet** virtual network (by deleting the **myResourceGroup** resource group).
286288
287289
## Related content
288290

0 commit comments

Comments
 (0)