Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while accessing the windows azure account table

I am trying to connect to azure account storage from web application and i am getting the below error: " An exception of type -'Microsoft.WindowsAzure.Storage.StorageException' occurred in Microsoft.WindowsAzure.Storage.dll but was not handled in user code

Additional information: The remote name could not be resolved: 'xxx.table.core.windows.net' "

I given only xxx in my config as accountname.

The same code i am able to access from console application.

i am using the below code to fetch the records from azure storage account.

string connStr = ConfigurationManager.ConnectionStrings["ConnString"].ConnectionString;

CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connStr);

CloudTableClient client = storageAccount.CreateCloudTableClient();

CloudTable table = client.GetTableReference("ErrorLogs");

TableQuery<ErrorLogs> query = new TableQuery<ErrorLogs>().Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, "ERROR"));

I have given web.config only the server name like xxxx but when tit tries to connect it's saying xxx.table.core.windows.net.

Below is the full exception details:

[WebException: The remote name could not be resolved: 'xxx.table.core.windows.net'] System.Net.HttpWebRequest.GetResponse() +1732 System.Net.HttpWebRequest.GetResponse() +600 Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync(RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext) +2463

[StorageException: The remote name could not be resolved: 'xxx.table.core.windows.net'] Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync(RESTCommand1 cmd, IRetryPolicy policy, OperationContext operationContext) +7418 Microsoft.WindowsAzure.Storage.Table.TableQuery1.ExecuteQuerySegmentedInternal(TableContinuationToken token, CloudTableClient client, CloudTable table, TableRequestOptions requestOptions, OperationContext operationContext) +436 Microsoft.WindowsAzure.Storage.Table.<>c__DisplayClass7.b__6(IContinuationToken continuationToken) +141 Microsoft.WindowsAzure.Storage.Core.Util.d__01.MoveNext() +123 System.Linq.<TakeIterator>d__3a1.MoveNext() +400 System.Collections.Generic.List1..ctor(IEnumerable1 collection) +402 System.Linq.Enumerable.ToList(IEnumerable`1 source) +54

like image 655
user970503 Avatar asked Apr 23 '26 23:04

user970503


1 Answers

I was stumped by the same error message until I came across this answer to an Azure Storage queues question:

https://stackoverflow.com/a/37604755/3507333

Turns out that Zone-Redundant Storage (ZRS) accounts DO NOT SUPPORT TABLES.

I created a new Locally-Redundant Storage (LRS) account and everything worked great!

like image 51
madannes Avatar answered Apr 27 '26 01:04

madannes