Skip to content

Commit 6ee0b42

Browse files
authored
Merge pull request #258832 from mbender-ms/avnm-173498
virtual network manager - update article w/ pivot zones and additional template
2 parents 02bd90e + e1d1b28 commit 6ee0b42

File tree

2 files changed

+76
-6
lines changed

2 files changed

+76
-6
lines changed

articles/virtual-network-manager/create-virtual-network-manager-terraform.md

Lines changed: 67 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ ms.author: mbender
99
ms.date: 6/7/2023
1010
content_well_notification:
1111
- AI-contribution
12+
zone_pivot_groups: azure-virtual-network-manager-quickstart-options
13+
1214
---
1315

1416
# Quickstart: Create a mesh network topology with Azure Virtual Network Manager using Terraform
1517

1618
Get started with Azure Virtual Network Manager by using Terraform to provision connectivity for all your virtual networks.
1719

18-
In this quickstart, you deploy three virtual networks and use Azure Virtual Network Manager to create a mesh network topology. Then, you verify that the connectivity configuration was applied.
20+
In this quickstart, you deploy three virtual networks and use Azure Virtual Network Manager to create a mesh network topology. Then, you verify that the connectivity configuration was applied. You can choose from a deployment with a Subscription scope or a management group scope. Learn more about [network manager scopes](concept-network-manager-scope.md).
1921

2022
[!INCLUDE [virtual-network-manager-preview](../../includes/virtual-network-manager-preview.md)]
2123

@@ -39,31 +41,69 @@ In this article, you learn how to:
3941
- [Install and configure Terraform](/azure/developer/terraform/quickstart-configure)
4042
- To modify dynamic network groups, you must be [granted access via Azure RBAC role](concept-network-groups.md#network-groups-and-azure-policy) assignment only. Classic Admin/legacy authorization is not supported
4143

44+
:::zone pivot="sub"
45+
4246
## Implement the Terraform code
4347

48+
This code sample will implement Azure Virtual Network Manager at the subscription scope.
49+
4450
> [!NOTE]
4551
> The sample code for this article is located in the [Azure Terraform GitHub repo](https://github.com/Azure/terraform/tree/master/quickstart/101-virtual-network-manager-create-mesh). You can view the log file containing the [test results from current and previous versions of Terraform](https://github.com/Azure/terraform/tree/master/quickstart/101-virtual-network-manager-create-mesh/TestRecord.md).
4652
>
4753
> See more [articles and sample code showing how to use Terraform to manage Azure resources](/azure/terraform)
4854
4955
1. Create a directory in which to test and run the sample Terraform code and make it the current directory.
5056

51-
1. Create a file named `providers.tf` and insert the following code:
57+
2. Create a file named `providers.tf` and insert the following code:
5258

5359
[!code-terraform[master](~/terraform_samples/quickstart/101-virtual-network-manager-create-mesh/providers.tf)]
5460

55-
1. Create a file named `main.tf` and insert the following code:
61+
3. Create a file named `main.tf` and insert the following code:
5662

5763
[!code-terraform[master](~/terraform_samples/quickstart/101-virtual-network-manager-create-mesh/main.tf)]
5864

59-
1. Create a file named `variables.tf` and insert the following code:
65+
4. Create a file named `variables.tf` and insert the following code:
6066

6167
[!code-terraform[master](~/terraform_samples/quickstart/101-virtual-network-manager-create-mesh/variables.tf)]
6268

63-
1. Create a file named `outputs.tf` and insert the following code:
69+
5. Create a file named `outputs.tf` and insert the following code:
6470

6571
[!code-terraform[master](~/terraform_samples/quickstart/101-virtual-network-manager-create-mesh/outputs.tf)]
6672

73+
:::zone-end
74+
75+
:::zone pivot="mgmt-grp"
76+
77+
78+
## Implement the Terraform code
79+
80+
This code sample will implement Azure Virtual Network Manager at the management group scope.
81+
82+
> [!NOTE]
83+
> The sample code for this article is located in the [Azure Terraform GitHub repo](https://github.com/Azure/terraform/tree/master/quickstart/101-virtual-network-manager-create-management-group-scope). You can view the log file containing the [test results from current and previous versions of Terraform](https://github.com/Azure/terraform/blob/master/quickstart/101-virtual-network-manager-create-management-group-scope/TestRecord.md).
84+
>
85+
> See more [articles and sample code showing how to use Terraform to manage Azure resources](/azure/terraform)
86+
87+
1. Create a directory in which to test and run the sample Terraform code and make it the current directory.
88+
89+
1. Create a file named `providers.tf` and insert the following code:
90+
91+
[!code-terraform[master](~/terraform_samples/quickstart/101-virtual-network-manager-create-management-group-scope/providers.tf)]
92+
93+
1. Create a file named `main.tf` and insert the following code:
94+
95+
[!code-terraform[master](~/terraform_samples/quickstart/101-virtual-network-manager-create-management-group-scope/main.tf)]
96+
97+
1. Create a file named `variables.tf` and insert the following code:
98+
99+
[!code-terraform[master](~/terraform_samples/quickstart/101-virtual-network-manager-create-management-group-scope/variables.tf)]
100+
101+
1. Create a file named `outputs.tf` and insert the following code:
102+
103+
[!code-terraform[master](~/terraform_samples/quickstart/101-virtual-network-manager-create-management-group-scope/outputs.tf)]
104+
105+
:::zone-end
106+
67107
## Initialize Terraform
68108

69109
[!INCLUDE [terraform-init.md](~/azure-dev-docs-pr/articles/terraform/includes/terraform-init.md)]
@@ -99,7 +139,28 @@ In this article, you learn how to:
99139
--resource-group $resource_group_name \
100140
--vnet-name <virtual_network_name>
101141
```
102-
142+
143+
#### [Azure PowerShell](#tab/azure-powershell)
144+
145+
1. Get the Azure resource group name.
146+
147+
```console
148+
$resource_group_name=$(terraform output -raw resource_group_name)
149+
```
150+
151+
1. Run [Get-AzResourceGroup](/powershell/module/az.resources/Get-AzResourceGroup) to display the resource group.
152+
153+
```azurepowershell
154+
Get-AzResourceGroup -Name $resource_group_name
155+
```
156+
157+
1. For each virtual network name printed in the previous step, run [Get-AzNetworkManagerEffectiveConnectivityConfiguration](/powershell/module/az.network/get-aznetworkmanagereffectiveconnectivityconfiguration) to print the effective (applied) configurations. Replace the `<virtual_network_name>` placeholder with the vnet name.
158+
159+
```azurepowershell
160+
Get-AzNetworkManagerEffectiveConnectivityConfiguration
161+
-VirtualNetworkName <String>
162+
-VirtualNetworkResourceGroupName $resource_group_name
163+
```
103164
---
104165

105166
## Clean up resources

articles/zone-pivot-groups.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2867,3 +2867,12 @@ groups:
28672867
title: Azure Developer CLI
28682868
- id: local
28692869
title: Local
2870+
2871+
- id: azure-virtual-network-manager-quickstart-options
2872+
title: Azure Virtual Network Manager Quickstart Scope Options
2873+
prompt: Choose a scope option
2874+
pivots:
2875+
- id: mgmt-grp
2876+
title: Management group
2877+
- id: sub
2878+
title: Subscription

0 commit comments

Comments
 (0)