Skip to content

Latest commit

 

History

History
79 lines (61 loc) · 2.72 KB

quickstart.md

File metadata and controls

79 lines (61 loc) · 2.72 KB
title description services documentationcenter author manager tags ms.assetid ms.service ms.workload ms.tgt_pltfrm ms.devlang ms.topic ms.date ms.author
Bash in Azure Cloud Shell Quickstart | Microsoft Docs
Quickstart for Bash in Cloud Shell
jluk
timlt
azure-resource-manager
azure
infrastructure-services
vm-linux
na
article
09/25/2017
juluk

Quickstart for Bash in Azure Cloud Shell

This document details how to use Bash in Azure Cloud Shell in the Azure portal.

Note

A PowerShell in Azure Cloud Shell Quickstart is also available.

Start Cloud Shell

  1. Launch Cloud Shell from the top navigation of the Azure portal
  2. Select a subscription to create a storage account and Microsoft Azure Files share
  3. Select "Create storage"

Tip

You are automatically authenticated for Azure CLI 2.0 in every sesssion.

Select the Bash environment

  1. Select the environment drop down from the the left hand side of shell window
  2. Select Bash

Set your subscription

  1. List subscriptions you have access to:
    az account list
  2. Set your preferred subscription:
    az account set --subscription my-subscription-name

Tip

Your subscription will be remembered for future sessions using /home/<user>/.azure/azureProfile.json.

Create a resource group

Create a new resource group in WestUS named "MyRG":
az group create -l westus -n MyRG

Create a Linux VM

Create an Ubuntu VM in your new resource group. The Azure CLI 2.0 will create SSH keys and setup the VM with them.
az vm create -n my_vm_name -g MyRG --image UbuntuLTS --generate-ssh-keys

Note

The public and private keys used to authenticate your VM are placed in /User/.ssh/id_rsa and /User/.ssh/id_rsa.pub by Azure CLI 2.0 by default. Your .ssh folder is persisted in your attached Azure Files share's 5-GB image.

Your username on this VM will be your username used in Cloud Shell ($User@Azure:).

SSH into your Linux VM

  1. Search for your VM name in the Azure portal search bar
  2. Click "Connect" and run: ssh username@ipaddress

Upon establishing the SSH connection, you should see the Ubuntu welcome prompt.

Cleaning up

Delete your resource group and any resources within it:
Run az group delete -n MyRG

Next steps

Learn about persisting files for Bash in Cloud Shell
Learn about Azure CLI 2.0
Learn about Azure Files storage