【发布时间】:2021-03-05 06:11:59
【问题描述】:
更新
我尝试了以下但得到This operation can only be executed against the primary storage location. 错误:
var azure = require('azure-storage');
const host = {
primaryHost: `https://${primaryAccountName}.table.core.windows.net`,
secondaryHost: `https://${primaryAccountName}-secondary.table.core.windows.net`
};
var tableSvc = azure.createTableService(primaryAccountName, accessKey, host);
tableSvc.retrieveEntity(tableName, 'hometasks', '1',
{ locationMode: locationMode.SECONDARY_ONLY }
, function(error, result, response){
if(error){
console.log('Error on retrieveEntity!', error, result, response);
} else {
console.log('Entity retrieved', task.published._);
}
});
retrieveEntity 不是读操作吗?可以对二级存储执行哪些读取操作?
【问题讨论】:
-
存储帐户的辅助终结点没有单独的访问密钥。您确定您使用的是正确的访问密钥吗?
-
首先通过使用 Azure 存储资源管理器进行测试,确认所有端点和密钥都正确。
-
我更新了问题,我需要使用 locationMode。
-
您能否重新编辑您的问题并包括您如何创建
tableSvc? -
我没有重新创建它,表已经创建并存在。@GauravMantri
标签: node.js azure azure-storage azure-table-storage