You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure Databricks中/mnt/training路径授权头认证失败问题咨询

解决Azure托管Databricks中/mnt/training路径认证失败问题

问题重现

执行Coursera DP203课程提供的Databricks代码时触发认证错误:

%fs head /mnt/training/wikipedia/pageviews/pageviews_by_second.tsv

报错信息:

AzureException: hadoop_azure_shaded.com.microsoft.azure.storage.StorageException: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
Caused by: StorageException: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.

问题原因

  • 环境挂载配置差异:Databricks社区版预配置了/mnt/training路径的公共数据集挂载,而Azure托管Databricks的课程环境在迁移到ADLS Gen2后,未同步更新该挂载点的认证配置,导致旧路径的权限验证失效。
  • 课程内容未同步适配:课程提供的代码仍沿用旧挂载路径,但未说明ADLS Gen2所需的SAS密钥或ABFS挂载方式,且普通用户权限受限无法自行修复挂载配置。

有效解决方案

以下几种方式可正常访问目标维基百科数据集:

  1. 使用Databricks内置公开数据集路径:
    # 查看目录内容
    display(dbutils.fs.ls('/databricks-datasets/wikipedia-datasets/data-001/pageviews/raw/'))
    # 读取文件内容
    %fs head /databricks-datasets/wikipedia-datasets/data-001/pageviews/raw/pageviews_by_second.tsv
    
  2. Spark读取时直接引用内置路径:
    csvFile = "/databricks-datasets/wikipedia-datasets/data-001/pageviews/raw/pageviews_by_second.tsv"
    df = spark.read.csv(csvFile, sep="\t", header=True)
    df.display()
    
  3. 临时使用已弃用的wasbs协议(仅作临时兼容,不推荐长期使用):
    df = spark.read.csv("wasbs://<container>@<storage-account>.blob.core.windows.net/path/to/pageviews_by_second.tsv", sep="\t", header=True)
    

额外提示

若后续课程环节必须使用ADLS Gen2的挂载路径,需联系课程管理员获取预配置的挂载脚本或SAS密钥,避免因权限不足无法自行配置ABFS挂载。

内容的提问来源于stack exchange,提问作者Ged

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.26 10:20:09