You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This Exec Doc demonstrates how to create a resource group, deploy a Linux VM using a supported Ubuntu image, retrieve its public IP address, and then SSH into the VM. The process uses environment variables to manage configuration details and appends a random suffix to resource names to ensure uniqueness.
14
+
15
+
The following sections walk through each step with code blocks. Remember that you must already be logged in to Azure and have your subscription set.
16
+
17
+
## Step 1: Create a Resource Group
18
+
19
+
In this section, we declare environment variables necessary for the deployment and create a resource group in the "centralindia" region. A random suffix is appended to the resource group name to guarantee uniqueness.
20
+
21
+
```bash
22
+
export RANDOM_SUFFIX=$(openssl rand -hex 3)
23
+
export REGION="centralindia"
24
+
export RG_NAME="LinuxRG$RANDOM_SUFFIX"
25
+
az group create --name $RG_NAME --location $REGION
Now we create a Linux VM using a supported Ubuntu image ('Ubuntu2204'). In this example, we use a Standard_B1s VM size. We also set an administrator username and let Azure generate SSH key pairs automatically. A random suffix is used in the VM name for uniqueness.
echo"The public IP address of the VM is: $VM_PUBLIC_IP"
87
+
```
88
+
89
+
Results:
90
+
91
+
<!-- expected_similarity=0.3 -->
92
+
```text
93
+
The public IP address of the VM is: 13.92.xxx.xxx
94
+
```
95
+
96
+
## Step 4: SSH into the Linux VM
97
+
98
+
Finally, once you have retrieved the public IP address, you can SSH into your Linux VM using the generated SSH key pair. This command establishes an SSH connection without prompting for host key verification.
When executed, this command initiates an SSH session with your Linux VM. After connecting, you will have full access to manage and configure the VM as needed.
105
+
106
+
---
107
+
108
+
This Exec Doc has successfully deployed a Linux VM in Azure using a supported Ubuntu image and shown how to connect to it using SSH, all accomplished with a series of Azure CLI commands executed via the Innovation Engine.
0 commit comments