Skip to content

Commit e8dfd07

Browse files
authored
Update Set-AzureRmNetworkWatcherConfigFlowLog.md
1 parent e9dbc00 commit e8dfd07

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/ResourceManager/Network/Commands.Network/help/Set-AzureRmNetworkWatcherConfigFlowLog.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,35 @@ RetentionPolicy : {
6161

6262
In this example we configure flow logging status for a Network Security Group. In the response, we see the specified NSG has flow logging enabled, and no retention policy set.
6363

64+
### Example 2: Configure Flow Logging and Traffic Analytics for a Specified NSG
65+
```
66+
PS C:\> $NW = Get-AzurermNetworkWatcher -ResourceGroupName NetworkWatcherRg -Name NetworkWatcher_westcentralus
67+
PS C:\> $nsg = Get-AzureRmNetworkSecurityGroup -ResourceGroupName NSGRG -Name appNSG
68+
PS C:\> $storageId = "/subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Storage/storageAccounts/contosostorageacct123"
69+
PS C:\> $workspace = Get-AzureRmOperationalInsightsWorkspace -Name WorkspaceName -ResourceGroupName WorkspaceRg
70+
71+
72+
PS C:\> Set-AzureRmNetworkWatcherConfigFlowLog -NetworkWatcher $NW -TargetResourceId $nsg.Id -EnableFlowLog $true -StorageAccountId $storageID -EnableTrafficAnalytics -Workspace $workspace
73+
74+
TargetResourceId : /subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Network/networkSecurityGroups/appNSG
75+
StorageId : /subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Storage/storageAccounts/contosostorageacct123
76+
Enabled : True
77+
RetentionPolicy : {
78+
"Days": 0,
79+
"Enabled": false
80+
}
81+
FlowAnalyticsConfiguration : {
82+
"networkWatcherFlowAnalyticsConfiguration": {
83+
"enabled": true,
84+
"workspaceId": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
85+
"workspaceRegion": "WorkspaceLocation",
86+
"workspaceResourceId": "/subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourcegroups/WorkspaceRg/providers/microsoft.operationalinsights/workspaces/WorkspaceName"
87+
}
88+
}
89+
```
90+
91+
In this example we configure flow logging status and Traffic Analytics for a Network Security Group. In the response, we see the specified NSG has flow logging and Traffic Analytics enabled, and no retention policy set.
92+
6493
## PARAMETERS
6594

6695
### -AsJob

0 commit comments

Comments
 (0)