You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
# 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 <your organizational ID email address>
|
|
|
|
|
|
|
|
# This will login in using a service principal
|
|
|
|
azure login -u "<service-principal-id>" -p "<key>" --service-principal --tenant "<tenant-id>"
|
|
|
|
|
|
|
|
# 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 acout $myacct in location 'West US'
|
|
|
|
azure storage account create ${myacct} --label $myacct --location 'West US'
|
|
|
|
|
|
|
|
# set default account environment variables
|
|
|
|
export AZURE_STORAGE_ACCOUNT=$account_name
|
|
|
|
export AZURE_STORAGE_ACCESS_KEY=$account_key
|