Creating a new public IP address with PowerShell
Alternatively, we can create a public IP address using Azure PowerShell. Again, this approach is best when we want to automate the process. Even though a public IP address can exist on its own, it's usually created to be associated with other resources and to be used as an endpoint. When using PowerShell to create a resource, we can continue to the next step and join it with a resource in a single script.
Getting ready
Open the PowerShell console and make sure you are connected to your Azure subscription.
How to do it...
To deploy a new public IP address, execute the following command:
New-AzPublicIpAddress -Name 'ip-public-script' -ResourceGroupName 'Packt-Networking-Script' -AllocationMethod Dynamic -Location 'westeurope'
How it works...
As an outcome, a new public IP address will be created. The settings, in this case, will be a basic SKU dynamic assignment, IPv4 version, and...