Below is the code I am using to access the files in my storage account but I get below error . Is anyone error what wrong am I doing here. The key passed here is correct and so is the container and folder name. The error is received at line .parallellize([blob.name for blob....
AzureHttpError: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. ErrorCode: AuthenticationFailed
import re
import json
%pip install azure
import azure
from azure.storage.blob import AppendBlobService
abs = AppendBlobService(account_name='azdevstoreforlogs', account_key="?sv=2021-06-08&ss=bfqt&srt=sco&sp=rwfx&se=2022-06-14T15:48:24Z&st=2022-06-14T07:48:24Z&spr=https&sig=uPA%3D")
base_path = 'resourceId=/SUBSCRIPTIONS/531subs IDD0-6C3AEB/RESOURCEGROUPS/AZURE-DEV/PROVIDERS/MICROSOFT.CONTAINERSERVICE/MANAGEDCLUSTERS/AZURE-DEV/y=2022/m=05/d=23/h=13/m=00/PT1H.json'
spark.sparkContext \
.parallelize([blob.name for blob in abs.list_blobs('insights-logs-kube-audit', prefix=base_path) if re.match(filter, blob.name)]) \
.map(lambda blob_name: abs.get_blob_to_bytes('insights-logs-kube-audit', blob_name).content.decode('utf-8').splitlines()) \
.flatMap(lambda lines: [json.loads(l) for l in lines]) \
.collect()