Storage account not found problem when using az storage blob upload
Sometimes we will encounter storage account not found problem even we have created the storage account and done az login.
$ az storage blob upload --container-name consul-xxxx --account-name storagexxxx --file upload --name uploadaz storage blob upload: error: Storage account 'storagexxxx' not found.
The cause may be that your az login subscription is not same as the subscription where the storage account is in. You can change your az login subscription by:
az account set --subscription "subscription-xxx"
Then you can upload your blob successfully.
$ az storage blob upload --container-name consul-xxxx --account-name storagexxxx --file upload --name uploadFinished[#############################################################] 100.0000%
{
"etag": "\"0x8D7E3A3746007FF\"",
"lastModified": "2020-04-18T14:19:06+00:00"
}