The Wayback Machine - https://web.archive.org/web/20241006100755/https://www.geeksforgeeks.org/microsoft-azure-rdp-to-azure-virtual-machines-using-azure-bastion/
Open In App

Microsoft Azure – RDP to Azure Virtual Machines using Azure Bastion

Last Updated : 31 Mar, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

In this article, we will learn how to do RDP(Remote Desktop Protocol) / SSH(Secure Shell) Connection to an Azure VM using Azure Bastion. First, let’s discuss Azure Bastion.  

The Azure Bastion service is a fully platform-managed PaaS service that you provision inside your virtual network. It provides secure and seamless RDP/SSH connectivity to your virtual machines directly from the Azure portal over TLS. Once it is deployed in a virtual network, it can be used to RDP/SSH to their VMs without exposing those VMs to public IPs. Internally, Azure Bastion is a VM scale set and it has the capability to resize itself as more sessions come in. Azure Bastion always give an RDP/SSH session on target VMs private IP address.

To set up this bastion service, we need to create a Linux or Windows Virtual Machine. Since Public IP addresses and ports are not required. Therefore, there is no need to create a public IP address and open public inbound ports. Let’s start with Linux virtual machine.

Prerequisite:

  1. Azure account  
  2. A Virtual Machine on Azure Portal

Steps to use Bastian in Linux VM:

Step 1: Go to portal.azure.com and sign in. Also, create a Linux VM with SSH public key. I have created ‘Test-VM-Linux-00’ where Image is Ubuntu Server 20.04 LTS- Gen 1. On the overview tab, click on connect and select ‘Bastion’.

Step 2: Click on ‘Use Bastion’. First, we will set up Bastion.

Step 3: On the next page. it will show the address space and we can choose the respective address space. I choose default address space. Then create a Bastion Subnet. Choose Address space for Bastion subnet and select NSG(Network Security Group) if needed.

Step 4: On the next page, create Bastian and give it a name. Select Tier, Public IP address name, and Resource group. Click on ‘Create Azure Bastion using defaults’. To customize the default settings of Azure Bastion, use the other option ‘ I want to configure Azure Bastion on my own’

Step 5: Once the Provisioning state is Succeeded, log in into the VM with Username and downloaded the private key. Click on Connect.

Step 6: The Linux Virtual machine will open in the next tab.

Azure Bastion on Windows VM:

  • Go to portal.azure.com and sign in. Also, create a Windows Virtual Machine. I have created “Test-VM-00” where the image is Windows 10 Pro, Version 20H2 – Gen 1. On the overview tab, click on connect and select ‘Bastion’.

  • Similarly, repeat steps 2-5 for the windows machines too. The windows machine will open in the next tab.


Previous Article
Next Article

Similar Reads

