| 1 | [[PageOutline]] |
| 2 | |
| 3 | = Azure = |
| 4 | |
| 5 | * 註冊 Azure - https://azure.microsoft.com/zh-tw/ |
| 6 | * 安裝 Azure CLI - https://azure.microsoft.com/zh-tw/documentation/articles/xplat-cli-install/ |
| 7 | |
| 8 | == Azure 術語與觀念 == |
| 9 | |
| 10 | * Azure 建立和處理資源的部署模型有二種: 資源管理員和傳統 |
| 11 | * 傳統的文件入口:https://azure.microsoft.com/zh-tw/documentation/articles/virtual-machines-command-line-tools/ |
| 12 | * Microsoft 建議大部分的新部署使用 Resource Manager model。(常看到的 ARM 縮寫,指的就是 Azure Resource Manager) |
| 13 | * 資源管理員文件入口:https://azure.microsoft.com/zh-tw/documentation/articles/xplat-cli-azure-resource-manager/ |
| 14 | |
| 15 | == Azure 操作與管理 == |
| 16 | |
| 17 | * Docker Hub - https://hub.docker.com/r/microsoft/azure-cli/ |
| 18 | * azure-cli 的 github - https://github.com/azure/azure-xplat-cli |
| 19 | * 在 Docker主機中,執行: |
| 20 | {{{ |
| 21 | docker run -it microsoft/azure-cli |
| 22 | }}} |
| 23 | * 安裝好 Azure CLI 之後,您就能從命令列使用者介面 (Bash、終端機及命令提示字元等) 中執行 azure 命令。例如,若要執行 [說明] 命令,請輸入下列命令: |
| 24 | {{{ |
| 25 | azure help |
| 26 | }}} |
| 27 | * 若要查看您所安裝的 Azure CLI 版本,請輸入下列命令: |
| 28 | {{{ |
| 29 | azure --version |
| 30 | }}} |
| 31 | * 參考 https://azure.microsoft.com/zh-tw/documentation/articles/xplat-cli-connect/ 完成帳號綁定 |
| 32 | * 因為使用的是 0.9.10 以後的版本,所以直接使用 `azure login` |
| 33 | {{{ |
| 34 | root@azure:~# azure --version |
| 35 | 0.9.19 (node: 4.2.4) |
| 36 | root@azure:~# azure login |
| 37 | info: Executing command login |
| 38 | -info: To sign in, use a web browser to open the page https://aka.ms/devicelogin. Enter the code G*K*N*D*L to authenticate. |
| 39 | /info: Added subscription Free Trial |
| 40 | info: Setting subscription "Free Trial" as default |
| 41 | + |
| 42 | info: login command OK |
| 43 | }}} |
| 44 | * 檢查 account 狀態 |
| 45 | {{{ |
| 46 | root@azure:~# azure account list |
| 47 | info: Executing command account list |
| 48 | data: Name Id Current State |
| 49 | data: ---------- ------------------------------------ ------- ------- |
| 50 | data: Free Trial #################################### true Enabled |
| 51 | info: account list command OK |
| 52 | }}} |
| 53 | |