
[英]Azure Synapse web activity calling "pipelineruns" rest api , fails with "failureType": "UserError"
[英]Azure Synapse Web Activity 'GetFolderByServerRelativeUrl' Unauthorized Access
我正在尝试从 Azure Synapse Pipeline Activity 中的 sharepoint 站点获取文件列表。
我正在使用 2 个 web 活动,第一个获取访问令牌,第二个获取相对 url: https://testsite.sharepoint.com/sites/Repository/_api/web/GetFolderByServerRelativeUrl('/sites/Repository/共享%20Documents/General')/Files
第二个 web 活动失败并出现此错误:{ "errorCode": "2108", "message": "{"odata.error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{ "lang":"en-US","value":"试图执行未经授权的操作。"}}}", "failureType": "UserError", "target": "Web2", "details": [] }
此外,如果有人知道任何其他方法来获取 Azure Synapse 中 sharepoint 文件夹内的文件列表,请告诉我。 我尝试使用 Sharepoint 在线列表,但它只显示文档库和列表,不会将 go 显示到文档库内的子文件夹中。
您可以尝试使用图表 API 列出 SharePoint 站点中的文件和文件夹。 和 SharePoint REST API 工作流程没什么区别,首先你需要给你的应用程序授予 Graph API 权限,然后使用委托的认证流程(比如auth code flow )得到一个token,最后用这个token调用Graph API端点。
1.列出根目录下的所有文件/文件夹:
https://graph.microsoft.com/v1.0/sites/{site id}/drive/root/children
2.列出特定文件夹下的文件/子文件夹:
https://graph.microsoft.com/v1.0/sites/{site id}/drive/root:/{folder name}:/children
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.