Azure模拟器端口冲突,应用程序尝试连接到错误的端口

时间:2014-06-23 11:56:59

标签: azure emulation azure-storage

启动Azure存储模拟器时,由于与某些dell驱动程序/软件的端口冲突,它会失败。

我通过更改StorageEmulatorConfig内的WAStorageEmulator.exe.config部分中的网址解决了这个问题。

<StorageEmulatorConfig>
    <services>
      <service name="Blob" url="http://127.0.0.1:10100/"/>
      <service name="Queue" url="http://127.0.0.1:10101/"/>
      <service name="Table" url="http://127.0.0.1:10102/"/>
    </services>

    <accounts.../>
  </StorageEmulatorConfig>

所以现在模拟器运行没有问题。

我的网络应用程序仍尝试连接到旧端口,但是......

我使用的连接字符串是短字符串:

<add name="AzureStorage" connectionString="UseDevelopmentStorage=true;"/>

我也试过了正常形式:

<add name="AzureStorage" 
     connectionString="DefaultEndpointsProtocol=https;
                       AccountName=devstoreaccount1;
                       AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;"/>

我的应用如何发现它应该使用哪些端点? 如何告诉它使用另一个端口?

1 个答案:

答案 0 :(得分:3)

您可以尝试在连接字符串中指定端点:

DefaultEndpointsProtocol=http;
AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;
BlobEndpoint=http://127.0.0.1:10100/devstoreaccount1;
QueueEndpoint=http://127.0.0.1:10101/devstoreaccount1;
TableEndpoint=http://127.0.0.1:10102/devstoreaccount1;