# install azure-cli sudo apt-get install nodejs-legacy sudo apt-get install npm sudo npm install -g azure-cli # This will output an url and a device code for you to use browser to login azure login # This will prompt for your password in the console azure login -u # This will login in using a service principal azure login -u "" -p "" --service-principal --tenant "" # List VMs disks azure vm disk list # Remove all disks of VMs labeled with LABEL for disk in $(azure vm disk list | grep LABEL | awk '{print $2}') do azure vm disk delete --blob-delete "$disk" done # Create storage acount $myacct in location 'West US' azure storage account create ${storage_account} --label ${storage_account} --location 'West US' # Set default account environment variables export AZURE_STORAGE_ACCOUNT=$account_name export AZURE_STORAGE_ACCESS_KEY=$account_key # Create a VM image based on a storage file azure vm image create ${image_name} --os linux -l 'West Europe' --blob-url https://${storage_account}.blob.core.windows.net:443/vms/${image_name}.vhd -v # Share a file (a vm image for example) with the world: azure storage blob sas create -a ${storage_account} --container ${container} --blob ${filename} --permissions r