I'm following this tutorial which is about Table Storage Service
. I'm using the emulator version of the tutorial which you can find at point 5 of paragraph "Configuring your connection string when using Cloud Services".
This is the code I pasted in the 'About' ActionResult
:
public ActionResult About()
{
// Retrieve the storage account from the connection string.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
CloudConfigurationManager.GetSetting("StorageConnectionString"));
// Create the table client.
CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
// Create the CloudTable object that represents the "people" table.
CloudTable table = tableClient.GetTableReference("people");
// Create a new customer entity.
CustomerEntity customer1 = new CustomerEntity("Harp", "Walter");
customer1.Email = "[email protected]";
customer1.PhoneNumber = "425-555-0101";
// Create the TableOperation that inserts the customer entity.
TableOperation insertOperation = TableOperation.Insert(customer1);
// Execute the insert operation.
table.Execute(insertOperation);
return View();
}
At this line table.Execute(insertOperation);
I get the following error message:
StorageException was unhandled by user code The remote server returned an error: (404) Not Found.
The project template I used was "Windows Azure Cloud Service". The next window that popped up, I only added "ASP.NET MVC 4 Web Role".
Anyone any idea what is causing this error?
Does the people table exists in Storage area? (you can check from Azure management portal)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With