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
Use [New-AzPublicIpPrefix](https://docs.microsoft.com/powershell/module/az.network/new-azpublicipprefix?view=latest) to create a public IP prefix resource named **myPublicIPprefix** in **myResourceGroupNAT**. The result of this command will be stored in a variable named **$publicIPPrefix** for later use.
77
+
Use [New-AzPublicIpPrefix](https://docs.microsoft.com/powershell/module/az.network/new-azpublicipprefix?view=latest) to create a public IP prefix resource named **myPublicIPprefix** in **myResourceGroupNAT**. The result of this command will be stored in a variable named **$publicIPPrefix** for later use.
78
78
79
79
```azurepowershell-interactive
80
80
$rsg = 'myResourceGroupNAT'
@@ -112,18 +112,18 @@ Create the virtual network and associate the subnet to the gateway.
112
112
Create a virtual network named **myVnet** with a subnet named **mySubnet** using [New-AzVirtualNetworkSubnetConfig](https://docs.microsoft.com/powershell/module/az.network/new-azvirtualnetworksubnetconfig?view=latest) in the **myResourceGroup** using [New-AzVirtualNetwork](https://docs.microsoft.com/powershell/module/az.network/new-azvirtualnetwork?view=latest). The IP address space for the virtual network is **192.168.0.0/16**. The subnet within the virtual network is **192.168.0.0/24**. The result of the commands will be stored in variables named **$subnet** and **$vnet** for later use.
All outbound traffic to Internet destinations is now using the NAT service. It isn't necessary to configure a UDR.
@@ -137,49 +137,49 @@ We'll now create a VM to use the NAT service. This VM has a public IP to use as
137
137
We create a public IP to be used to access the VM. Use [New-AzPublicIpAddress](https://docs.microsoft.com/powershell/module/az.network/new-azpublicipaddress?view=latest) to create a public IP address resource named **myPublicIPVM** in **myResourceGroupNAT**. The result of this command will be stored in a variable named **$publicIpVM** for later use.
Standard public IP addresses are 'secure by default', we need to create an NSG to allow inbound access for ssh. Use [New-AzNetworkSecurityGroup](https://docs.microsoft.com/powershell/module/az.network/new-aznetworksecuritygroup?view=latest) to create an NSG resource named **myNSG**. Use [New-AzNetworkSecurityRuleConfig](https://docs.microsoft.com/powershell/module/az.network/new-aznetworksecurityruleconfig?view=latest) to create an NSG rule for SSH access named **ssh** in **myResourceGroupNAT**. The result of this command will be stored in a variable named **$nsg** for later use.
Create a network interface with [New-AzNetworkInterface](https://docs.microsoft.com/powershell/module/az.network/new-aznetworkinterface?view=azps-2.8.0) named **myNic**. This command associates the Public IP address and the network security group. The result of this command will be stored in a variable named **$nic** for later use.
@@ -204,7 +204,7 @@ To create a VM in PowerShell, you create a configuration that has settings for t
204
204
Define the SSH credentials, OS information, and VM size. In this example, the SSH key is stored in ~/.ssh/id_rsa.pub.
205
205
206
206
```azurepowershell-interactive
207
-
#Define a credential object
207
+
#Define a credential object
208
208
209
209
$securePassword =
210
210
ConvertTo-SecureString ' ' -AsPlainText -Force
@@ -253,10 +253,10 @@ Wait for the VM to prepare to deploy then continue with the rest of the steps.
253
253
First we need to discover the IP address of the VM you've created. To get the public IP address of the VM, use [Get-AzPublicIpAddress](https://docs.microsoft.com/powershell/module/az.network/get-azpublicipaddress?view=latest).
@@ -277,7 +277,7 @@ You're now ready to use the NAT service.
277
277
When no longer needed, you can use the [Remove-AzResourceGroup](https://docs.microsoft.com/powershell/module/az.resources/remove-azresourcegroup?view=latest) command to remove the resource group and all resources contained within.
0 commit comments