an Azure file share to persist files across sessions. (The storage is mounted onto ~/clouddrive, ~ is is persisted as an .img in the Azure File share. Files outside of ~ (as well as the machine state) are not persisted across sessions.)
A user can change the default shell to be used for the next session anytime via the environment selector in the Cloud Shell toolbar
All functionality that is provided through the Azure Cloud Shell is also available on the Portal within 180 days after the initial release (on the Shell?)
First use
When Cloud Shell is used the first time, it asks to assign storage:
Clicking advanced options allows to enter the name for a resource group , storage account and file share. (Note that there are some restrictions for the names: For example, the resource name can only consist of letters, digits, underscores, hyphens, parantheses or the storage account only of numbers and lowercase letters).
Copy Paste
Text can be copied from the shell running in the web brower with ctrl+v and inserted into the shell with shift+insert.
The directories in the Azure:drive correspond to the available subscriptions.
PS /> cd Azure:
PS Azure:\> dir
Mode SubscriptionName SubscriptionId TenantId State
---- ---------------- -------------- -------- -----
+ TQ84 Subscription 01234567-89ab-cdef-fedc-ba9876543210 fedcba98-7654-3210-0123-456789abcdef Enabled
…
PS Azure:\> cd '/.TQ84 Subscription`
Being «in» a subscription directory, the «sub folders» list different views on the resources.
PS Azure:\> dir
…
Mode Name
---- ----
+ AllResources
+ ResourceGroups
+ StorageAccounts
+ VirtualMachines
+ WebApps
az init
The init extension is intended to quickly set up global configurations for an enverionment.
$ az extension add --upgrade --name init
The installed extension 'init' is in preview.
$ az init
…
Misc
az commands
Some az commands include:
az account list
List subscriptions I have access to
az account set --subscription 'some-subscription-name'
Set preferred subscription (and then stored in ~/.azure/azureProfile.json)
az group create --location westus --name SomeRG
Create a new resource group
az vm create -n myVM -g SomeRG --image UbuntuLTS --generate-ssh-keys
Create an Ubuntu VM in your new resource group. The Azure CLI will create SSH keys and set up the VM with them. (Keys are stored in ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub)
View all resource providers and their registration status for the current(?) subscription
ACC* environment variables
ACC_CLOUD
For example PROD
ACC_LOCATION
contains the current region, for example: WESTEUROPE
ACC_OID
ACC_PUID
ACC_STORAGE_PROFILE
ACC_TERM_ID
ACC_TID
ACC_VERSION
PowerShell profile
The PowerShell profile seems to be stored in $HOME/.config/PowerShell.
TODO
$ az provider list -o table
$ az vm list -g $RESOURCE_GROUP_NAME --query "[].id" -o tsv
$ az config get
$ ls ~/.azure
$ az login
$ az feedback
$ az configure --list-defaults
…
$ az configure
Welcome to the Azure CLI! This command will guide you through logging in and setting some default values.
Your settings can be found at /home/rene/.azure/config
Your current configuration is as follows:
…