I am experiencing error 500 from the web-api MVC website deployed to Azure. WebApi controllers access Azure Table Storage and it works locally (local website works with my Azure Table).
Troubleshooting the problem I used "Linked Resources" page to link the website to the Storage but noticed the following: "The Customer Preview Release of the Windows Azure Management Portal does not support linking a storage account to a web site or a cloud service" Despite this message it shows status as "Linked".
Is it possible on this stage of Azure to access Table from the Web Sites?
Note: It is VS2010 and .net4
Code as requested:
public static TableServiceContext GetContext()
{
CloudStorageAccount storageAccount = CloudStorageAccount.Parse("DefaultEndpointsProtocol=https;AccountName=AccountName;AccountKey=@cc0untKey==");
CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
var context = tableClient.GetDataServiceContext();
сontext.IgnoreResourceNotFoundException = true;
return context;
}
public IEnumerable<Destination> GetAllDestinations()
{
try
{
return TableProvider.GetContext()
.CreateQuery<Destination>(Model.Consts.DestinationTableName);
}
catch (Exception e)
{
return new Destination[1]
{
new Destination()
{
CountryName = e.Message
}
};
}
}