Skip to content

Commit df513ba

Browse files
authored
Merge pull request #296223 from halkazwini/nw-bicep
Updates to the Bicep quickstart
2 parents 1c45370 + 0470811 commit df513ba

File tree

3 files changed

+45
-29
lines changed

3 files changed

+45
-29
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/quickstart-configure-network-security-group-flow-logs-from-bicep.md",
5+
"redirect_url": "/azure/network-watcher/nsg-flow-logs-bicep",
6+
"redirect_document_id": true
7+
},
38
{
49
"source_path_from_root": "/articles/network-watcher/quickstart-configure-network-security-group-flow-logs-from-arm-template.md",
510
"redirect_url": "/azure/network-watcher/nsg-flow-logs-template",
Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,35 @@ author: halkazwini
66
ms.author: halkazwini
77
ms.service: azure-network-watcher
88
ms.topic: quickstart
9-
ms.date: 09/30/2024
9+
ms.date: 03/12/2025
1010
ms.custom: devx-track-bicep, subject-bicepqs, mode-arm
1111

1212
#CustomerIntent: As an Azure administrator, I need to enable NSG flow logs using a Bicep file so that I can log the traffic flowing through a network security group.
1313
---
1414

15-
# Quickstart: Configure Azure Network Watcher NSG flow logs using a Bicep file
15+
# Quickstart: Configure NSG flow logs using a Bicep file
1616

17-
In this quickstart, you learn how to enable [NSG flow logs](nsg-flow-logs-overview.md) using a Bicep file.
17+
[!INCLUDE [NSG flow logs retirement](../../includes/network-watcher-nsg-flow-logs-retirement.md)]
18+
19+
In this quickstart, you learn how to enable NSG flow logs using a Bicep file. For more information, see [NSG flow logs overview](nsg-flow-logs-overview.md) and [What is Azure Resource Manager?](../azure-resource-manager/management/overview.md)
1820

1921
[!INCLUDE [About Bicep](~/reusable-content/ce-skilling/azure/includes/resource-manager-quickstart-bicep-introduction.md)]
2022

2123
## Prerequisites
2224

23-
- An Azure account with an active subscription. If you don't have one, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
24-
25-
- To deploy the Bicep files, either Azure CLI or PowerShell installed.
25+
# [PowerShell](#tab/powershell)
2626

27-
# [Azure CLI](#tab/cli)
28-
29-
1. [Install Azure CLI locally](/cli/azure/install-azure-cli) to run the commands.
27+
- An Azure account with an active subscription. If you don't have one, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
3028

31-
1. Sign in to Azure using the [az login](/cli/azure/reference-index#az-login) command.
29+
- [Azure PowerShell installed locally](/powershell/azure/install-azure-powershell) to run the cmdlets. Use [Connect-AzAccount](/powershell/module/az.accounts/connect-azaccount) cmdlet to sign in to Azure.
3230

33-
# [PowerShell](#tab/powershell)
31+
# [Azure CLI](#tab/cli)
3432

35-
1. [Install Azure PowerShell locally](/powershell/azure/install-azure-powershell) to run the cmdlets.
33+
- An Azure account with an active subscription. If you don't have one, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
3634

37-
1. Sign in to Azure using the [Connect-AzAccount](/powershell/module/az.accounts/connect-azaccount) cmdlet.
35+
- [Azure CLI installed locally](/cli/azure/install-azure-cli) to run the commands. Use [az login](/cli/azure/reference-index#az-login) command to sign in to Azure.
3836

39-
---
37+
---
4038

4139
## Review the Bicep file
4240

@@ -56,24 +54,35 @@ The highlighted code in the preceding sample shows an NSG flow log resource defi
5654

5755
This quickstart assumes that you have a network security group that you can enable flow logging on.
5856

57+
# [PowerShell](#tab/powershell)
58+
5959
1. Save the [Bicep file](https://github.com/Azure/azure-quickstart-templates/blob/master/quickstarts/microsoft.network/networkwatcher-flowLogs-create/main.bicep) as **main.bicep** to your local computer.
60-
1. Deploy the Bicep file using either Azure CLI or Azure PowerShell.
6160

62-
# [Azure CLI](#tab/cli)
61+
1. Deploy the Bicep file.
6362

64-
```azurecli
65-
az group create --name exampleRG --location eastus
66-
az deployment group create --resource-group exampleRG --template-file main.bicep
63+
```azurepowershell
64+
New-AzResourceGroup -Name 'exampleRG' -Location 'eastus'
65+
New-AzResourceGroupDeployment -ResourceGroupName 'exampleRG' -TemplateFile ./main.bicep
6766
```
6867
69-
# [PowerShell](#tab/powershell)
68+
You'll be prompted to enter the resource ID of the existing network security group. The syntax of the network security group resource ID is:
7069
71-
```azurepowershell
72-
New-AzResourceGroup -Name exampleRG -Location eastus
73-
New-AzResourceGroupDeployment -ResourceGroupName exampleRG -TemplateFile ./main.bicep
70+
```json
71+
"/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.Network/networkSecurityGroups/<network-security-group-name>"
7472
```
7573
76-
---
74+
When the deployment finishes, you should see a message indicating the deployment succeeded.
75+
76+
# [Azure CLI](#tab/cli)
77+
78+
1. Save the [Bicep file](https://github.com/Azure/azure-quickstart-templates/blob/master/quickstarts/microsoft.network/networkwatcher-flowLogs-create/main.bicep) as **main.bicep** to your local computer.
79+
80+
1. Deploy the Bicep file.
81+
82+
```azurecli
83+
az group create --name 'exampleRG' --location 'eastus'
84+
az deployment group create --resource-group 'exampleRG' --template-file main.bicep
85+
```
7786
7887
You'll be prompted to enter the resource ID of the existing network security group. The syntax of the network security group resource ID is:
7988
@@ -83,6 +92,8 @@ This quickstart assumes that you have a network security group that you can enab
8392
8493
When the deployment finishes, you should see a message indicating the deployment succeeded.
8594
95+
---
96+
8697
## Validate the deployment
8798
8899
You have two options to see whether your deployment succeeded:
@@ -110,8 +121,8 @@ You also can disable an NSG flow log in the Azure portal:
110121
111122
## Related content
112123
113-
To learn how to visualize your NSG flow logs data, see:
124+
In this quickstart, you learned how to enable NSG flow logs using a Bicep file. Next, learn how to visualize your NSG flow logs data using traffic analytics:
114125
115-
- [Visualizing NSG flow logs using Power BI](network-watcher-visualize-nsg-flow-logs-power-bi.md).
116-
- [Visualize NSG flow logs using open source tools](network-watcher-visualize-nsg-flow-logs-open-source-tools.md).
117-
- [Traffic Analytics](traffic-analytics.md).
126+
- [Traffic analytics overview](traffic-analytics.md)
127+
- [Usage scenarios of traffic analytics](usage-scenarios-traffic-analytics.md)
128+
- [Manage traffic analytics using Azure Policy](traffic-analytics-policy-portal.md)

articles/network-watcher/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
- name: ARM template
169169
href: nsg-flow-logs-template.md
170170
- name: Bicep
171-
href: quickstart-configure-network-security-group-flow-logs-from-bicep.md
171+
href: nsg-flow-logs-bicep.md
172172
- name: Built-in Policy
173173
href: nsg-flow-logs-policy-portal.md
174174
- name: Migrate NSG flow logs

0 commit comments

Comments
 (0)