Azure 插入在数据库中失败,但查询有效

标签 azure azure-compute-emulator azure-storage-emulator

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

          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 } }

最佳答案

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

关于Azure 插入在数据库中失败,但查询有效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13351508/

相关文章:

azure - 如何更改 kubernetes api 服务器标志 [AKS] [Kubernetes 1.8]

entity-framework - 应用程序配置文件中的连接字符串不包含所需的providerName属性

c# - Azure 计算模拟器上的 Web API 失败

azure - 使用 postman 对 Azure 存储模拟器进行授权?

azure - 无法连接到本地 Azure 存储帐户

azure-storage - 尝试使用 Windows Azure 存储模拟器时收到 404 响应

sql - Azure数据工厂说临时表是 "Invalid object name"?

facebook - Azure 逻辑应用程序 Facebook 连接器给出空响应

azure - 有没有办法为 DevFabric 使用不同的 SSL 证书?

azure - 禁用 WindowsAzure.ServiceRuntime 详细输出