An exception for Azure only when deploying on a server, not on a local host

I am trying to connect to the azure table repository and add an object. it works fine on localhost, however on the server I use, I get the following exception + its internal exception:

Exception of type 'Microsoft.WindowsAzure.StorageClient.StorageClientException' was thrown. System.Data.Services.Client.DataServiceQueryException: An error occurred while processing this request. ---> System.Data.Services.Client.DataServiceClientException: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> <code>AuthenticationFailed</code> <message xml:lang="en-US">Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:17..127 Time:2011-12-16T15:47:50.7505473Z</message> </error> at System.Data.Services.Client.BaseAsyncResult.EndExecute[T](Object source, String method, IAsyncResult asyncResult) at System.Data.Services.Client.QueryResult.EndExecute[TElement](Object source, IAsyncResult asyncResult) --- End of inner exception stack trace --- at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result() at Microsoft.WindowsAzure.StorageClient.CloudTableClient.GetResultOrDefault[T](Task`1 task, T& result) 

my connection string:

 DefaultEndpointsProtocol=http;AccountName=nameoftable;AccountKey=accountkey... 
+4
source share
2 answers

This is a bit long shot, but check the clock on the server hosting your site. The authentication header part for all Azure storage REST calls is the current UTC. If this is too far from what Azure servers say, this is UTC time, you will get this error.

+15
source

You must change the data connection string in the role settings. I am pretty sure that either you are mistaken for the storage account key, or you left the default connection string "UseDevelopmentStorage = true"

There are no firewall rules that apply to Azure storage, only an access account. You must create a repository if you have not already done so. I suggest you create a repository in the same data center as your hosted service to avoid tolls. Then simply use this account and the key specified on the portal.

enter image description here

A typical azure storage account connection string would look something like this:

DefaultEndpointsProtocol = HTTPS; account_name = YOUR_ACCOUNT_NAME; AccountKey = YOUR_ACCOUNT_KEY_BE_IT_PRIMARY_OR_SECONDARY ==

0
source

Source: https://habr.com/ru/post/1386730/


All Articles