はじめに
今回は、
また、
Windows Azureにサインイン
Window Azureのサイトから、
今回は
Windows Azureストレージアカウントを作る
Windows Azureポータルにサインインして、

図1が表示されるので、
Webサイトを作る
ポータルトップの左側の [WEBサイト] をクリックします。さらに下部表示されるバーの [+新規] をクリックします。バーの内容が切り替わるので、

URLのプリフィックスに任意の値を入力して [WEBサイトの作成]をクリックします
画面のリストが更新されて、

さらにこのGitリポジトリへのアクセスするためのアカウントにパスワードセットします。上部の [ダッシュボード] をクリックして戻り、
「新しいユーザー名とパスワード」
AZURE_ | <ストレージアカウント名> |
---|---|
AZURE_ | <プライマリアクセスキー> |
上部の [構成] をクリックして、
これにより環境変数を通して、
Cloud9 IDEで開発する
Cloud9 IDEにサインアップして、
Azure WEBサイトをターゲットに追加
続いて、
下部のコマンドラインから、
Azureストレージに接続するように実装
MongoDBからAzureストレージを使うように書き換えてみましょう。app1/
var uuid = require('node-uuid');
var azure = require('azure');
const TABLE_NAME = "table1";
const PARTITION = "partition1";
exports.index = function(req, res){
var tableService = azure.createTableService();
tableService.createTableIfNotExists(TABLE_NAME, function(err){
if (err) {
console.log(err);
res.render('index', { title: 'Entry List', items: [] });
return;
}
var query = azure.TableQuery.select().from(TABLE_NAME);
tableService.queryEntities(query, function(err, entities){
var items;
if (err) {
console.log(err);
items = [];
} else {
items = entities;
}
res.render('index', { title: 'Entry List', items: items });
});
});
};
exports.form = function(req, res){
res.render('form', { title: 'New Entry' })
};
exports.create = function(req, res){
var tableService = azure.createTableService();
tableService.createTableIfNotExists(TABLE_NAME, function(err){
if (err) {
console.log(err);
res.redirect('back');
return;
}
var newPost = {
PartitionKey : PARTITION,
RowKey: uuid(),
text: req.body.text,
created: new Date()
};
tableService.insertEntity(TABLE_NAME, newPost, function(err){
if (err){
console.log(err);
res.redirect('back');
return;
}
res.redirect('/');
});
});
};
それでは順に説明します。最初のrequireは追加した二つのモジュールのインポート宣言です。さらにAzureストレージのテーブルにおける、
次にexports.
続いてexports.
上記のどちらも、
Azure Webサイトへのデプロイ
下部のコマンドラインから

さらに

AzureポータルのWEBサイトの一覧でURLをクリックすると、
最後に
Cloud9 IDEとWindows Azureという開発および実行環境がクラウド上だけに閉じた状態で、
長らく続きました本連載も、