在Azure中使用客户端凭证授予访问存储实体的资源URL是什么
我正在尝试使用凭据赠款访问存储帐户(BLOB和表格)。访问令牌正在用于BLOB存储,但不用于访问表实体。
创建的代码
const data = querystring.stringify({
client_id: this.appId,
client_secret: this.appKey,
grant_type: 'client_credentials',
resource: 'https://storage.azure.com',
});
const config = {
method: 'post',
url: 'https://login.microsoftonline.com/' + this.DirectoryId + '/oauth2/token?api-version=1.0',
data: data,
};
try {
const result = await axiosInstance(config);
return result.data.access_token;
} catch (error) {
const errorData = error.response?.data ? error.response.data : null;
const errorDescription = errorData && errorData.error_description ? errorData.error_description : null;
if (errorDescription) {
throw new Error(errorDescription);
}
throw error;
我尝试访问所有表实体时
,我会收到以下错误“此请求无权使用此权限执行此操作。
I am trying to access storage account (blob and table) using credential grant. The access token is working for blob storage , but not for accessing table entities.
the code for creating
const data = querystring.stringify({
client_id: this.appId,
client_secret: this.appKey,
grant_type: 'client_credentials',
resource: 'https://storage.azure.com',
});
const config = {
method: 'post',
url: 'https://login.microsoftonline.com/' + this.DirectoryId + '/oauth2/token?api-version=1.0',
data: data,
};
try {
const result = await axiosInstance(config);
return result.data.access_token;
} catch (error) {
const errorData = error.response?.data ? error.response.data : null;
const errorDescription = errorData && errorData.error_description ? errorData.error_description : null;
if (errorDescription) {
throw new Error(errorDescription);
}
throw error;
when i tried accessing for get all table entities, i'm getting the below error
"This request is not authorized to perform this operation using this permission.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SDK使用范围
https://storage.azure.com/.default
,因此资源是正确的。在这种情况下,该问题似乎缺少RBAC访问表的权限。
The SDK uses the scope
https://storage.azure.com/.default
, so that resource is correct.In this case the issue seems to have been missing RBAC permissions to access the table.