Use Azure service principal for authentication to storage, instead of account key
At the moment, it is a bit complicated to use the CLI to upload files to Azure storage.
First you need to login to Azure:
az login --service-principal --username $USERNAME --password $PASSWORD --tenant $TENANT
Then you need to retrieve the keys for the storage account:
az storage account keys list --account-name $STORAGEACCOUNTNAME --resource-group $RESOURCE_GROUP
Then you have to parse the result and retrieve the keys.
Then you can use the keys to upload some files:
az storage blob upload-batch --account-name $STORAGEACCOUNTNAME --account-key $STORAGEACCOUNTKEY --destination /css --source /css --pattern '*.css' --content-type text/css"
Why can't I just reuse the credentials being used to login with the Azure client in order to authenticate with the storage API?
Even if an account key must be used behind the scenes, could the CLI wrap this complexity so I don't have to do it myself?