Connecting to Azure
Connecting to Azure network from a DevZero workspace.
In this guide you will know how to setup a Bastion Host on Azure Infrastructure. This Bastion Host will allow you to connect to Private Azure services and use them directly from your DevBox.
If you're more of a visual learner, check out the video tutorial!
Step 1: Create a VNET
In this step, you will be creating a VNET. This will house all of your resources together including the bastion host.
- Go to Home > Virtual Networks > Create Virtual Network.
- Under the Basics section, enter the Resource group name.
you can select an existing Resource Group or create a new Resource Group by clicking on create new.
-
Enter the Virtual Network name and the desired region of deployment.
-
After setting up the Basics, navigate to the IP Addresses Section and create a Public subnet by entering the subnet name and Starting address of the subnet.
-
To make a private subnet in Azure, you just need to check the Enable private subnet (no default outbound access) checkbox under the Private Subnet section while creating the subnet.
-
After everything is setup, you can navigate to the Review + Create section and click on Create.
Step 2: Create a Bastion Host
Now you need to create and setup a Virtual Machine which you would be using as the Bastion Host.
- Go to Home > Virtual Machines > Create a virtual machine.
- In the Basics section, choose the same resource group which you chose for your VNET.
- Then input your VM name, region and image.
you can view the available VM images here.
- Enter your desired username and select the allow selected ports for the Public inbound ports option.
- Go to the Networking section and enter your Virtual Network (VNET). Remember to choose the public IP option as you need to configure this virutal machine to access private azure services.
- Select the Basic option for NIC network security group, it would create a security group for you which allows port access for SSH.
- Click on Review + Create and click on Create.
- Download the SSH private key when prompted, this will help you SSH into the Bastion Host later on.
Step 3: Connect to DevZero Network
Now you just need to install DevZero CLI and enable IP forwarding to access the private resources.
- SSH into your Bastion Host and install the DevZero CLI:
- Log into your account by executing:
- Enable IP forwarding to access resources on private subnets:
- Now you need to advertise your VNET route to connect to DevZero network:
- Verify that the machine is connected to your DevZero network:
You should see the Azure machine hostname.
- You should now be able to ping or ssh private Azure resources from your DevBox: