如何使用 PowerShell 中的 Azure CLI 連線到 Azure 訂閱?


要使用 Az CLI 連線到特定的 Azure 訂閱,我們需要使用 “Az account set” 命令,但在此之前請確保使用 “az login” 賬戶連線 Azure 雲。

az account set --subscription 'subscription name or id'

你還可以使用 -s 代替 --subscription.

az account set -s 'subscription name or id'

要檢查訂閱是否設定正確,請使用以下命令。

PS C:\> az account show -otable

更新日期:2021-8-31

9K+ 瀏覽

開啟你的職業生涯

完成此課程並獲得證書

開始
廣告