我正在尝试使用 Rest API 查询 Azure 存储表。这就是我正在做的事情:
第 1 步:使用获取身份验证 token 获取:https://login.microsoftonline.com/ {租户 ID}/oauth2/token
第 2 步:使用第 1 步中的身份验证 token ,我将按照本文档中所述调用查询表 API:https://learn.microsoft.com/en-us/rest/api/storageservices/query-tables
它抛出 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 Key
或Shared access signatures
.
关于Azure存储表Rest API抛出403 - 即使传递了身份验证 token ,服务器也无法对请求进行身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58226134/