Here is a working Python code.
from azure.storage.blob import BlockBlobService
accountName, key='stagingData', 'vZfqyMyHT3A=='
blobService=BlockBlobService(account_name=accountName, account_key=key)
It seems the blobService client object is created even if I pass wrong account credentials. It is not authorised, and the error shows up only later when I try to access some data, possibly from some other file or even when different users try to use it. Is there a way to assert
right on the spot whether correct credentials were supplied and halt the execution if not? For reference, I tried dir(blobService)
and that displayed 121 methods and attributes. The ones that seemed sensible from the name, show similar results whether the account is actually authenticated or not.
Almost every other API call which uses some access token lets you know right on the spot if the token is not valid, by raising some exception. So I hope there is a way to check it for the BlockBlobService class as well.