Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js azure表存储用于本地连接的连接字符串_Node.js_Azure_Azure Storage_Azure Table Storage - Fatal编程技术网

Node.js azure表存储用于本地连接的连接字符串

Node.js azure表存储用于本地连接的连接字符串,node.js,azure,azure-storage,azure-table-storage,Node.js,Azure,Azure Storage,Azure Table Storage,我对azure table storage+node.js的结合进行云开发还是新手。在所有示例中,我发现azure存储的连接字符串仅适用于那些拥有真实windows azure帐户的用户。当我在本地PC上开发时,需要配置本地azure存储帐户 我尝试将连接字符串设置为: <add key="AZURE_STORAGE_ACCOUNT" value="DevStorage"/> <add key="AZURE_STORAGE_ACCESS_KEY" value="Eby8vd

我对azure table storage+node.js的结合进行云开发还是新手。在所有示例中,我发现azure存储的连接字符串仅适用于那些拥有真实windows azure帐户的用户。当我在本地PC上开发时,需要配置本地azure存储帐户

我尝试将连接字符串设置为:

<add key="AZURE_STORAGE_ACCOUNT" value="DevStorage"/>
  <add key="AZURE_STORAGE_ACCESS_KEY" value="Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="/>

可以通过azure storage emulator(非代码)连接azure存储


有人能帮我找到解决方案吗???

请尝试下面的连接信息,看看是否有帮助

帐户名=devstoreaccount1


帐户密钥=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==

创建node.js表服务客户端,如下所示:

var azure = require('azure');
var tableClient = azure.createTableService(ServiceClient.DEVSTORE_STORAGE_ACCOUNT, ServiceClient.DEVSTORE_STORAGE_ACCESS_KEY, ServiceClient.DEVSTORE_TABLE_HOST);

通过使用DEVSTORE_STORAGE_帐户、DEVSTORE_STORAGE_访问_密钥和DEVSTORE_BLOB_主机,您可以使用node.js Azure SDK中的BLOB STORAGE emulator设置。这就从等式中消除了node.js配置问题。

在我的例子中,我使用Passport在外部虚拟机上运行storage emulator,将端口20000、20001、20002处的外部请求重定向到此虚拟机内的本地主机端口10000、10001、10002

var connectionString = 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://192.168.56.56:20000/devstoreaccount1;TableEndpoint=http://192.168.56.56:20002/devstoreaccount1;QueueEndpoint=http://192.168.56.56:20001/devstoreaccount1;';

var azure = require('azure-storage');
var tableSvc = azure.createTableService(connectionString);

var query = new azure.TableQuery()
  .top(5)
  .where('PartitionKey eq ?', 'CONDITION');

tableSvc.queryEntities('TABLENAME',query, null, function(error, result, response) {
    if(!error) {
      // query was successful
      console.log(result.entries);
    }
  });

徐你好,,感谢您的响应。收到错误的原因是:iisnode在处理请求时遇到错误。HRESULT:0x2 HTTP状态:500 HTTP原因:内部服务器错误您正在接收此HTTP200响应,因为system.webServer/iisnode/@deverrorEnabled配置设置为“true”。此外还有node.exe的stdout和stderr日志过程中,考虑使用调试和ETW跟踪来进一步诊断问题。NoDE.EXE进程生成的输出到STDUT和STDRR的最后64K如下:C:\No.taskList\WebLe1\Server。JS:20投掷错误;^对不起,我不熟悉nodeJS,可能无法帮助您:(嗨,Jmac,谢谢你的回复。我使用的是azure table storage而不是blob one。我需要知道在本地PC(本地azure emulator)上运行的DEVSTORE_storage_帐户、DEVSTORE_storage_ACCESS_密钥和DEVSTORE_table_主机的值)不是在真正的云中。我使用了键值,但它对我不起作用。显示了一些连接错误。我希望你能在这个问题上帮我一些忙。我编辑了我的代码片段以使用table storage client。你可以在这里看到一个Azure SDK示例:正如我前面所说的,使用DEVSTORE_*常量将允许你绕过任何配置使用存储仿真程序时会出现问题。一旦您的代码在本地运行,您就可以修改AZURE_storage_帐户和AZURE_storage_ACCESS_密钥配置设置,以指向live AZURE storage帐户。这对任何人来说都很有帮助