【问题标题】:Azure Data lake throwing error - Make sure the value of Authorization header is formed correctly including the signatureAzure 数据湖抛出错误 - 确保正确形成授权标头的值,包括签名
【发布时间】:2021-02-22 20:27:09
【问题描述】:

我正在使用我的存储密钥测试 Azure 数据湖功能。当我尝试在容器中创建目录时,它把我抛到了异常之下。如何解决错误?

Python 代码:

import os, uuid, sys
from azure.storage.filedatalake import DataLakeServiceClient
from azure.core._match_conditions import MatchConditions
from azure.storage.filedatalake._models import ContentSettings
from azure.storage.blob import BlobServiceClient

global service_client

service_client = DataLakeServiceClient(account_url="{}://{}.dfs.core.windows.net".format(
    "https", storage_account_name), credential=storage_account_key)
file_system_client = service_client.get_file_system_client(file_system="demo")
file_system_client.create_directory("demo-directory")

例外:

(AuthenticationFailed) Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:f3880178-801f-0073-2c58-09be43000000
Time:2021-02-22T20:22:15.9974202Z

【问题讨论】:

    标签: python azure azure-data-lake azure-data-lake-gen2


    【解决方案1】:

    您的代码是正确的。但是您将错误的值传递给credential。你应该通过Key 而不是connection string

    当我将connection string 传递给credential 时,我收到了与您相同的错误消息。

    你可以在这里找到Key

    【讨论】:

      猜你喜欢
      • 2021-07-29
      • 2022-01-27
      • 2014-03-18
      • 2021-09-19
      • 1970-01-01
      • 1970-01-01
      • 2021-03-21
      • 2015-05-12
      • 1970-01-01
      相关资源
      最近更新 更多