0
votes

Problem: Azure Storage Emulator could start Blob and Table storage, but Queue Storage would fail to start, showing an error dialog: "File is in use by another Process" found resolution to that issue, but now I'm having issues with my development environment storage client. Here's what I've done...

port 10001 is the default port for the Queue Storage, so based on some related articles I did (the last column in output is the PID of the process):

    c:\...> netstat -p tcp -ano | findstr :1000
  TCP    0.0.0.0:10001          0.0.0.0:0              LISTENING       2628
  TCP    127.0.0.1:10000        0.0.0.0:0              LISTENING       4
  TCP    127.0.0.1:10002        0.0.0.0:0              LISTENING       4

the big problem here is that what is listening on 10001 is McAfee and i cannot change that.

the next step is to reconfigure the Queue storage to not use 10001: reconfigure the storage emulator to listen on an available port. Open:

%PROGRAMFILES%\Microsoft SDKs\Windows Azure\Emulator\devstore\DSServiceLDB.exe.config

in your favorite text editor and change the binding for the queue storage... in my case, 10003 was available:

<?xml version="1.0"?>
<configuration>
  <configSections>    
    <section name="developmentStorageConfig" type="Microsoft.ServiceHosting.DevelopmentStorage.Utilities.DevelopmentStorageConfigurationHandler, DevelopmentStorage.Common"/>
  </configSections>

  <developmentStorageConfig>
    <services>
      <service name="Blob" url="http://127.0.0.1:10000/"/>
      <service name="Queue" url="http://127.0.0.1:10003/"/> <!-- this line here -->
      <service name="Table" url="http://127.0.0.1:10002/"/>
    </services>
...

shutodwn and start the storage emulator and all should be good:

c:\...netstat -p tcp -ano | findstr :1000
  TCP    0.0.0.0:10001          0.0.0.0:0              LISTENING       2628
  TCP    127.0.0.1:10000        0.0.0.0:0              LISTENING       4
  TCP    127.0.0.1:10002        0.0.0.0:0              LISTENING       4
  TCP    127.0.0.1:10003        0.0.0.0:0              LISTENING       4

now, trying to configure my client in VS2012 isn't working... I have modified my configuration File: ServiceConfiguration.Cloud.cscfg with the following setting:

<Setting name="StorageConnectionString" value="BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;QueueEndpoint=http://127.0.0.1:10003/devstoreaccount1;TableEndpoint=http://127.0.0.1:10002/devstoreaccount;AccountName=devstoreaccount;AccountKey=key copied from storage config file" />

but i get a 404 when i try to connect to the queue and call create if not exist:

    storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));
    queueClient = storageAccount.CreateCloudQueueClient();
    queue = queueClient.GetQueueReference("testqueue");
    queue.CreateIfNotExist();

so after some time of tweaking on this... I looked at what the storage client was doing if you were using the development settings and I replicated the code with a System.Diagnostics.Debugger.IsAttached block. I also noticed my naming of the queue was bad (once i got the client to connect, it was giving back a 400 error):

if (System.Diagnostics.Debugger.IsAttached)
        {
            var blobEndpoint = new Uri("http://127.0.0.1:10000/devstoreaccount1");
            var queueEndpoint = new Uri("http://127.0.0.1:10003/devstoreaccount1");
            var tableEndpoint = new Uri("http://127.0.0.01:10002/devstoreaccount1");
            var storageCreds = new StorageCredentialsAccountAndKey("devstoreaccount1", "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==");

            _storageAccount = new CloudStorageAccount(storageCreds, blobEndpoint, queueEndpoint, tableEndpoint);
        }
        else
        {
            _storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));
        }
        _queueClient = _storageAccount.CreateCloudQueueClient();
        /* Queue naming rules:
         *  1. A queue name must start with a letter or number, and can only contain letters, numbers, and the dash (-) character. 
            2. The first and last letters in the queue name must be alphanumeric. The dash (-) character cannot be the first or last character. Consecutive dash characters are not permitted in the queue name.
            3. All letters in a queue name must be lowercase.
            4. A queue name must be from 3 through 63 characters long.
         */
        _queue = _queueClient.GetQueueReference("myqueuename");
        _queue.CreateIfNotExist();  
1
What version of the SDK are you running? Are you using the new 1.8 version with the new storage client library 2.0? With the new sdk you can directly manipulate the queue storage using vs2012 tools.Bart Czernicki
this is on the 1.7 assemblies. I just got the 1.8 sdk today but the project was created before that and I didn't change the assembly references. I'm not on the 2.0 yet. I've read up on all 3 SDKs now, but as this is for production, I am forced to use stable releases.Scottley

1 Answers

1
votes

Look in this directory (C:\Program Files\Microsoft SDKs\Windows Azure\Emulator\devstore) and change the port configuration in the DSServiceLDB.exe.config:

<services>
<service name="Blob" url="http://127.0.0.1:10000/"/>
<service name="Queue" url="http://127.0.0.1:10003/"/>
<service name="Table" url="http://127.0.0.1:10002/"/>
</services>

I had the same issue with 10001.