3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Microsoft AzureのMobile Servicesを使う - Part1: Dockerにxplat-cliをインストール

Posted at

新しくSaltクラスタをAzureに構築してみようと思います。LinuxからAzureのコマンドラインを使うため、xplat-cli(Microsoft Azure Cross Platform Command Line)をインストールして使います。

xplat-cli用のコンテナ

xplat-cliはNode.jsで書かれたツールなので、Node.js用コンテナをdockerfile/nodejsから作成します。

$ docker pull
$ docker run -it --name nodedev dockerfile/nodejs

azure-cliをインストールします。

$ npm install -g azure-cli

バージョンを確認します。

$ azure -v
0.8.13

アカウント設定

アカウント設定ファイルをダウンロードするURLが表示されるので、Webブラウザで開き、Microsoft Azureにログインします。xxx-credentials.publishsettingsの名前の、アカウント設定ファイルをダウンロードします。

$ 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

ダウンロードしたアカウント設定ファイルをインポートします。

$ chmod 400 .publishsettings
$ azure account import .publishsettings
info:    Executing command account import
info:    account import command OK

アカウント情報

アカウント情報をコマンドから確認します。

$ azure account list
info:    Executing command account list
data:    Name  Id                                    Current
data:    ----  ------------------------------------  -------
data:    従量課金  xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  true
info:    account list command OK

azure-cliの動作確認

CLIの動作確認のため、Microsoft Azureのロケーションをリストしてみます。

$ azure vm location list
info:    Executing command vm location list
+ Getting locations
data:    Name
data:    ----------------
data:    West Europe
data:    North Europe
data:    East US 2
data:    Central US
data:    South Central US
data:    West US
data:    North Central US
data:    East US
data:    Southeast Asia
data:    East Asia
data:    Japan West
data:    Japan East
data:    Brazil South
info:    vm location list command OK
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?