简体   繁体   中英

I can't access a queue from local Azure Storage Emulator nor from VisualStudio, nor from Azure Storage Explorer

I need to send messages through an Azure Queue and I need to test it using the Windows Azure Emulator, which says to be correctly running. These are the steps I went through:

1- Running the Windows Azure Storage Emulator (I tried both 2.0.0 and 3.2.0 versions) Making sure the emulator is running:

  • When using Windows Azure Storage Emulator 2.0.0:

    The now 'deprecated' UI showed all three Storage Emulator correctly running. (I can't attach a snapshot showing it because I've already upgraded the Windows Azure Storage SDK tools for VisualStudio 2013.

  • When using Windows Azure Storage Emulator 3.2.0:

    [Here was a snapshot showing it is correctly running but I have no reputation to add imgaes :s]

2- Code:

        string azureStorageConnectionString = "UseDevelopmentStorage=true";
        string queueName = "queuetest";

        CloudStorageAccount storageAccount = CloudStorageAccount.Parse(storageConnectionString);
        CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();
        _queue = queueClient.GetQueueReference(queueName);
        _queue.CreateIfNotExists();

3- I Got two different problems with each one of the WAS Emulator versions.

-Problem A: On the line _queue.CreateIfNotExists(); got a uri not found exception (404) because it couldn't find the queue, with the uri: 127.0.0.1:10001/devstoreaccount1/queuetest

-Problem B: When I upgraded the WAS Emulator the exception was gone (So upgrading was solution to problem A ) but the Azure Storage Explorer wouldn't access the Developer Storage Account and gave the following message:

Windows Azure Developer Storage is not runnign.
The process DSService.exe is not detected

So, in summary, I fixed problem A but now I can't access DevStorage Account by using Azure Storage Explorer.

A mate gave me an astonishing solution. You need to create a VisualStudio project called DSService, place it anywhere in C: and containing the following code:

namespace DSService
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
        }
    }
}

Now I can create, insert messages and access the DevStorage account queue using Azure Storage Explorer... :-0

Update:

As Gaurav Mantri said, you should use VisualStudio 2013 tools to see the content of your DevStorage account.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM