Quickstart: Deploy Azure Bastion
This quickstart guide will walk you through the steps to deploy Azure Bastion in your Azure virtual network. Azure Bastion is a fully managed PaaS service that you deploy directly into your virtual network. It provides secure and seamless RDP and SSH connectivity to your virtual machines directly through the Azure portal over TLS.
Prerequisites
- An Azure account with an active subscription. If you don't have one, create a free account.
- A virtual network (VNet) in your Azure subscription. If you don't have one, you can create one using the Azure portal, Azure CLI, or Azure PowerShell.
Steps
You need to create a dedicated subnet for Azure Bastion. This subnet is named AzureBastionSubnet. This subnet must be named exactly this, and it must have a minimum prefix of /26.
To create the subnet:
- Navigate to your virtual network in the Azure portal.
- Select Subnets from the left-hand menu.
- Click + Subnet.
- Enter
AzureBastionSubnetas the name. - Set the address range to at least
/26. - Click Save.
Now, you can deploy the Azure Bastion service.
To deploy Bastion:
- In the Azure portal, search for "Bastion" and select it.
- Click Create.
- On the Basics tab:
- Subscription: Select your Azure subscription.
- Resource group: Select an existing resource group or create a new one.
- Name: Enter a name for your Bastion resource (e.g.,
myBastion). - Region: Select the same region as your virtual network.
- Virtual network: Select the virtual network where you created
AzureBastionSubnet. - Subnet: Select
AzureBastionSubnet. - Public IP address:
- Click Create new.
- Enter a name for the public IP address (e.g.,
myBastion-ip). - Ensure the SKU is Standard and Assignment is Static.
- Click OK.
- Click Review + create.
- After validation passes, click Create.
Deployment can take several minutes. Wait for the deployment to complete.
Once Bastion is deployed, you can connect to your virtual machines.
To connect:
- Navigate to the virtual machine you want to connect to in the Azure portal.
- Click Connect.
- Select Bastion from the dropdown.
- In the Bastion tab, enter the username and password for your VM.
- Click Connect.
A new browser tab will open, and you'll be connected to your VM via RDP or SSH through Azure Bastion.
Ensure that your virtual machine's network security group (NSG) allows inbound RDP (port 3389) or SSH (port 22) from the Azure Bastion subnet or the Azure Bastion service tag (AzureBastionSubnet).
Azure Bastion is a managed service. You do not need to install any agents on your virtual machines. Ensure your VMs have public IP addresses if you plan to connect without Bastion, but Bastion bypasses this requirement.
Next Steps
Congratulations! You have successfully deployed Azure Bastion and connected to a virtual machine. To learn more about Azure Bastion and its advanced features, refer to the following resources: