操作失败:“此请求无权执行此操作。”与Pyspark笔记本的突触
我尝试执行以下命令行:
mssparkutils.fs.ls("abfss://[email protected]/myfolder/")
我得到错误:
Py4JJavaError: An error occurred while calling z:mssparkutils.fs.ls.
: java.nio.file.AccessDeniedException: Operation failed: "This request is not authorized to perform this operation.", 403, GET, https://myadfs.dfs.core.windows.net/mycontainer?upn=false&resource=filesystem&maxResults=5000&directory=myfolder&timeout=90&recursive=false, AuthorizationFailure, "This request is not authorized to perform this operation.
我遵循此 link
通过授予对我和我的访问权限我的Synapse工作区“存储斑点数据贡献者”在容器或文件系统级别中的作用:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在环境中也有同样的错误。我刚刚跟随此 官方文件 并完成了repro,现在对我来说很好。您可以按照以下代码解决您的问题。
示例代码:
访问blob存储
样本输出:
i.sstatic.net/njobg.png“ rel =“ nofollow noreferrer 答案
引用pyspark笔记本中的配置火花:
https://techcommunity.microsoft.com/t5/azure-synapse-analytics-blog/notebook-this-请求 - 毫无授权到绩效 - 此/ba-p/1712566
I got the same kind of error in my environment. I just followed this official document and done the repro, now it's working fine for me. You can follow the below code it will solve your problem.
Sample code:
Access to Blob Storage
Sample output:
Updated answer
Reference to configure Spark in pyspark notebook:
https://techcommunity.microsoft.com/t5/azure-synapse-analytics-blog/notebook-this-request-is-not-authorized-to-perform-this/ba-p/1712566
另一种可能性是,您的存储防火墙在包含数据湖/斑点容器的存储帐户上运行。
据我所知,除非您在Synapse实例上启用了私有网络,否则就无法解决此问题 - 在这种情况下,您可以创建一个托管的私有端点,以使SPARK成为存储网络路由。
Another possibility is that you have Storage Firewall running on the Storage Account containing your Data Lake/Blob Container.
As far as I can make out there is not way around this unless you have private networking enabled on your Synapse instance - in which case you can create a Managed Private Endpoint to enable a Spark to Storage network route.