Skip to content

Commit 546360c

Browse files
author
Maddie Clayton
authored
Merge pull request #6389 from Azure/sayghosh-patch-1-1
Update Set-AzureRmNetworkWatcherConfigFlowLog.md
2 parents bdaf236 + fea842b commit 546360c

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
@@ -111,6 +111,35 @@ RetentionPolicy : {
111111

112112
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.
113113

114+
### Example 2: Configure Flow Logging and Traffic Analytics for a Specified NSG
115+
```
116+
PS C:\> $NW = Get-AzurermNetworkWatcher -ResourceGroupName NetworkWatcherRg -Name NetworkWatcher_westcentralus
117+
PS C:\> $nsg = Get-AzureRmNetworkSecurityGroup -ResourceGroupName NSGRG -Name appNSG
118+
PS C:\> $storageId = "/subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Storage/storageAccounts/contosostorageacct123"
119+
PS C:\> $workspace = Get-AzureRmOperationalInsightsWorkspace -Name WorkspaceName -ResourceGroupName WorkspaceRg
120+
121+
122+
PS C:\> Set-AzureRmNetworkWatcherConfigFlowLog -NetworkWatcher $NW -TargetResourceId $nsg.Id -EnableFlowLog $true -StorageAccountId $storageID -EnableTrafficAnalytics -Workspace $workspace
123+
124+
TargetResourceId : /subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Network/networkSecurityGroups/appNSG
125+
StorageId : /subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourceGroups/NSGRG/providers/Microsoft.Storage/storageAccounts/contosostorageacct123
126+
Enabled : True
127+
RetentionPolicy : {
128+
"Days": 0,
129+
"Enabled": false
130+
}
131+
FlowAnalyticsConfiguration : {
132+
"networkWatcherFlowAnalyticsConfiguration": {
133+
"enabled": true,
134+
"workspaceId": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
135+
"workspaceRegion": "WorkspaceLocation",
136+
"workspaceResourceId": "/subscriptions/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb/resourcegroups/WorkspaceRg/providers/microsoft.operationalinsights/workspaces/WorkspaceName"
137+
}
138+
}
139+
```
140+
141+
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.
142+
114143
## PARAMETERS
115144

116145
### -AsJob

0 commit comments

Comments
 (0)