如何在 Powershell 中使用 Azure CLI 來獲取當前登入的使用者帳戶?
要獲取連線的使用者帳戶和 Azure CLI,你需要使用下面的命令。
PS C:\> az account show
一旦你鍵入命令,你將得到如下所示的 JSON 格式的輸出。
PS C:\> az account show
{
"environmentName": "AzureCloud",
"homeTenantId": "Your tenant ID",
"id": "Subscriptio ID",
"isDefault": true,
"managedByTenants": [],
"name": "Subscription Name",
"state": "Enabled",
"tenantId": "tenant ID",
"user": {
"name": "user logged in email id or username",
"type": "user"
}
}要獲取表格格式的輸出,使用 -otable 或 –output table
PS C:\> az account show -otable
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP