سؤال

I cannot create a table, named "people" on my local machine. I have started the Azure emulator by starting the "Windows Azure Storage Emulator - v2.2". I have pulled the latest Azure client library from NuGet, which is version 3.0.3.0. The .NET version is 4.5 and my VS is 2012 Ultimate. I run this code from Windows 8.1, on a x64 system.

This is my test code:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;

namespace AzureTablesTest
{
    class Program
    {
        static void Main(string[] args)
        {
            // Retrieve the storage account from the connection string.
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse("UseDevelopmentStorage=true");

            // Create the table client.
            CloudTableClient tableClient = storageAccount.CreateCloudTableClient();

            // Create the table if it doesn't exist.
            CloudTable table = tableClient.GetTableReference("people");
            table.CreateIfNotExists();
        }
    }
}

I have made sure that the emulator is running by checking the emualtor GUI:

Azure Emulator GUI

When I run the test code from VS it throws this exception:

Azure Storage Exception with code line reference

The strange thing is that when I open Azure Storage Explorer, create a development account, I can create tables and entities. When I reset the tables from the Emulator GUI I can see that the storage Explorer is emptied as well (after a refresh). I have tried to create a table through the Explorer and see if I got any errors when creating the table with my simple console program above, and I get the same error. So I cannot read or write with the console program, but I can with the Explorer.

Does someone know why I cannot create tables through my simple console program, but why I can through Azure Storage Explorer? I have even tried to run the console program listed above outside VS as an administrator, which gave me the exact same error as shown above.

UPDATE Installing Storage Emulator 2.2.1 Preview, as this link describes Azure 400 Bad Request on every request, resolved my issue.

هل كانت مفيدة؟

المحلول

Installing Storage Emulator 2.2.1 Preview, as this link describes Azure 400 Bad Request on every request, resolved my issue.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top