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.TableQuery
1.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__3a
1.MoveNext() +400
System.Collections.Generic.List1..ctor(IEnumerable
1 collection) +402
System.Linq.Enumerable.ToList(IEnumerable`1 source) +54
ConnectionString
looks like? Please replace account name/key with some dummy values. Also check if you are not trying to connect with development storage account in your web application. – Gaurav Mantri