Azure权限:未被授权执行此操作。

5

我有一个数据工厂,调用一个Azure函数来读取Blob存储。但是我不明白为什么会出现这个错误:"此请求未被授权执行此操作"。这是数据工厂、Azure存储还是Azure函数的问题?

我已经将服务主体添加到Storage Blob Data Contributor中,但没有成功。

在这个特定的文件夹中,我应该添加什么权限以便在存储资源管理器中使用?enter image description here

{
    "name": "TPFunction",
    "instanceId": "4ef6513ebfc6bb",
    "runtimeStatus": "Failed",
    "input": {
        "environment": "dev",
        "DateToProcess": "2013-04-08",
        "SourceStorageType": "AdlsGen2",
        "SourceAccountName": "storage06",
        "SourceBlobContainer": "data",
        "SourceFilePath": "file/file/file"
    },
    "customStatus": null,
    "output": "Orchestratorfunction 'TPFunction' failed: Following error occurred during execution: The activity function 'TPFunction' failed: \"Error occurred getting list of files: This request is not authorized to perform this operation using this permission.\nRequestId:7b5e-e4a603\nTime:2013-04-08:02:27.0924606Z\r\nStatus: 403 (This request is not authorized to perform this operation using this permission.)\r\nErrorCode: AuthorizationPermissionMismatch\r\n\r\nHeaders:\r\nServer: Windows-Azure-HDFS/1.0,Microsoft-HTTPAPI/2.0\r\nx-ms-error-code: AuthorizationPermissionMismatch\r\nx-ms-request-id: 7b5e-e4a603\r\nx-ms-version: 2019-07-07\r\nx-ms-client-request-id: e7357b5e-e4a603cc52\r\r\nContent-Length: 227\r\nContent-Type: application/json; charset=utf-8\r\n\". See the function execution logs for additional details.",
    "createdTime": "2021-01-04T19:02:24Z",
    "lastUpdatedTime": "2021-01-04T19:02:27Z"
}

1
你能展示一下你的函数代码吗? - Cindy Pau
很遗憾我不能,但问题已经解决了。其中一个服务主体缺失了存储 Blob 数据贡献者的权限。 - OrganicMustard
如果您没有更多问题,我们现在可以结束这个问题了吗?:) - Cindy Pau
1个回答

6
我在此发布“403禁止访问”的主要情况,并发布相关解决方法。 第一种情况:我们没有给予功能应用程序访问权限。 解决方案: 如果您想访问存储区块数据,则需要为相关服务提供“存储区块数据参与者”RBAC角色。 第二种情况:存储已受到防火墙的保护。 解决方案: 1、第一种方法:将Web应用程序的出站IP添加到存储的白名单中。
2、第二种方法:在Azure上创建虚拟网络。

enter image description here

enter image description here

然后将网络添加到存储的防火墙设置中:

enter image description here


当Azure API访问Blob存储时,我也遇到了403错误,请查看此帖子:https://stackoverflow.com/questions/76370426/this-request-is-not-authorized-to-perform-this-operation-azure-blob - Saad Awan
请注意使用Storage Blob Data Contributor而不是Storage Account Contributor(后者无法访问数据)。 - undefined

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接