0

我正在尝试使用我的 databricks 笔记本中的以下代码片段将 azure 存储帐户添加到我的数据源:

datasource_config = {
    "name": "my_azure_datasource",
    "class_name": "Datasource",
    "execution_engine": {
        "class_name": "SparkDFExecutionEngine",
        "azure_options": {
            "account_url": "<YOUR_ACCOUNT_URL>",
            "credential": "<YOUR_CREDENTIAL>",
        },
    },
    "data_connectors": {
        "default_inferred_data_connector_name": {
            "class_name": "InferredAssetAzureDataConnector",
            "azure_options": {
                "account_url": "<YOUR_ACCOUNT_URL>",
                "credential": "<YOUR_CREDENTIAL>",
            },
            "container": "<YOUR_CONTAINER>",
            "name_starts_with": "<CONTAINER_PATH_TO_DATA>",
            "default_regex": {
                "pattern": "(.*)\\.csv",
                "group_names": ["data_asset_name"],
            },
        },
    },
}

但是当我尝试通过运行添加此数据源时context.add_datasource(**datasource_config),我收到以下错误:

Unable to load Azure BlobServiceClient (it is required for InferredAssetAzureDataConnector).

我确定我正确地提供了 account_url 和凭据。因为如果我BlobServiceClient单独使用,我可以连接到存储帐户。

请帮忙。

4

0 回答 0