Microsoft Azure - Accessing Virtual Machines using Bastion
In this article, we will learn how to use Azure Baston to access virtual machines. You can use Azure Bastion to connect to your Azure VMs without exposing your VMs to the public Internet. Azure Bastion is a fully managed service used for securing Remote Desktop Protocol (RDP) and Secure Shell Protocol (SSH) access to virtual machines (VMs) that hid
2 min read
Microsoft Azure - Connecting Windows VM using RDP
In this article, we will look into how to connect to Windows VMs with RDP. Azure makes it really easy for you to connect to your Windows VMs using RDP. Follow the below steps to connect a Windows Virtual machine using RDP: Step 1: First, head over to the Virtual Machine that you want to connect to. Step 2: Now in the top navigation bar, we need to
1 min read
Microsoft Azure - Track CPU Utilization of a Azure Virtual Machines using KQL Log Query
In this article, we will look into the process of finding the Minimum, Average, and Maximum CPU Utilization of all Azure Virtual Machines using KQL Log Query. Here the Perf KQL Counter Operator is used to find Azure Virtual Machines performance from collected data logs. Implementation: Follow the below steps to Run the Log Queries. Step 1: Log in t
4 min read
Microsoft Azure - Managing Multiple Virtual Machines
In this article, we will look into how to easily start, restart, or stop multiple VMs in Microsoft Azure. You may already know that you could start, stop, and even delete VMs inside of the Azure portal. But did you know that you could do these operations to multiple VMs at the same time? Let's go over to the virtual machine section. Here we have tw
2 min read
Virtual Machines in Microsoft Azure
Before we move on with how to deploy and use virtual machines in Microsoft Azure let's know a few things. A Virtual Machine (VM) is like any physical laptop, smartphone, or server that we use in our day-to-day life. It has features like CPU, memory, storage size, and different networking ports with boot disk similar to the gadgets mentioned above.
4 min read
Microsoft Azure - Introduction to Spot Virtual Machines
In this article, we will see what are Spot Virtual Machines and how can one save costs using these virtual machines. Azure Spot Virtual Machines: Azure spot virtual machines are the VMs that are unused at the time and one can take advantage of Azure's this spare compute capacity for their needs at a very low cost as compared to the Pay-As-You-Go pr
5 min read
What Is Azure Bastion ?
Azure is a cloud service which is provided by Microsoft. It allows companies to use Microsoft's powerful computers and storage over the internet instead of having their own. This helps the companies to run their applications and store their data easily and in a secure way. With the help of Azure, users can create virtual computers, store files, bui
7 min read
How to Find AMA Agent Installed on Azure Virtual Machines using KQL Query?
Azure Monitor Agent simply known as AMA. It is a software agent that collects monitoring data from Windows and Linux machines, in Azure and non-Azure environments, including on-premises and third-party clouds. Basically, there are two types of AMA agents: Azure Monitor Agent for Windows installed for Azure Windows Servers. This collects data from W
4 min read
Connecting an AWS EC2 Instance of a Private Subnet using Bastion Host
In this article, we will see how we can connect an instance present in a private subnet with the help of an instance present in a public subnet. Let us first have look over the following mentioned Key terminologies where we will first try to understand few things (like EC2 instance and other things) theoretically and then we will jump into the impl
8 min read
7 Tips to Reduce Cost with Azure Virtual Machines
In this article, we will see various ways by which we can save costs with Azure virtual machines. Azure Virtual Machines (VMs) are software emulations of the physical computer, which have a virtual processor, memory, storage, and networking capabilities running inside the host's data center in a virtualized environment. In these cases, the host is
5 min read
What are Azure Virtual Machines?
We can create and run virtual machines (VMs) in the cloud using Microsoft Azure's Azure Virtual Machine service without having to manage the infrastructure. We might set up the required OS in the virtual machine, like Linux, Windows, or Mac. What Is Microsoft Azure?The definition of Azure is that it is an online portal that allows us to manage and
7 min read
How To Use Azure Virtual Machines For High-Performance Computing ?
Through Azure Virtual Machines, HPC jobs can take advantage of the platform's powerful and scalable nature, which is offered in the cloud environment. The possibility to boot virtual machines chosen for compute-intensive purposes helps to execute, e.g., simulations and big data analysis with ease. From one-node Batch compute virtual machines to fin
8 min read
How to Deploy a Kubernetes Cluster in Azure Virtual Machines?
Azure Kubernetes Service provides a platform for managing containers with the help of Kubernetes. It also provides an easy and managed way for the deployment and scaling of containerized applications. Containerized applications are deployed in the Kubernetes cluster in Azure. But we can also manually set up a Kubernetes cluster in Azure. Let's see
5 min read
Azure Managed Disk Types - Virtual Machines
In this article, we will be discussing the type of disk storage in Azure. In the cloud computing domain, Microsoft Azure is one of the leading platforms that provides different types of disk storage, which plays an important role in applications and data. There are mainly two main types of Disk StorageAzure Managed Disks: This is a disk service tha
10 min read
How to Deploy React App on Azure Virtual Machines?
In this article, we will study how we can deploy our existing React web application to Azure VM on Ubuntu Server. We will also see how to use the public IP of the Azure VM to access the React application using Nginx. For this article, you should know about setting up a VM in Azure. We will see how to deploy applications on Linux Server. What is a R
5 min read
Microsoft Azure - Setting up a Auto Shutdown For Azure Virtual Machine
Setting up an Auto-shutdown will help in reducing the cost of azure virtual machines. This setup is very useful during non-working hours as it saves cost and is a good practice for working with VMs in Azure. Implementation: Follow the below steps to set up auto-shutdown of Azure Virtual Machines: Step 1: Login to Azure Portal at https://portal.azur
2 min read
Microsoft Azure - Resize a Azure Virtual Machine for Windows or Linux Servers
In this article, we will look into the process of resizing Azure VM size for Linux and Windows servers. Implementation: Follow the below steps to resize a Azure Virtual Machine with new size. Note: The Process is same for both the Windows and Linux OS Servers. Step 1: Log in to Azure Portal. Step 2: Go to Virtual Machines and select your Virtual Ma
2 min read
Microsoft Azure - Retrieve Azure Virtual Machine Admin User Name
In this article, you will get to know, how you can find an azure Virtual machine admin user name in crucial situations to recover an azure VM Username. Purpose - this username will help you to reset an azure VM password in the absence of Admin or else if some forget or In case of verifying the username. Implementation: Follow the below steps to fin
1 min read
Microsoft Azure - Manage Virtual Machine via Azure Mobile App
In this article, you will get to know how to stay connected and in control of Azure virtual machines while using the Azure mobile app. The Azure mobile app is also called a VM app. Implementation: You would see the metric chart and find that spike visually via the chart and then you have those commands available for you that you can just in one cli
2 min read
Microsoft Azure - Get Azure VM Properties using Azure PowerShell
The purpose of using the Azure PowerShell Commands is to quickly analyze the overall properties of VM/VMs at once the filtering the with select and where conditions. To find the properties of an Azure VM, you can perform the following commands in Azure Cloud Shell to get the details. Command: Get-AzVM Output: 1. Get all properties of an Azure Virtu
2 min read
Microsoft Azure - Check Status of Azure VM using Azure PowerShell
The following Azure PowerShell command helps you to find the Azure VM Config and properties details of Os Name, Os Version, Hyper V Generation, Disks properties, Extensions properties of Type Handler Version, Status and Message, VM Agents properties of Type Handler Version, Status and Message and also VM Power Status Codes, Messages, Plugins, Time
3 min read
Microsoft Azure - Azure VM Disk Space in Percentage using Azure KQL
Here we'll be using the Azure Insights Metric Query to find the free disk space in percentage using KQL. The purpose of this query is to find disk drive free space of all the Azure VMs without logging into every server. You can Run the following KQL log Queries in Azure Monitor or Azure VM Logs or Log Analytics Workspace. Note: VM Insights Agent sh
1 min read
Microsoft Azure - Manage Azure VMs using Azure PowerShell Commands
Here we are using Azure PS Commands to manage azure resources from Azure Cloud Shell or by using Windows PowerShell. By using the simple AZ PS command we can manage Azure VM Quicks without any efforts of navigating in Azure Portal and at Scale. Let's get started by using the major Azure PS commands to manage Azure Virtual Machine. 1. Start a Specif
2 min read
Advantages of Virtual Machines over Portable Containers
While modern day containers seem to be the go-to solution for providing the computing environment because of their lightweight nature, in this article, we will look into the advantages of VMs over the new-age portable containers. 1. Security : VM's are more secure than containers because the applications(multiple) run inside the VM's i.e. Guest OS
3 min read
Microsoft Azure- Backing Up, Restoring, and Cloning Microsoft Azure App Services
Microsoft is well known for developing relevant software which are using in today's time of technology to conquer the demand of users and developers to build up applications. In sequence of it Microsoft introduces Azure well known as Microsoft Azure to make quality applications. In this article, we will discuss Backing up, restoring and cloning Mic
8 min read
Microsoft Azure -Create a User in Microsoft Entra ID from Azure Portal
A user in Microsoft Entra ID is an individual who can get access to Azure identity. This Microsoft Entra ID identity can be used to access applications and resources that are protected within the organization or project. Users can be created manually or automatically, and they can be assigned to groups and roles to control their access permissions.
3 min read
Microsoft Azure- Disk Storage in Microsoft Azure
Azure Disk Storage is the only shared cloud block storage that supports both Windows and Linux-based clustered or high-availability applications via Azure shared disks. There are two types of Disks in Azure : Managed Disks Unmanaged Disks.Managed DisksSimplest optionLower management overhead as Azure manages the storage accounts.Only LRS replicatio
6 min read
Microsoft Azure - Configure Azure SQL with Azure CLI
In this article, we're going to take a closer look at how you can configure something like connectivity using the Azure CLI. What we have here is we are in Azure Data Studio and similar to the SQL notebook we are actually using a PowerShell notebook. That just means all our code cells are going to run PowerShell and we are just connecting to localh
4 min read
Microsoft Azure - Get CPU Utilization Data of a Azure VM in Azure Portal
Azure Virtual Machines (VM) is one of several types of on-demand, scalable computing resources that Azure offers. In this article, we will look into the process of getting the CPU Utilization data of an Azure VM in Azure Portal. Implementation: Follow the steps to get the CPU Utilization of an Azure VM in Azure Portal: Step 1: Log in to your Azure
2 min read
Microsoft Azure - Archive Azure VM to Azure Storage Account
In this article, we will be implementing a solution to archive a select azure VM snapshot to a select storage account for archiving using azure cloud shell. For implementation, we will be using Azure CLI commands. Prerequisite:VM SnapshotA storage account is neededUser needs "Storage Blob Contributor Data" IAM Role Access on Archiving Storage Accou
2 min read