Last active
January 22, 2019 10:31
-
-
Save ochilab/7527672614047482b7e3c0ce5abd6464 to your computer and use it in GitHub Desktop.
Azure Table Storageへの接続
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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