Skip to content

Instantly share code, notes, and snippets.

@ochilab
Last active January 22, 2019 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ochilab/7527672614047482b7e3c0ce5abd6464 to your computer and use it in GitHub Desktop.
Save ochilab/7527672614047482b7e3c0ce5abd6464 to your computer and use it in GitHub Desktop.
Azure Table Storageへの接続
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using Microsoft.Azure;
static void Main(string[] args){
CloudTable table;
// Web.configに指定した接続情報を取得
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
CloudConfigurationManager.GetSetting("StorageConnectionString"));
// テーブルクライアントの作成
CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
// テーブルへの参照を取得し、存在しない場合には作成する
table = tableClient.GetTableReference("SampleTable");
table.CreateIfNotExists();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment