Azure CLI 的 Azure 球體擴充功能概觀
用於管理 Azure 球體連接裝置和雲端部署的命令列工具會以 Azure CLI 擴充功能發佈。
安裝 Azure CLI 和 Azure 球體擴充功能
若要取得 Azure CLI 的 Azure 球體擴充功能:
如果您尚未安裝Azure CLI,請安裝它。
若要新增 Azure 球體擴充功能,請執行下列命令:
az extension add --name azure-sphere
您必須 使用 Azure CLI 登入,才能登入您想要用來管理 Azure 球體裝置的 Azure 訂閱。
一旦安裝擴充功能後,就會在殼層變數的 $AZURE_EXTENSION_DIR
值底下找到它的位置。 如果此變數已取消設定,預設值為 $HOME/.azure/cliextensions
Linux 和 macOS,以及 %USERPROFILE%\.azure\cliextensions
Windows 上。
提示
登入之後,您會看到與您的 Azure 帳戶相關聯的訂閱清單。 使用 Azure 球體擴充功能的命令來正確運作, az account set
確定您已選取具有必要許可權的訂閱。 如需有關訂閱選擇的詳細資訊,請參 閱使用多個 Azure 訂閱。
管理 Azure 球體擴充功能
若要查看已安裝的 Azure CLI 擴充功能版本,請使用下列命令:
az version
若要將 Azure 球體擴充功能更新為最新版本,請使用:
az extension update --name azure-sphere
若要卸載 Azure 球體擴充功能,請使用:
az extension remove --name azure-sphere
常見的 Azure 球體 CLI 命令
您可以從 Windows 命令提示字元或 PowerShell 輸入 az sphere
,來使用 Azure 球體命令。
在 Linux 上,您可以使用任何命令列介面 (CLI) 。 CLI 在 Bash 殼層底下有命令的完整索引標籤完成。
本表格列出一些常見的 Azure 球體命令,並連結至其參考檔。
命令 | 描述 |
---|---|
az sphere catalog |
管理您的目錄。 |
az sphere ca-certificate |
管理目錄中的憑證。 |
az sphere deployment |
管理目錄中的部署。 |
az sphere device |
管理 Azure 球體裝置。 |
az sphere device-group |
管理目錄中的裝置群組。 |
az sphere image |
管理目錄中的影像。 |
az sphere product |
管理目錄中的產品。 |
az sphere get-support-data |
收集關於系統、雲端和裝置設定的診斷資料。 |
Azure CLI 可讓您設定 設定選項 ,以簡化 Azure 球體 CLI 命令的使用,方法是提供參數的預設值,例如 --resource-group
, 或 --subscription
--catalog
。
裝置相依的命令
此命令適用于本機連接的 Azure 球體裝置。 如果您嘗試的命令未連接裝置,您會收到錯誤訊息。 如需裝置命令的詳細資訊,請參閱 az 球形裝置
az sphere device claim
az sphere device recover
az sphere device restart
az sphere device show-attached
az sphere device show-os-version
az sphere device app show-memory-status
az sphere device app show-quota
az sphere device app show-status
az sphere device app start
az sphere device app stop
az sphere device capability show-attached
az sphere device capability update
az sphere device certificate add
az sphere device certificate delete
az sphere device certificate list
az sphere device certificate show
az sphere device certificate show-quota
az sphere device image list-installed
az sphere image-package show
az sphere device manufacturing-state show
az sphere device manufacturing-state update
az sphere device network proxy apply
az sphere device network proxy delete
az sphere device network proxy show
az sphere device network disable
az sphere device network enable
az sphere device network list-firewall-rules
az sphere device network list-interfaces
az sphere device network show-diagnostics
az sphere device network show-status
az sphere device network update-interface
az sphere device sideload delete
az sphere device sideload deploy
az sphere device wifi add
az sphere device wifi disable
az sphere device wifi enable
az sphere device wifi forget
az sphere device wifi list
az sphere device wifi reload-config
az sphere device wifi scan
az sphere device wifi show
az sphere device wifi show-status
全球可用的引數
下列全域參數適用于 Azure 球體擴充功能:
參數 | 描述 |
---|---|
--debug |
增加記錄詳細資訊以顯示所有偵錯記錄。 |
--help -h |
顯示說明訊息。 |
--only-show-errors |
只會顯示錯誤,隱藏警告。 |
--output -o |
輸出格式。 允許的值: json 、 jsonc 、、 none 、 table 、 tsv 、 yaml 。 yamlc 預設: json 。 |
--query |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/ 。 |
--subscription |
:訂閱的名稱或識別碼。 您可以使用 az account set -s NAME_OR_ID 設定預設訂閱。 |
--verbose |
增加記錄詳細資訊。 用於 --debug 完整偵錯記錄。 |