When working on OS X and Linux, you need to use the
azure-cli to manage your account, vm, storage, websites, etc.
Installing the Azure Command Line Interface
azure-cli is pretty easy. You can simply run:
$ npm install -g azure-cli
Downloading your credentials
To connect to your Azure profile, you need to download your credentials from the Azure website and then import them. Simply run the following:
$ azure account download
$ azure import /path/to/where/you/downloaded/the/file
Now that your credentials are set, you can easily manage your virtual machines, starting, stopping or restarting them.
Accessing your storage account
But if your try to access your storage account...
$ azure storage container list
...things become tricky and you might get an error like this one:
For security reasons, Azure doesn't want your to use your credentials to access your storage accounts.
That's why you need to provide your
AZURE_STORAGE_ACCOUNT and your
The best way to do so is to run:
$ export AZURE_STORAGE_ACCOUNT=myAzureStorageAccount $ export AZURE_STORAGE_ACCESS_KEY=myAzureStorageAccessKey
It might be cumbersome to do that each time you need to manage your containers and blobs but it might be the only way if you have different storage accounts.
Also, if you use git and a public repo to manage your
.dotfiles, it is important that you do not include those two lines inside your
.zshrc because you don't want anyone accessing your storage!
But your could source another non-git-tracked file.