How to fix ClientAuthenticationError when accessing the parquet (PyArrow) file through Blob Storage?

Wei Zhang 40 Reputation points
2024-03-20T20:48:11.91+00:00

HI everyone

When I tried to build a blob client to access one .parquet file in Blob datastore with following script:

import os  
from azure.storage.blob import   BlobServiceClient  
import pandas as pd  
from io import BytesIO  

connection_str = "*****"
container = "*****"
blob_path = "./source/****.parquet"

blob_service_client = BlobServiceClient.from_connection_string(connection_str)
blob_client = blob_service_client.get_blob_client(container = container, blob = blob_path) 
stream_downloader = blob_client.download_blob()  #error happened here

stream = BytesIO() 
df = pd.read_parquet(stream, engine = 'pyarrow') 


It showed the following error message for this step:

blob_client.download_blob()

ClientAuthenticationError: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:* Time:2024-03-20T20:40:44.8529867Z ErrorCode:AuthenticationFailed authenticationerrordetail:The MAC signature found in the HTTP request '****' is not the same as any computed signature. Server used following string to sign: 'GET

Could someone have a clue about this? Thank you

Azure Blob Storage
Azure Blob Storage

An Azure service that stores unstructured data in the cloud as blobs.

0 comments No comments

1 answer

Sort by: Newest
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    2 deleted comments

    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.