2

我正在尝试进行插入/替换:

          insertOrReplaceEntity('myusertables', task, function(error)

它总是进入错误代码,表明没有发生插入。

如何在 Azure 中进行调试?

我正在使用 Azure 模拟器并在代码中有:

var account = azure.ServiceClient.DEVSTORE_STORAGE_ACCOUNT;
var accountKey = azure.ServiceClient.DEVSTORE_STORAGE_ACCESS_KEY;

我得到 PUT 失败,出现 403。

{ error:
   { [Error: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctl
including the signature.]
     code: 'AuthenticationFailed',
     message: 'Server failed to authenticate the request. Make sure the value of Authorization header is formed correc
y including the signature.' },
  response:
   { isSuccessful: false,
     statusCode: 403,
     body:
      { '@': [Object],
        code: 'AuthenticationFailed',
        message: [Object] },
     headers:
      { 'content-length': '356',
        'content-type': 'application/xml',
        server: 'Microsoft-HTTPAPI/2.0',
        date: 'Mon, 12 Nov 2012 20:57:10 GMT' },
     md5: undefined } }
4

1 回答 1

1

如此所述,存储模拟器不支持插入或替换实体或插入或合并实体,称为 upsert 功能。这就是为什么当您在代码中使用 insertOrReplaceEntity 时它会返回错误。如果你必须验证代码,你可能需要用真正的 Azure 表存储来检查它。

于 2012-11-14T05:51:07.833 回答