世界のやまさ

SEKAI NO YAMASA

Windows Azure コマンドラインツールを Mac にインストールする

ポータルからいちいちやるのめんどくさくなったので、インストールしました。Windows Azure Command-Line Tools for Mac and Linux (Linux) ではパッケージをインストールしろと書いてありますが、めんどくさかったので Homebrew と node.js でインストールしました。

Homebrew が入っていれば5ステップでインストールから動作確認まで出来ます。

Homebrew で node.js をインストールする

簡単です。Homebrewが入っていれば以下コマンドを実行するだけです。

$ brew install node

インストール後に以下メッセージが出るので、$Path に /usr/local/share/npm/bin を追加しておきます。

Homebrew installed npm.
We recommend prepending the following path to your PATH environment
variable to have npm-installed binaries picked up:
  /usr/local/share/npm/bin

npm で Windows Azure Command-Line Tools をインストールする

これも簡単です。以下コマンドを実行するだけです。

$ npm install azure-cli -g

アカウントの設定ファイルをダウンロードする

以下コマンドを実行するとブラウザが立ち上がりダウンロードが始まります。

$ azure account download
info:    Executing command account download
info:    Launching browser to http://go.microsoft.com/fwlink/?LinkId=254432
help:    Save the downloaded file, then execute the command
help:      account import <file>
info:    account download command OK

こんな画面です。

f:id:nnasaki:20130502003629p:plain

アカウントの設定をインポートする

先ほどダウンロードしたものをインポートします。

$ azure account import ~/Downloads/credentials.publishsettings
info:    Executing command account import
info:    Found subscription: 
info:    Setting default subscription to: 
info:    Use "azure account set" to change to a different one.
info:    Setting service endpoint to: https://management.core.windows.net/
warn:    The 'credentials.publishsettings' file contains sensitive information.
warn:    Remember to delete it now that it has been imported.
info:    Account publish settings imported successfully
+ Verifying account
info:    account import command OK

重要なファイルだから消すようにと言われてたので消します。

$  rm ~/credentials.publishsettings

動作確認をする

Windows Azure Mobile Services のロケーションを確認してみます。

$ azure mobile locations
info:    Executing command mobile locations
info:    East US (default)
info:    West US
info:    North Europe
info:    East Asia

無事取得できているようです。以上でインストール完了です。