Azure Web App で、Azure CLI を実行

Azure

もう今回は誰得なネタでもありません。

自分的になんとなく楽しかったのでって位の、非常にニッチなネタです。

Azure CLI を、Web App のkuduより実行してみたいと思います。


 

まず、kudu へのアクセス方法は、下記のURLとなります。

https://[Web App名].scm.azurewebsites.net

kuduの詳しいことは、ネットで検索して調べてください。今回は、kuduのDebug Consoleを使います。

Web Appを簡易作成した直後に、Debug Cinsole(CMD)を起動して、Azureを実行すると、下記のようになります。

D:home>azure
'azure' is not recognized as an internal or external command, operable program or batch file.

ここで、npmのバージョンを確認してみます。

D:home>npm -v
1.4.28

npmが入っているってことは、Azure CLIをインストールできちゃいますね。

D:home>npm install azure-cli -g
npm WARN deprecated jws@1.0.1: Security update: Versions below 3.0.0 are deprecated.
npm WARN engine galaxy@0.1.12: wanted: {"node":">=0.11.10"} (current: {"node":"0.10.32","npm":"1.4.28"})

> fibers@1.0.5 install D:localAppDatanpmnode_modulesazure-clinode_modulesstreamlinenode_modulesfibers
> node ./build.js

`win32-ia32-v8-3.14` exists; testing
Problem with the binary; manual build incoming

D:localAppDatanpmnode_modulesazure-clinode_modulesstreamlinenode_modulesfibers>node "c:Program Files (x86)npm1.4.28node_modulesnpmbinnode-gyp-bin\....node_modulesnode-gypbinnode-gyp.js" rebuild --release
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. [D:localAppDatanpmnode_modulesazure
clinode_modulesstreamlinenode_modulesfibersbuildbinding.sln]
gypBuild failed
npm WARN optional dep failed, continuing fibers@1.0.5
D:localAppDatanpmazure -> D:localAppDatanpmnode_modulesazure-clibinazure
azure-cli@0.9.3 D:localAppDatanpmnode_modulesazure-cli
├── easy-table@0.0.1
├── eyes@0.1.8
├── xmlbuilder@0.4.3
├── through@2.3.4
├── swagger-schema-official@2.0.0-a33091a
├── node-uuid@1.2.0
├── colors@0.6.2
├── wordwrap@0.0.2
├── streamline-streams@0.1.5
├── async@0.2.7
├── image-size@0.3.5
├── mime@1.2.11
├── validator@3.1.0
├── tv4@1.1.9
├── tmp@0.0.25
├── caller-id@0.1.0 (stack-trace@0.0.9)
├── commander@1.0.4 (keypress@0.1.0)
├── walk@2.3.9 (foreachasync@3.0.0)
├── underscore@1.4.4
├── tunnel@0.0.2
├── readable-stream@1.0.33 (isarray@0.0.1, inherits@2.0.1, string_decoder@0.10.31, core-util-is@1.0.1)
├── azure-asm-hdinsight@0.10.1
├── openssl-wrapper@0.2.1 (debug@0.7.4, q@0.9.7)
├── azure-monitoring@0.10.0
├── event-stream@3.1.5 (stream-combiner@0.0.4, from@0.1.3, pause-stream@0.0.11, duplexer@0.1.1, split@0.2.10, map-stream@0.1.0)
├── kuduscript@0.2.2 (commander@1.1.1)
├── github@0.1.6
├── omelette@0.1.0
├── winston@0.6.2 (cycle@1.0.3, stack-trace@0.0.9, pkginfo@0.2.3, async@0.1.22, request@2.9.203)
├── xml2js@0.1.14 (sax@1.1.1)
├── jszip@2.5.0 (pako@0.2.6)
├── request@2.27.0 (forever-agent@0.5.2, aws-sign@0.3.0, qs@0.6.6, tunnel-agent@0.3.0, oauth-sign@0.3.0, cookie-jar@0.3.0, json-stringify-safe@5.0.1, node-uuid@1.4.3, form-data@0.1.4, http-signature@0.10.1, hawk@1.0.0)
├── azure-common@0.9.12 (dateformat@1.0.2-1.2.3, duplexer@0.1.1, envconf@0.0.4, xml2js@0.2.7, request@2.45.0)
├── azure-storage-legacy@0.9.13 (azure-common@0.9.10)
├── node-forge@0.6.23
├── azure-mgmt-subscription@0.9.16 (azure-common@0.9.11)
├── moment@2.6.0
├── azure-keyvault@0.9.2 (node-uuid@1.4.3, azure-common@0.9.10)
├── adal-node@0.1.12 (node-uuid@1.4.1, xmldom@0.1.19, xpath.js@1.0.6, jws@1.0.1, date-utils@1.2.17)
├── azure-mgmt-sql@0.9.17 (azure-common@0.9.11)
├── azure-storage@0.4.1 (extend@1.2.1, node-uuid@1.4.3, xml2js@0.2.7)
├── azure-gallery@2.0.0-pre.15 (azure-common@0.9.11)
├── azure-mgmt-sb@0.9.16 (azure-common@0.9.11)
├── azure-mgmt-vnet@0.9.17 (azure-common@0.9.11)
├── azure-mgmt-resource@2.0.0-pre.17 (azure-common@0.9.11)
├── azure-mgmt-storage@0.9.16 (azure-common@0.9.11)
├── azure-mgmt-authorization@0.9.0-pre.6 (azure-common@0.9.11)
├── azure-extra@0.1.7 (azure-common@0.9.11)
├── azure-mgmt-compute@0.9.16 (azure-common@0.9.11)
├── azure-insights@0.7.7-pre (azure-common@0.9.11)
├── azure-mgmt@0.9.16 (azure-common@0.9.11)
├── azure-mgmt-website@0.9.16 (azure-common@0.9.11)
└── streamline@0.10.17 (galaxy@0.1.12, source-map@0.1.43)

ここで、azureを実行

D:home>azure
info: Microsoft Azure: Microsoft's Cloud Platform
info:
info: Tool version 0.9.3
help:
help: Display help for a given command
help: help [options] [command]
help:
help: Log in to an Azure subscription using Active Directory. Currently, the user can login only via Microsoft organizational account
help: login [options] [username]
help:
help: Log out from Azure subscription using Active Directory. Currently, the user can log out only via Microsoft organizational account
help: logout [options] [username]
help:
help: Open the portal in a browser
help: portal [options]
help:
help: Commands:
help: account Commands to manage your account information and publish settings
help: config Commands to manage your local settings
help: hdinsight Commands to manage HDInsight clusters and jobs
help: mobile Commands to manage your Mobile Services
help: network Commands to manage your Networks
help: sb Commands to manage your Service Bus configuration
help: service Commands to manage your Cloud Services
help: site Commands to manage your Web Sites
help: sql Commands to manage your SQL Server accounts
help: storage Commands to manage your Storage objects
help: vm Commands to manage your Virtual Machines
help:
help: Options:
help: -h, --help output usage information
help: -v, --version output the application version

なんとなく満足w

コメント

タイトルとURLをコピーしました