Windows Azure の開発は初めてで、Windows Azure ストレージ テーブルにデータを格納する必要があります。
このテーブルは、実際には、Azure ストレージ ドライブにある一部のファイルをすばやく検索するメカニズムを提供するためにのみ存在します。
したがって、アプリケーションの起動時にこのテーブルにデータを入力することを計画していました (つまり、Web アプリケーションのグローバル アプリケーションの起動時)。
変更のためにこのテーブルを維持しようとするのではなく、アプリケーションが実行されていない間にドライブに発生する可能性のある変更。または、このドライブは単なるリソースの vhd であるため、場合によっては新しい vhd をアップロードすることもできます。
これを維持しようとする手間ではなく。アプリケーションが起動するたびにこのテーブルを再構築するだけで十分です。
テーブルが既に存在するかどうかを確認し、存在する場合は削除してから、新しいテーブルを再作成するコードをまとめ始めました。
var storageAccount = CloudStorageAccount.Parse(ConfigurationManager.ConnectionStrings["AzureStorage"].ConnectionString);
var tableClient = storageAccount.CreateCloudTableClient();
var rmsTable = tableClient.GetTableReference("ResourceManagerStorage");
rmsTable.DeleteIfExists();
rmsTable.Create();
これはうまくいかないだろうと思っていました。そして、次のエラーが表示されます。
The remote server returned an error: (409) Conflict.
HTTP/1.1 409 Conflict
Cache-Control: no-cache
Transfer-Encoding: chunked
Server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0
x-ms-request-id: c6baf92e-de47-4a6d-82b3-4faec637a98c
x-ms-version: 2012-02-12
Date: Tue, 19 Mar 2013 17:26:25 GMT
166
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code>TableBeingDeleted</code>
<message xml:lang="en-US">The specified table is being deleted. Try operation later.
RequestId:c6baf92e-de47-4a6d-82b3-4faec637a98c
Time:2013-03-19T17:26:26.2612698Z</message>
</error>
0
これを行う正しい方法は何ですか?テーブルがいつ削除されたかを知らせるためにサブスクライブできるイベントはありますか? これを実装するための最良の方法に関する他の提案はありますか?