Skip to content

Commit cd43fd4

Browse files
author
Michael Bender
committed
added JSON for arm template
1 parent bf7b855 commit cd43fd4

File tree

2 files changed

+53
-20
lines changed

2 files changed

+53
-20
lines changed

articles/virtual-network-manager/how-to-manage-ip-addresses-network-manager.md

Lines changed: 53 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: mbender-ms
55
ms.author: mbender
66
ms.service: azure-virtual-network-manager
77
ms.topic: how-to
8-
ms.date: 10/08/2024
8+
ms.date: 10/25/2024
99
ms.custom: references_regions
1010
#customer intent: As a network administrator, I want to learn how to manage IP addresses with Azure Virtual Network Manager so that I can create and assign IP address pools to my virtual networks.
1111
---
@@ -170,54 +170,87 @@ In this step, you create a virtual network with a nonoverlapping CIDR range by a
170170

171171
# [Azure Resource Manager Template](#tab/armtemplate)
172172

173+
In this step, you create a virtual network with a nonoverlapping CIDR range using an Azure Resource Manager template.
174+
173175
1. Sign in to Azure and search for **Deploy a custom template**.
174176
2. In the **Custom deployment** window, select **Build your own template in the editor**.
175177
3. Copy the following template into the editor:
176178

177179
```json
178-
{
179-
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
180-
"contentVersion": "1.0.0.0",
181-
"metadata": {},
182-
"parameters": {
183-
"vnetName": {
184-
"type": "string",
185-
"defaultValue": "VNet1",
180+
{
181+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
182+
"contentVersion": "1.0.0.0",
183+
"parameters": {
184+
"virtualNetworkName": {
185+
"defaultValue": "virtual-network",
186+
"type": "String",
186187
"metadata": {
187188
"description": "VNet name"
188189
}
189-
},
190-
"location": {
191-
"type": "string",
190+
},
191+
"location": {
192192
"defaultValue": "[resourceGroup().location]",
193+
"type": "String",
193194
"metadata": {
194195
"description": "Location for all resources."
195196
}
197+
},
198+
"poolResourceID": {
199+
"defaultValue": "/subscriptions/<subscriptionId>/resourceGroups/resourceGroupName/providers/Microsoft.Network/networkManagers/<networkManagerName>/ipamPools/<ipAddressPoolName>",
200+
"type": "String",
201+
"metadata": {
202+
"description": "Enter the Resource ID for your IP Address Pool. You can find this in the JSON View in the resource's overview window."
196203
}
197204
},
198-
"resources": [
199-
{
205+
"numberOfIPAddresses": {
206+
"defaultValue": "256",
207+
"type": "String",
208+
"metadata": {
209+
"description": "Enter the number of IP addresses for the virtual network."
210+
}
211+
}
212+
},
213+
"resources": [
214+
{
200215
"type": "Microsoft.Network/virtualNetworks",
201216
"apiVersion": "2024-01-01",
202-
"name": "[parameters('vnetName')]",
217+
"name": "[parameters('virtualNetworkName')]",
203218
"location": "[parameters('location')]",
204219
"properties": {
205220
"addressSpace": {
206221
"ipamPoolPrefixAllocations": [
207222
{
208223
"pool": {
209-
"id": "/subscriptions/XXX/resourceGroups/ipam-test/providers/Microsoft.Network/networkManagers/IPAM-test/ipamPools/ALZ-app1"
224+
"id": "[parameters('poolResourceID')]"
210225
},
211-
"numberOfIpAddresses": "65536"
226+
"numberOfIpAddresses": "[parameters('numberOfIPAddresses')]"
212227
}
213228
]
214229
}
215230
}
216-
}
217-
]
218-
}
231+
}
232+
]
233+
}
219234
```
220235

236+
1. In the **Custom deployment** windows, enter or select the following information::
237+
238+
| **Field** | **Description** |
239+
| --- | --- |
240+
| **Project details** | |
241+
| Subscription | Select your subscription. |
242+
| Resource group | Select the resource group for the virtual network. In this case, the example uses **resource-group**. |
243+
| **Instance details** | |
244+
| Region | Select the region for the virtual network. IP address pools must be in the same region as your virtual network in order to be associated. |
245+
| Virtual network name | Enter a name for the virtual network. The template will default to **virtual-network**. |
246+
| Location | Select the location for the virtual network. This will be the same as the region except all lower case and no spaces.</br>For example, if the region is **(US)westus2**, the location will be **westus2**. |
247+
248+
:::image type="content" source="media/how-to-manage-ip-addresses/custom-deployment-template.png" alt-text="Screenshot of custom deployment page with values.":::
249+
250+
> [!NOTE]
251+
> The **poolResourceID** parameter is the Resource ID for your IP Address Pool. You can find this in the JSON View in the resource's overview window.
252+
253+
4. Select **Review + create** and then **Create** to create the virtual network.
221254

222255
## Next steps
223256

52.3 KB
Loading

0 commit comments

Comments
 (0)