Azure存储表Rest API抛出403 - 即使传递了身份验证 token ,服务器也无法对请求进行身份验证

标签 azure azure-storage azure-table-storage

我正在尝试使用 Rest API 查询 Azure 存储表。这就是我正在做的事情:

第 1 步:使用获取身份验证 token 获取:https://login.microsoftonline.com/ {租户 ID}/oauth2/token enter image description here

第 2 步:使用第 1 步中的身份验证 token ,我将按照本文档中所述调用查询表 API:https://learn.microsoft.com/en-us/rest/api/storageservices/query-tables

enter image description here

它抛出 403 - 服务器无法验证请求错误。 这不是正确的做法吗?

最佳答案

Azure 表存储不支持使用 Azure AD 进行授权。

引用 - Authorize access to Azure blobs and queues using Azure Active Directory

Authorization with Azure AD is available for all general-purpose and Blob storage accounts in all public regions and national clouds. Only storage accounts created with the Azure Resource Manager deployment model support Azure AD authorization. Authorization with Azure AD is not supported for Azure Table storage.

要授权对 Azure 表存储的请求,您需要使用 Shared KeyShared access signatures .

关于Azure存储表Rest API抛出403 - 即使传递了身份验证 token ,服务器也无法对请求进行身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58226134/

相关文章:

azure - 如何将具有不同时间戳属性的多个 Azure IoT 设备的数据引入同一个 Azure 时序见解环境?

azure - ASP.Net Core 2.2 - Azure SAS token ?

c# - 使用 Azure 进行存储的 Web 应用程序

c# - 如何在 TableOperation 中从 Azure 表存储中检索实体列表而不指定 rowKey?

asp.net-mvc - 使用 AspProviders、MVC 和 Azure 时是否需要存储 session 状态

azure - 使用 ARM API 更新 Azure Function 中的应用程序设置

azure - 嵌套模板中引用listKeys()

c# - 当表中存在记录时,Azure 表存储查询不会从有效筛选器中检索任何实体

azure - 探索 Azure 云本身内的 Azure 表存储中的数据

windows - Jenkins Azure Blob 存储插件,用于将 Build 文件夹的内容而不是构建文件夹的内容复制到 $web azure blob static cotainer