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
@@ -185,10 +185,10 @@ Create an Azure Bastion host with [New-AzBastion](/powershell/module/az.network/
185
185
$bastionParams = @{
186
186
ResourceGroupName = "test-rg"
187
187
Name = "bastion"
188
-
Location = "EastUS"
189
188
VirtualNetworkName = "vnet-1"
190
-
SubnetName = "AzureBastionSubnet"
191
189
PublicIpAddressName = "public-ip-bastion"
190
+
PublicIpAddressRgName = "test-rg"
191
+
VirtualNetworkRgName = "test-rg"
192
192
}
193
193
New-AzBastion @bastionParams -AsJob
194
194
```
@@ -249,83 +249,29 @@ Network virtual appliances (NVAs) are virtual machines that help with network fu
249
249
250
250
### [PowerShell](#tab/powershell)
251
251
252
-
### Create a network interface
252
+
### Create a virtual machine
253
253
254
-
Before creating a network interface, you have to retrieve the virtual network Id with [Get-AzVirtualNetwork](/powershell/module/az.network/get-azvirtualnetwork), then the subnet Id with [Get-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/get-azvirtualnetworksubnetconfig). Create a network interface with [New-AzNetworkInterface](/powershell/module/az.network/new-aznetworkinterface) in the *DMZ* subnet:
254
+
Create the VM with [New-AzVM](/powershell/module/az.compute/new-azvm). The following example creates a VM named *vm-nva*.
255
255
256
256
```azurepowershell-interactive
257
-
# Retrieve the virtual network object into a variable.
To create a VM and attach an existing network interface to it, you must first create a VM configuration with [New-AzVMConfig](/powershell/module/az.compute/new-azvmconfig). The configuration includes the network interface created in the previous step. When prompted for a username and password, select the user name and password you want to log into the VM with.
284
-
285
-
```azurepowershell-interactive
286
-
# Create a credential object.
287
-
$credParams = @{
288
-
Message = "Enter a username and password for the VM."
Create the VM using the VM configuration with [New-AzVM](/powershell/module/az.compute/new-azvm). The following example creates a VM named *vm-nva*.
321
272
322
-
```azurepowershell-interactive
323
-
$vmNvaParams = @{
324
-
ResourceGroupName = "test-rg"
325
-
Location = "eastus2"
326
-
VM = $vmConfig
327
-
}
328
-
$vmNva = New-AzVM @vmNvaParams -AsJob
273
+
# Create the VM
274
+
New-AzVM @vmParams -AsJob
329
275
```
330
276
331
277
The `-AsJob` option creates the VM in the background, so you can continue to the next step.
@@ -434,33 +380,50 @@ The public virtual machine is used to simulate a machine in the public internet.
434
380
435
381
### [PowerShell](#tab/powershell)
436
382
437
-
Create a VM in the *subnet-public* subnet with [New-AzVM](/powershell/module/az.compute/new-azvm). The following example creates a VM named *myVmPublic* in the *subnet-public* subnet of the *vnet-1* virtual network.
383
+
Create a VM in the *subnet-1* subnet with [New-AzVM](/powershell/module/az.compute/new-azvm). The following example creates a VM named *vm-public* in the *subnet-public* subnet of the *vnet-1* virtual network.
Associate the route table with the **subnet-1** subnet with [Set-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/set-azvirtualnetworksubnetconfig). The following example associates the *route-table-public* route table with the *subnet-1* subnet.
0 commit comments