AzureStorageClient raises the error:
Unable to determine account name for shared key credential
This is the line of code that I am trying to use to connect to my azure account, I am trying to connect this with my Azure Storage Account
storage_client = AzureStorageClient(account_url=<blob_service_url>, container=<container_name>, credential=<connecion_string>)
I am trying to use Azure blob storage as my storage client to use with Azure Database for PostgreSQL using SQLAlchemyDataLayer as my data layer.
I know this could be caused by the use of bad key on my part, but I am using the same keys for other functions and they work fine.
I am frankly new using Azure, and chainlit, and I have tried all I can think about to solve this.
I would be thankful for any insight or guidance on this matter.
I expected it to work, and I try using different keys, and read the documentation and cannot find my mistake
AzureStorageClient Class requires Data Lake Storage endpoint, instead of Blob Service endpoint. The line of code you are using to connect to azure account is supposed to be:
storage_client = AzureStorageClient(account_url="https://{}.dfs.core.windows.net".format('<storage_account>'), container='<container>', credential='<key>')
You can find Data Lake Storage endpoint from Endpoints tab of Storage Account in Azure portal. See the screenshot:
Just FYI: In below screenshot from VS Code, if you pay attention to account_url sample parameter, you can see that the url with .dfs. is provided which is Data Lake Storage endpoint.

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With