Azure VPN Gateway (Basic) Using PowerShell

This blog provides a step-by-step guide on setting up a site-to-site Basic Azure VPN Gateway using PowerShell. Although creating a Basic VPN Gateway in Azure isn't straightforward, as it requires command-line operations, the guide simplifies the process. Key details such as the need to use a command-line interface for creation and ensuring the public IP SKU is set to "Basic" are emphasized. This blog is perfect for those looking to establish secure connections between their on-premises network and an Azure Virtual Network while leveraging the cost-effective benefits of Azure's Basic VPN Gateway.

AZURE

Abhishek Gupta

4/29/20241 min read

Azure Basic VPN Gateway
Azure Basic VPN Gateway

Azure VPN Gateway allows organizations to establish a secure and reliable connection between their on-premises network and their Azure Virtual Network (VNet). In this blog, we will walk you through setting up a site-to-site VPN Gateway in Azure using PowerShell. This setup will enable your on-premises network to communicate securely with your Azure VNet over an encrypted VPN connection.

Creating a Site-to-Site VPN Gateway in Azure can be a straightforward process when using the right tools and commands.

This guide will walk you through the process using PowerShell. We'll specifically focus on setting up a Basic Azure VPN Gateway, which requires some specific configurations during setup.
You can follow the official Microsoft documentation for general setup instructions:


Create a site-to-site connection using Azure VPN Gateway and PowerShell.


However, to create a Basic VPN Gateway, you need to make a few adjustments when creating the public IP address:

  • AllocationMethod: Set the AllocationMethod to Static instead of Dynamic.

  • Sku: Choose Basic instead of Standard.


Below is a sample PowerShell command for creating a public IP address with these specific settings:

Request a public IP address

For Non Basic VPN Gateway

$gwpip= New-AzPublicIpAddress -Name VNet1GWPIP -ResourceGroupName TestRG1 -Location 'East US' -AllocationMethod Static -Sku Standard

For Basic VPN Gateway

$gwpip= New-AzPublicIpAddress -Name VNet1GWPIP -ResourceGroupName TestRG1 -Location 'East US' -AllocationMethod Dynamic -Sku Basic


Once you have created the public IP address with these settings, you can proceed to create the VPN Gateway as described in the Microsoft documentation linked above.


By following these adjustments, you can successfully create a Basic VPN Gateway in Azure without any issues. This approach can be beneficial if you're looking for a cost-effective and secure solution for connecting your on-premises network with Azure.