You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/network-watcher/packet-capture-alert-triggered.md
+12-11Lines changed: 12 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
---
2
-
title: Use packet capture to do proactive network monitoring with alerts - Azure Functions
2
+
title: Use packet capture to proactively monitor your network
3
3
description: Learn how to create an alert-triggered packet capture by using Azure Network Watcher and Azure Functions.
4
4
author: halkazwini
5
5
ms.author: halkazwini
6
6
ms.service: azure-network-watcher
7
7
ms.topic: how-to
8
-
ms.date: 02/14/2024
8
+
ms.date: 03/25/2025
9
9
ms.custom: devx-track-azurepowershell
10
10
---
11
11
12
-
# Monitor networks proactively with alerts and Azure Functions by using packet capture
12
+
# Monitor networks proactively with alerts and Azure Functions using packet capture
13
13
14
14
The packet capture feature of Azure Network Watcher creates capture sessions to track traffic in and out of virtual machines (VMs). The capture file can have a filter that you define to track only the traffic that you want to monitor. This data is stored in a storage blob or locally on the guest machine.
15
15
@@ -35,7 +35,7 @@ This scenario assumes that you have an existing instance of Network Watcher and
35
35
36
36
Here's the workflow for packet capture:
37
37
38
-
1. An incident triggers an alert on your VM.
38
+
1. An incident triggers an alert on your virtual machine (VM).
39
39
1. The alert calls your Azure function.
40
40
1. Your Azure function processes the alert and starts a Network Watcher packet capture session.
41
41
1. The packet capture runs on the VM and collects data.
@@ -73,15 +73,15 @@ To create an Azure function to process the alert and create a packet capture, yo
73
73
-**Functions Premium**: For enterprise-level, serverless applications with event-based scaling and network isolation.
74
74
-**App Service plan**: For reusing compute from an existing Azure App Service plan.
75
75
76
-
:::image type="content" source="./media/network-watcher-alert-triggered-packet-capture/create-function-app-basics.png" alt-text="Screenshot of the Create Function App page in the Azure portal." lightbox="./media/network-watcher-alert-triggered-packet-capture/create-function-app-basics.png":::
76
+
:::image type="content" source="./media/packet-capture-alert-triggered/create-function-app-basics.png" alt-text="Screenshot of the Create Function App page in the Azure portal." lightbox="./media/packet-capture-alert-triggered/create-function-app-basics.png":::
77
77
78
78
1. Select **Review + create** to create the app.
79
79
80
80
Now you can create a function:
81
81
82
82
1. In the function app that you created, select **Functions**, and then select **Create** to open the **Create function** pane.
83
83
84
-
:::image type="content" source="./media/network-watcher-alert-triggered-packet-capture/create-function.png" alt-text="Screenshot of the Create function pane.":::
84
+
:::image type="content" source="./media/packet-capture-alert-triggered/create-function.png" alt-text="Screenshot of the Create function pane.":::
85
85
86
86
2. For **Development environment**, select **Develop in portal**.
87
87
3. Under **Select a template**, select **HTTP trigger**.
@@ -183,7 +183,7 @@ To store the environment variables:
183
183
184
184
1. Go to the function app. Select **Configurations** > **Application settings**.
185
185
186
-
:::image type="content" source="./media/network-watcher-alert-triggered-packet-capture/application-insights.png" alt-text="Screenshot of the tab for application settings.":::
186
+
:::image type="content" source="./media/packet-capture-alert-triggered/application-insights.png" alt-text="Screenshot of the tab for application settings.":::
187
187
188
188
1. Add the environment variables and their values to the app settings, and then select **Save**.
189
189
@@ -307,7 +307,7 @@ if ($requestBody.context.resourceType -eq "Microsoft.Compute/virtualMachines") {
307
307
}
308
308
```
309
309
310
-
## Configure an alert on a VM
310
+
## Configure an alert on a virtual machine
311
311
312
312
You can configure alerts to notify individuals when a specific metric crosses a threshold that you assigned to it. In this example, the alert is on the **Network Out Total** metric that's sent, but you can trigger the alert for many other metrics.
313
313
@@ -333,7 +333,7 @@ Go to an existing virtual machine and [add an alert rule](/azure/azure-monitor/a
333
333
5. On the **Notifications** tab, for **Action type**, select **Azure Function**.
334
334
6. On the **Azure Function** pane, select the **Subscription**, **Resource group**, **Function app**, and **Azure Function** values.
335
335
336
-
:::image type="content" source="./media/network-watcher-alert-triggered-packet-capture/action-group.png" alt-text="Screenshot of the page for creating an action group and the pane for details about an Azure function.":::
336
+
:::image type="content" source="./media/packet-capture-alert-triggered/action-group.png" alt-text="Screenshot of the page for creating an action group and the pane for details about an Azure function.":::
337
337
7. In **Enable the common alert schema** slider, select **No**. Then select **OK**.
338
338
339
339
## Review the results
@@ -344,8 +344,9 @@ If the capture file is stored locally, you can get it by signing in to the virtu
344
344
345
345
For instructions on downloading files from Azure storage accounts, see the [quickstart for the Azure Blob Storage client library for .NET](../storage/blobs/storage-quickstart-blobs-dotnet.md). You can also use the [Azure Storage Explorer](https://storageexplorer.com/) tool.
346
346
347
-
After you download your capture, you can view it by using tools like [Wireshark](https://www.wireshark.org/) that can read a *.cap* file.
347
+
After you download your capture, you can view it using tools like [Wireshark](https://www.wireshark.org/) that can read a *.cap* file.
348
348
349
349
## Next step
350
350
351
-
Learn how to view your packet captures by reading [Inspect and analyze Network Watcher packet capture files](network-watcher-deep-packet-inspection.md).
351
+
> [!div class="nextstepaction"]
352
+
> [Inspect and analyze Network Watcher packet capture files](network-watcher-deep-packet-inspection.md)
0 commit comments