我有一個我用v1.7構建的工作者角色。在我的開發機器上,以及我的計算模擬器,應用程序工作正常。但是,當我部署到Azure時,表存儲操作會自動失敗。代碼如下 - 在BackupResult
類繼承自TableServiceEntity
:爲什麼Azure表存儲操作會默默失敗?
Trace.WriteLine("Entering cloud storage method");
CloudTableClient client = storageAccount.CreateCloudTableClient();
Trace.WriteLine("Got the client..."); // Last message received.
client.CreateTableIfNotExist("LastRun");
Trace.WriteLine("Created the table (maybe)...");
TableServiceContext context = client.GetDataServiceContext();
Trace.WriteLine("Got the context...");
BackupResult lastResult = context.CreateQuery<BackupResult>("LastRun").ToList().OrderByDescending(x => x.RunTime).FirstOrDefault();
Trace.WriteLine("Returning the last result. It ran at: " + lastResult.ToString());
return lastResult;
沒有異常都扔了,但我沒有看到任何標記信息的下方跟蹤日誌的,和我的應用程序的邏輯不進行外這種方法。我的本地配置與我的雲配置完全相同。什麼會導致這種行爲?
你是什麼意思「操作失敗默默」?它不會在「lastResult」變量中返回正確的結果嗎?在跟蹤日誌中看到什麼? –
@GauravMantri:在代碼塊之後爲觀察添加更多細節。這有幫助嗎? – TSL