Skip to content

Commit 34e828c

Browse files
authored
Merge pull request #296936 from halkazwini/nw-alert
Freshness: Monitor networks proactively with alerts and Azure Functions by using packet capture
2 parents 9169842 + 0b71b24 commit 34e828c

File tree

7 files changed

+18
-12
lines changed

7 files changed

+18
-12
lines changed

articles/network-watcher/.openpublishing.redirection.network-watcher.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"redirections": [
3+
{
4+
"source_path_from_root": "/articles/network-watcher/network-watcher-alert-triggered-packet-capture.md",
5+
"redirect_url": "/azure/network-watcher/packet-capture-alert-triggered",
6+
"redirect_document_id": true
7+
},
38
{
49
"source_path_from_root": "/articles/network-watcher/vnet-flow-logs-portal.md",
510
"redirect_url": "/azure/network-watcher/vnet-flow-logs-manage",

articles/network-watcher/network-watcher-alert-triggered-packet-capture.md renamed to articles/network-watcher/packet-capture-alert-triggered.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
2-
title: Use packet capture to do proactive network monitoring with alerts - Azure Functions
2+
title: Use packet capture to proactively monitor your network
33
description: Learn how to create an alert-triggered packet capture by using Azure Network Watcher and Azure Functions.
44
author: halkazwini
55
ms.author: halkazwini
66
ms.service: azure-network-watcher
77
ms.topic: how-to
8-
ms.date: 02/14/2024
8+
ms.date: 03/25/2025
99
ms.custom: devx-track-azurepowershell
1010
---
1111

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
1313

1414
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.
1515

@@ -35,7 +35,7 @@ This scenario assumes that you have an existing instance of Network Watcher and
3535

3636
Here's the workflow for packet capture:
3737

38-
1. An incident triggers an alert on your VM.
38+
1. An incident triggers an alert on your virtual machine (VM).
3939
1. The alert calls your Azure function.
4040
1. Your Azure function processes the alert and starts a Network Watcher packet capture session.
4141
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
7373
- **Functions Premium**: For enterprise-level, serverless applications with event-based scaling and network isolation.
7474
- **App Service plan**: For reusing compute from an existing Azure App Service plan.
7575

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":::
7777

7878
1. Select **Review + create** to create the app.
7979

8080
Now you can create a function:
8181

8282
1. In the function app that you created, select **Functions**, and then select **Create** to open the **Create function** pane.
8383

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.":::
8585

8686
2. For **Development environment**, select **Develop in portal**.
8787
3. Under **Select a template**, select **HTTP trigger**.
@@ -183,7 +183,7 @@ To store the environment variables:
183183

184184
1. Go to the function app. Select **Configurations** > **Application settings**.
185185

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.":::
187187

188188
1. Add the environment variables and their values to the app settings, and then select **Save**.
189189

@@ -307,7 +307,7 @@ if ($requestBody.context.resourceType -eq "Microsoft.Compute/virtualMachines") {
307307
}
308308
```
309309

310-
## Configure an alert on a VM
310+
## Configure an alert on a virtual machine
311311

312312
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.
313313

@@ -333,7 +333,7 @@ Go to an existing virtual machine and [add an alert rule](/azure/azure-monitor/a
333333
5. On the **Notifications** tab, for **Action type**, select **Azure Function**.
334334
6. On the **Azure Function** pane, select the **Subscription**, **Resource group**, **Function app**, and **Azure Function** values.
335335

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.":::
337337
7. In **Enable the common alert schema** slider, select **No**. Then select **OK**.
338338

339339
## Review the results
@@ -344,8 +344,9 @@ If the capture file is stored locally, you can get it by signing in to the virtu
344344

345345
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.
346346

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.
348348

349349
## Next step
350350

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)

articles/network-watcher/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
- name: Inspect to find anomalies
119119
href: packet-capture-inspect.md
120120
- name: Proactive network monitoring with Azure Functions
121-
href: network-watcher-alert-triggered-packet-capture.md
121+
href: packet-capture-alert-triggered.md
122122
- name: Perform intrusion detection using open source tools
123123
href: network-watcher-intrusion-detection-open-source-tools.md
124124
- name: Visualize network traffic patterns using open source tools

0 commit comments

Comments
 (0)