Getting started with Bash for Azure Cloud Shell
Having learned about the Azure Cloud Shell overview and getting started with Azure Powershell, let's take a look at the Bash Quick start in Azure Cloud Shell.
1. Log in to Azure Portal and start CloudShell
Start Cloud Shell from the navigation bar, as shown below
Switch to Bash
Click OK to switch to Bash
Enter the Bash environment
two。 View and set preferred subscriptions
Use az account list to view
Use az account set to set preferred subscriptions
3. Create a resource group
Create a new resource group called "TestBash" in EastUS. Enter the following command az group create-- location eastus-- name TestBash
4. Create Linux VM
Create a Ubuntu VM in the new resource group. Entering the following command az vm create-n BashQS-g TestBash-- image UbuntuLTS-- generate-ssh-keys,Azure CLI in Bash will create the SSH keys and use them to create the setup VM.
5. Link to Linux VM through SSH
Find the virtual machine you just created in the portal, as shown below.
Click the link-SSH, find "Log in using VM Local account", and copy the string in the text box, as shown in the following figure
Paste the copied ssh command into ssh yunze2018@13.90.246.141 in the Bash window. After the connection is successful, you can see the welcome screen, as shown in the following figure.
You can view the hostname and IP address
6. Clear
Exit ssh using the exit command
Use the az group delete command to delete the resource group you just created and all resources under it