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

使用REST API创建OneLake文件时遭遇401未授权及受众验证失败

OneLake REST API 创建文件时401授权错误处理

问题详情

  • 请求方式:PUT
  • 请求地址:https://onelake.dfs.fabric.microsoft.com/{workspace}/{item}.{itemtype}/Files/sample?resource=file
  • 返回状态码:401 Unauthorized
  • 错误提示:Authentication Failed with Audience validation failed for audience 'https://analysis.windows.net/powerbi/api'
  • 前置条件:应用已配置所有Power BI权限并完成授权流程,但调用接口仍失败
  • 同类情况:微软Fabric社区存在相同未解决案例

解决建议

  • 修正令牌受众:OneLake API要求的令牌受众是https://onelake.dfs.fabric.microsoft.com/,而非Power BI API的受众。获取访问令牌时,需将scope指定为https://onelake.dfs.fabric.microsoft.com/.default,确保令牌的aud字段匹配OneLake地址。
  • 检查权限范围:确认应用权限是否包含OneLake相关的存储权限(如Storage Blob Data Contributor),而非仅配置Power BI权限。
  • 验证令牌内容:使用jwt.ms解析获取到的令牌,检查aud字段是否为https://onelake.dfs.fabric.microsoft.com/,排除令牌生成错误。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.10 22:32:36