I am using python 3.7.8 and trying to access azure data lake account files getting this error.
dependencies version details:
azure-core 1.13.0
azure-storage-blob 12.8.1
azure-storage-file-datalake 12.2.0
Flask 1.1.2
Flask-Cors 3.0.10
waitress 2.0.0
apptest.py
import json
from flask_cors import CORS
import base64
import sys
from flask import Flask, request, jsonify
from azure.storage.filedatalake import DataLakeServiceClient
from azure.storage.blob import BlobServiceClient,generate_blob_sas, generate_account_sas, ResourceTypes, AccountSasPermissions,BlobSasPermissions
app = Flask(__name__)
app.config["DEBUG"] = True
CORS(app)
from waitress import serve
def get_service_client(requestPayLoad):
try:
credentials=get_Credentials(requestPayLoad)
service_client= DataLakeServiceClient(account_url="{}://{}.dfs.core.windows.net".format(
"https", credentials['storage_account_name']), credential=credentials['storage_account_key'])
return service_client
except Exception as e:
print(e)
def get_Credentials(requestPayLoad):
storage_account_name= config['accountName'] if requestPayLoad["TypeOfData"]=='Private'else config['publicAccountName']
storage_account_key= config['accountKey'] if requestPayLoad["TypeOfData"]=='Private'else config['publicAccountKey']
return json.loads(json.dumps({"storage_account_name": storage_account_name, "storage_account_key": storage_account_key}))
server error:
[2021-08-13 09:35:56,632] ERROR in server: 'dict' object has no attribute 'iter'
ERROR:server:'dict' object has no attribute 'iter'
ERROR:waitress:Exception while serving /api/
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/waitress/channel.py", line 397, in service
task.service()
could you please help me to solve the error?
Thanks.