2016-07-31 64 views
0

我正在嘗試將一些數據記錄到Azure表存儲服務,直到現在它工作正常。我正在使用Java記錄到Azure表存儲。 突然從昨天我得到的錯誤如下:Azure表存儲服務異常

服務器無法驗證請求。確保授權標頭的值正確形成,包括簽名。 com.microsoft.azure.storage.table.TableServiceException

我閱讀了一些關於google https://github.com/Azure/azure-storage-net/issues/171的文章,它討論了斑點。我找不到與桌面存儲相關的任何內容。

有人可以幫我這個嗎?訪問表的代碼通常如下。

private CloudTable GetCloudTableContainer(String tableName) { 
    CloudTable table = null; 
    try { 
     // Retrieve storage account from connection string. 
     CloudStorageAccount storageAccount = CloudStorageAccount.parse(config.CONNECTION_STRING); 

     // Create the blob client. 
     CloudTableClient tableClient = storageAccount.createCloudTableClient(); 
     // Retrieve a reference to a container. 
     table = tableClient.getTableReference(tableName); 
     table.createIfNotExists(); 

    } catch (Exception ex) { 
     ex.printStackTrace(); 
    } 

    return table; 
} 
+0

假設您在連接字符串中使用存儲帳戶名稱和密鑰,請檢查2件事情:1)您的存儲帳戶密鑰沒有更改2)計算機上的時鐘相當準確,沒有後臺運行。根據我的經驗,這兩個是這個錯誤的主要原因。 –

+0

@GauravMantri當你說計算機上的時鐘,意思是服務器機器的時鐘嗎? – user1955255

+0

這是正確的。運行此代碼的機器上的時間。 –

回答

0

您是否使用共享訪問簽名(SAS)?它可能已經過期了?

+0

不,我不使用SAS – user1955255