2

I am new to cloud development with the combination of azure table storage + node.js. In all samples I found the connection string for azure storage is only those who have account with real windows azure. As I am developing in my local PC need to the configuration of local azure storage account.

I tried with connection string as:

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

It is possible connect azure storage via azure storage emulator not in code.

Can anyone get me the solution please??

4

3 回答 3

1

像这样创建你的 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_ACCOUNT、DEVSTORE_STORAGE_ACCESS_KEY 和 DEVSTORE_BLOB_HOST,您可以使用在 node.js Azure SDK中硬编码的 blob 存储模拟器设置。这消除了等式中的 node.js 配置问题。

于 2012-04-09T18:39:18.440 回答
0

试试下面的连接信息,看看它是否有帮助。

帐户名称 = devstoreaccount1

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

于 2012-04-09T04:50:15.167 回答
0

就我而言,我在外部虚拟机上运行了存储模拟器,使用 Passport 将端口 20000、20001、20002 的外部请求重定向到该虚拟机内的 localhost 端口 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);
    }
  });
于 2019-05-13T03:46:35.080 回答