Skip to content

Commit 3a610ba

Browse files
Merge pull request #273233 from halkazwini/nw-vnetflow
Spell out VNet flow logs
2 parents e839f89 + f7ea233 commit 3a610ba

9 files changed

+123
-122
lines changed

articles/network-watcher/flow-logs-read.md

Lines changed: 16 additions & 16 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: 04/22/2024
9+
ms.date: 04/24/2024
1010
ms.custom: devx-track-azurepowershell
1111

1212
#CustomerIntent: As an Azure administrator, I want to read my flow logs using a PowerShell script so I can see the latest data.
@@ -24,15 +24,15 @@ The concepts discussed in this article aren't limited to the PowerShell and are
2424

2525
- PowerShell installed on your machine. For more information, see [Install PowerShell on Windows, Linux, and macOS](/powershell/scripting/install/installing-powershell). This article requires the Az PowerShell module. For more information, see [How to install Azure PowerShell](/powershell/azure/install-azure-powershell). To find the installed version, run `Get-Module -ListAvailable Az`.
2626

27-
- Flow logs in a region or more. For more information, see [Create NSG flow logs](nsg-flow-logs-portal.md#create-a-flow-log) or [Create VNet flow logs](vnet-flow-logs-portal.md#create-a-flow-log).
27+
- Flow logs in a region or more. For more information, see [Create network security group flow logs](nsg-flow-logs-portal.md#create-a-flow-log) or [Create virtual network flow logs](vnet-flow-logs-portal.md#create-a-flow-log).
2828

2929
- Necessary RBAC permissions for the subscriptions of flow logs and storage account. For more information, see [Network Watcher RBAC permissions](required-rbac-permissions.md).
3030

3131
## Retrieve the blocklist
3232

33-
# [**NSG flow logs**](#tab/nsg)
33+
# [**Network security group flow logs**](#tab/nsg)
3434

35-
The following PowerShell script sets up the variables needed to query the NSG flow log blob and list the blocks within the [CloudBlockBlob](/dotnet/api/microsoft.azure.storage.blob.cloudblockblob) block blob. Update the script to contain valid values for your environment.
35+
The following PowerShell script sets up the variables needed to query the network security group flow log blob and list the blocks within the [CloudBlockBlob](/dotnet/api/microsoft.azure.storage.blob.cloudblockblob) block blob. Update the script to contain valid values for your environment.
3636

3737
```powershell
3838
function Get-NSGFlowLogCloudBlockBlob {
@@ -48,16 +48,16 @@ function Get-NSGFlowLogCloudBlockBlob {
4848
)
4949
5050
process {
51-
# Retrieve the primary storage account key to access the NSG logs
51+
# Retrieve the primary storage account key to access the network security group logs
5252
$StorageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $storageAccountResourceGroup -Name $storageAccountName).Value[0]
5353
5454
# Setup a new storage context to be used to query the logs
5555
$ctx = New-AzStorageContext -StorageAccountName $StorageAccountName -StorageAccountKey $StorageAccountKey
5656
57-
# Container name used by NSG flow logs
57+
# Container name used by network security group flow logs
5858
$ContainerName = "insights-logs-networksecuritygroupflowevent"
5959
60-
# Name of the blob that contains the NSG flow log
60+
# Name of the blob that contains the network security group flow log
6161
$BlobName = "resourceId=/SUBSCRIPTIONS/${subscriptionId}/RESOURCEGROUPS/${NSGResourceGroupName}/PROVIDERS/MICROSOFT.NETWORK/NETWORKSECURITYGROUPS/${NSGName}/y=$($logTime.Year)/m=$(($logTime).ToString("MM"))/d=$(($logTime).ToString("dd"))/h=$(($logTime).ToString("HH"))/m=00/macAddress=$($macAddress)/PT1H.json"
6262
6363
# Gets the storage blog
@@ -91,9 +91,9 @@ $CloudBlockBlob = Get-NSGFlowLogCloudBlockBlob -subscriptionId "yourSubscription
9191
$blockList = Get-NSGFlowLogBlockList -CloudBlockBlob $CloudBlockBlob
9292
```
9393

94-
# [**VNet flow logs**](#tab/vnet)
94+
# [**Virtual network flow logs**](#tab/vnet)
9595

96-
The following PowerShell script sets up the variables needed to query the VNet flow log blob and list the blocks within the [CloudBlockBlob](/dotnet/api/microsoft.azure.storage.blob.cloudblockblob) block blob. Update the script to contain valid values for your environment.
96+
The following PowerShell script sets up the variables needed to query the virtual network flow log blob and list the blocks within the [CloudBlockBlob](/dotnet/api/microsoft.azure.storage.blob.cloudblockblob) block blob. Update the script to contain valid values for your environment.
9797

9898
```powershell
9999
function Get-VNetFlowLogCloudBlockBlob {
@@ -109,16 +109,16 @@ function Get-VNetFlowLogCloudBlockBlob {
109109
)
110110
111111
process {
112-
# Retrieve the primary storage account key to access the VNet flow logs
112+
# Retrieve the primary storage account key to access the virtual network flow logs
113113
$StorageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $storageAccountResourceGroup -Name $storageAccountName).Value[0]
114114
115115
# Setup a new storage context to be used to query the logs
116116
$ctx = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $StorageAccountKey
117117
118-
# Container name used by VNet flow logs
118+
# Container name used by virtual network flow logs
119119
$ContainerName = "insights-logs-flowlogflowevent"
120120
121-
# Name of the blob that contains the VNet flow log
121+
# Name of the blob that contains the virtual network flow log
122122
$BlobName = "flowLogResourceID=/$($subscriptionId.ToUpper())_NETWORKWATCHERRG/NETWORKWATCHER_$($region.ToUpper())_$($VNetFlowLogName.ToUpper())/y=$($logTime.Year)/m=$(($logTime).ToString("MM"))/d=$(($logTime).ToString("dd"))/h=$(($logTime).ToString("HH"))/m=00/macAddress=$($macAddress)/PT1H.json"
123123
124124
# Gets the storage blog
@@ -174,7 +174,7 @@ ZjAyZTliYWE3OTI1YWZmYjFmMWI0MjJhNzMxZTI4MDM= 2 True
174174

175175
In this section, you read the `$blocklist` variable to retrieve the data. In the following example, we iterate through the blocklist to read the bytes from each block and store them in an array. Use the [DownloadRangeToByteArray](/dotnet/api/microsoft.azure.storage.blob.cloudblob.downloadrangetobytearray) method to retrieve the data.
176176

177-
# [**NSG flow logs**](#tab/nsg)
177+
# [**Network security group flow logs**](#tab/nsg)
178178

179179
```powershell
180180
function Get-NSGFlowLogReadBlock {
@@ -218,7 +218,7 @@ function Get-NSGFlowLogReadBlock {
218218
$valuearray = Get-NSGFlowLogReadBlock -blockList $blockList -CloudBlockBlob $CloudBlockBlob
219219
```
220220

221-
# [**VNet flow logs**](#tab/vnet)
221+
# [**Virtual network flow logs**](#tab/vnet)
222222

223223
```powershell
224224
function Get-VNetFlowLogReadBlock {
@@ -272,7 +272,7 @@ The `$valuearray` array contains now the string value of each block. To verify t
272272

273273
The results of this value are shown in the following example:
274274

275-
# [**NSG flow logs**](#tab/nsg)
275+
# [**Network security group flow logs**](#tab/nsg)
276276

277277
```json
278278
{
@@ -333,7 +333,7 @@ The results of this value are shown in the following example:
333333
}
334334
```
335335

336-
# [**VNet flow logs**](#tab/vnet)
336+
# [**Virtual network flow logs**](#tab/vnet)
337337

338338
```json
339339
{

articles/network-watcher/network-watcher-overview.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: halkazwini
55
ms.author: halkazwini
66
ms.service: network-watcher
77
ms.topic: overview
8-
ms.date: 04/22/2024
8+
ms.date: 04/24/2024
99

1010
#CustomerIntent: As someone with basic Azure network experience, I want to understand how Azure Network Watcher can help me resolve some of the network-related problems I've encountered and provide insight into how I use Azure networking.
1111
---
@@ -90,8 +90,8 @@ Network Watcher offers two traffic tools that help you log and visualize network
9090
### Flow logs
9191

9292
**Flow logs** allows you to log information about your Azure IP traffic and stores the data in Azure storage. You can log IP traffic flowing through a network security group or Azure virtual network. For more information, see:
93-
- [NSG flow logs](nsg-flow-logs-overview.md) and [Manage NSG flow logs](nsg-flow-logs-portal.md).
94-
- [VNet flow logs](vnet-flow-logs-overview.md) and [Manage VNet flow logs](vnet-flow-logs-portal.md).
93+
- [Network security group flow logs](nsg-flow-logs-overview.md) and [Manage network security group flow logs](nsg-flow-logs-portal.md).
94+
- [Virtual network flow logs](vnet-flow-logs-overview.md) and [Manage virtual network flow logs](vnet-flow-logs-portal.md).
9595

9696
### Traffic analytics
9797

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

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,44 @@
11
---
2-
title: Migrate to VNet flow logs
2+
title: Migrate to virtual network flow logs
33
titleSuffix: Azure Network Watcher
4-
description: Learn how to migrate your Azure Network Watcher NSG flow logs to VNet flow logs using the Azure portal and a PowerShell script.
4+
description: Learn how to migrate your Azure Network Watcher network security group flow logs to virtual network flow logs using the Azure portal and a PowerShell script.
55
author: halkazwini
66
ms.author: halkazwini
77
ms.service: network-watcher
88
ms.topic: how-to
9-
ms.date: 04/22/2024
9+
ms.date: 04/24/2024
10+
ms.custom: devx-track-azurepowershell
1011

11-
#CustomerIntent: As an Azure administrator, I want to migrate my NSG flow logs to the new VNet flow logs so that I can use all the benefits of VNet flow logs, which overcome some of the NSG flow logs limitations..
12+
#CustomerIntent: As an Azure administrator, I want to migrate my network security group flow logs to the new virtual network flow logs so that I can use all the benefits of virtual network flow logs, which overcome some of the network security group flow logs limitations.
1213
---
1314

14-
# Migrate from NSG flow logs to VNet flow logs
15+
# Migrate from network security group flow logs to virtual network flow logs
1516

16-
In this article, you learn how to migrate your existing NSG flow logs to VNet flow logs. VNet flow logs overcome some of the limitations of NSG flow logs. For more information, see [VNet flow logs](vnet-flow-logs-overview.md).
17+
In this article, you learn how to migrate your existing network security group flow logs to virtual network flow logs. Virtual network flow logs overcome some of the limitations of network security group flow logs. For more information, see [Virtual network flow logs](vnet-flow-logs-overview.md).
1718

1819
## Prerequisites
1920

2021
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
2122

2223
- PowerShell installed on your machine. For more information, see [Install PowerShell on Windows, Linux, and macOS](/powershell/scripting/install/installing-powershell). This article requires the Az PowerShell module. For more information, see [How to install Azure PowerShell](/powershell/azure/install-azure-powershell). To find the installed version, run `Get-Module -ListAvailable Az`.
2324

24-
- Necessary RBAC permissions for subscriptions of the flow logs and Log Analytics workspaces if traffic analytics is enabled for any of the NSG flow logs. For more information, see [Network Watcher RBAC permissions](required-rbac-permissions.md).
25+
- Necessary RBAC permissions for subscriptions of the flow logs and Log Analytics workspaces if traffic analytics is enabled for any of the network security group flow logs. For more information, see [Network Watcher RBAC permissions](required-rbac-permissions.md).
2526

26-
- NSG flow logs in a region or more. For more information, see [Create NSG flow logs](nsg-flow-logs-portal.md#create-a-flow-log).
27+
- Network security group flow logs in a region or more. For more information, see [Create network security group flow logs](nsg-flow-logs-portal.md#create-a-flow-log).
2728

2829
## Generate migration script
2930

30-
In this section, you learn how to generate and download the migration files for the NSG flow logs that you want to migrate.
31+
In this section, you learn how to generate and download the migration files for the network security group flow logs that you want to migrate.
3132

3233
1. In the search box at the top of the portal, enter *network watcher*. Select **Network Watcher** in the search results.
3334

3435
:::image type="content" source="./media/nsg-flow-logs-migrate/portal-search.png" alt-text="Screenshot that shows how to search for Network Watcher in the Azure portal." lightbox="./media/nsg-flow-logs-migrate/portal-search.png":::
3536

3637
1. Under **Logs**, select **Migrate flow logs**.
3738

38-
:::image type="content" source="./media/nsg-flow-logs-migrate/migrate-flow-logs.png" alt-text="Screenshot that shows the NSG flow logs migration page in the Azure portal." lightbox="./media/nsg-flow-logs-migrate/migrate-flow-logs.png":::
39+
:::image type="content" source="./media/nsg-flow-logs-migrate/migrate-flow-logs.png" alt-text="Screenshot that shows the network security group flow logs migration page in the Azure portal." lightbox="./media/nsg-flow-logs-migrate/migrate-flow-logs.png":::
3940

40-
1. Select the subscriptions that contain the NSG flow logs that you want to migrate.
41+
1. Select the subscriptions that contain the network security group flow logs that you want to migrate.
4142

4243
1. For each subscription, select the regions that contain the flow logs that you want to migrate. **Total NSG flow logs** shows the total number of flow logs that are in the selected subscriptions. **Selected NSG flow logs** shows the number of flow logs in the selected regions.
4344

@@ -51,7 +52,7 @@ In this section, you learn how to generate and download the migration files for
5152

5253
## Run migration script
5354

54-
In this section, you learn how to use the script file that you downloaded in the previous section to migrate your NSG flow logs.
55+
In this section, you learn how to use the script file that you downloaded in the previous section to migrate your network security group flow logs.
5556

5657
> [!IMPORTANT]
5758
> Once you start running the script, you shouldn't make any changes to the topology in the regions and subscriptions of the flow logs that you're migrating.
@@ -81,7 +82,7 @@ In this section, you learn how to use the script file that you downloaded in the
8182
Please enter the number of threads you would like to use, press enter for using default value of 16:
8283
```
8384
84-
After the analysis is complete, you'll see the analysis report on screen and in an html file in the same directory of the migration files. The report lists the number of NSG flow logs that will be disabled and the number of VNet flow logs that are created to replace them. The number of VNet flow logs that are created depends on the type of migration that you choose. For example, if the network security group that you're migrating its flow log is associated with three network interfaces in the same virtual network, then you can choose *migration with aggregation* to have a single VNet flow log resource applied to the virtual network. You can also choose *migration without aggregation* to have three VNet flow logs (one VNet flow log resource per network interface).
85+
After the analysis is complete, you'll see the analysis report on screen and in an html file in the same directory of the migration files. The report lists the number of network security group flow logs that will be disabled and the number of virtual network flow logs that are created to replace them. The number of virtual network flow logs that are created depends on the type of migration that you choose. For example, if the network security group that you're migrating its flow log is associated with three network interfaces in the same virtual network, then you can choose *migration with aggregation* to have a single virtual network flow log resource applied to the virtual network. You can also choose *migration without aggregation* to have three virtual network flow logs (one virtual network flow log resource per network interface).
8586
8687
> [!NOTE]
8788
> See `AnalysisReport-<subscriptionId>-<region>-<time>.html` file for a full report of the analysis that you performed. The file is available in the same directory of the script.
@@ -102,14 +103,14 @@ In this section, you learn how to use the script file that you downloaded in the
102103
Do you want to rollback? You won't get the option to revert the actions done now again (y/n): n
103104
```
104105
105-
1. Check the Azure portal to confirm that the status of NSG flow logs that you migrated became disabled, and VNet flow logs are created to replace them.
106+
1. Check the Azure portal to confirm that the status of network security group flow logs that you migrated became disabled, and virtual network flow logs are created to replace them.
106107
107-
:::image type="content" source="./media/nsg-flow-logs-migrate/list-flow-logs.png" alt-text="Screenshot that shows the newly created VNet flow log as a result of migrating from NSG flow log." lightbox="./media/nsg-flow-logs-migrate/list-flow-logs.png":::
108+
:::image type="content" source="./media/nsg-flow-logs-migrate/list-flow-logs.png" alt-text="Screenshot that shows the newly created virtual network flow log as a result of migrating from network security group flow log." lightbox="./media/nsg-flow-logs-migrate/list-flow-logs.png":::
108109
109110
> [!NOTE]
110111
> Keep the script and analysis report files for reference in case you have any issues with the migration.
111112
112113
## Related content
113114
114-
- [NSG flow logs](nsg-flow-logs-overview.md)
115-
- [VNet flow logs](vnet-flow-logs-overview.md)
115+
- [Network security group flow logs](nsg-flow-logs-overview.md)
116+
- [Virtual network flow logs](vnet-flow-logs-overview.md)

articles/network-watcher/required-rbac-permissions.md

Lines changed: 2 additions & 2 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: concept-article
9-
ms.date: 04/22/2024
9+
ms.date: 04/24/2024
1010

1111
#CustomerIntent: As an Azure administrator, I want to know the required Azure role-based access control (Azure RBAC) permissions to use each of the Network Watcher capabilities, so I can assign them correctly to users using any of those capabilities.
1212
---
@@ -78,7 +78,7 @@ Since traffic analytics is enabled as part of the Flow log resource, the followi
7878
> | Microsoft.Insights/dataCollectionEndpoints/write <sup>1</sup> | Create or update a data collection endpoint |
7979
> | Microsoft.Insights/dataCollectionEndpoints/delete <sup>1</sup> | Delete a data collection endpoint |
8080
81-
<sup>1</sup> Only required when using traffic analytics to analyze VNet flow logs. For more information, see [Data collection rules in Azure Monitor](../azure-monitor/essentials/data-collection-rule-overview.md?toc=/azure/network-watcher/toc.json) and [Data collection endpoints in Azure Monitor](../azure-monitor/essentials/data-collection-endpoint-overview.md?toc=/azure/network-watcher/toc.json).
81+
<sup>1</sup> Only required when using traffic analytics to analyze virtual network flow logs. For more information, see [Data collection rules in Azure Monitor](../azure-monitor/essentials/data-collection-rule-overview.md?toc=/azure/network-watcher/toc.json) and [Data collection endpoints in Azure Monitor](../azure-monitor/essentials/data-collection-endpoint-overview.md?toc=/azure/network-watcher/toc.json).
8282

8383
> [!CAUTION]
8484
> Data collection rule and data collection endpoint resources are created and managed by traffic analytics. If you perform any operation on these resources, traffic analytics may not function as expected.

0 commit comments

Comments
 (0)