az account
Note
此命令群組具有 Azure CLI 和至少一個擴充功能中定義的命令。 安裝每個擴充功能以受益於其擴充功能。 Learn more about extensions.
管理 Azure 訂用帳戶資訊。
命令
az account accept-ownership-status
接受訂用帳戶擁有權狀態。
az account accept-ownership-status --subscription-id
必要參數
訂用帳戶標識碼。必要。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az account clear
清除 CLI 本機快取中的所有訂用帳戶。
若要清除目前的訂用帳戶,請使用 'az logout'。
az account clear
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az account create
此命令處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus
建立訂用帳戶。
az account create --enrollment-account-name --enrollment-account-object-id
--offer-type {MS-AZR-0017P, MS-AZR-0148P, MS-AZR-USGOV-0015P, MS-AZR-USGOV-0017P, MS-AZR-USGOV-0148P}
[--display-name]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--owner-object-id]
[--owner-spn]
[--owner-upn]
必要參數
訂用帳戶要計費的註冊帳戶名稱。
訂用帳戶的供應項目類型。 例如,MS-AZR-0017P(EnterpriseAgreement) 和 MS-AZR-0148P(EnterpriseAgreement devTest) 可供使用。 允許的值:MS-AZR-0017P、MS-AZR-0148P、MS-AZR-USGOV-0015P、MS-AZR-USGOV-0017P、MS-AZR-USGOV-0148P。
屬性 | 值 |
---|---|
接受的值: | MS-AZR-0017P, MS-AZR-0148P, MS-AZR-USGOV-0015P, MS-AZR-USGOV-0017P, MS-AZR-USGOV-0148P |
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
訂閱的顯示名稱。
請勿等候長時間執行的作業完成。
屬性 | 值 |
---|---|
接受的值: | 0, 1, f, false, n, no, t, true, y, yes |
應授與新訂用帳戶存取權的 owner(s) 對象識別碼。
應授與新訂用帳戶存取權之擁有者的服務主體名稱。。
應授與新訂用帳戶存取權之擁有者的用戶主體名稱。。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az account get-access-token
取得令牌,讓公用程式存取 Azure。
令牌至少有效 5 分鐘,最大值為 60 分鐘。 如果未指定訂用帳戶自變數,則會使用目前的帳戶。
在輸出中,expires_on
代表 POSIX 時間戳,expiresOn
代表本機日期時間。 建議下游應用程式使用 expires_on
,因為它是UTC。
az account get-access-token [--name --subscription]
[--resource]
[--resource-type {aad-graph, arm, batch, data-lake, media, ms-graph, oss-rdbms}]
[--scope]
[--tenant]
範例
取得目前帳戶的存取令牌
az account get-access-token
取得特定訂用帳戶的存取令牌
az account get-access-token --subscription 00000000-0000-0000-0000-000000000000
取得特定租使用者的存取令牌
az account get-access-token --tenant 00000000-0000-0000-0000-000000000000
取得與 MS Graph API 搭配使用的存取令牌
az account get-access-token --resource-type ms-graph
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
訂用帳戶的名稱或標識碼。
Microsoft Entra v1.0 中的 Azure 資源端點。
已知資源的類型。
屬性 | 值 |
---|---|
接受的值: | aad-graph, arm, batch, data-lake, media, ms-graph, oss-rdbms |
Microsoft Entra v2.0 中的空格分隔範圍。 預設為 Azure Resource Manager。
取得令牌的租用戶標識碼。 僅適用於使用者和服務主體帳戶,不適用於受控識別或 Cloud Shell 帳戶。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az account list
取得已登入帳戶的訂用帳戶清單。 根據預設,只會顯示來自目前雲端的「已啟用」訂用帳戶。
az account list [--all]
[--refresh]
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
列出所有雲端的所有訂用帳戶,包括未啟用的訂用帳戶。
屬性 | 值 |
---|---|
預設值: | False |
從伺服器擷取 up-to日期訂閱。
屬性 | 值 |
---|---|
預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az account list-locations
列出目前訂用帳戶支持的區域。
az account list-locations [--include-extended-locations {0, 1, f, false, n, no, t, true, y, yes}]
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
是否要包含擴充位置。
屬性 | 值 |
---|---|
接受的值: | 0, 1, f, false, n, no, t, true, y, yes |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az account set
將訂用帳戶設定為目前的使用中訂用帳戶。
az account set --name --subscription
必要參數
訂用帳戶的名稱或標識碼。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |
az account show
取得訂用帳戶的詳細數據。
如果未指定訂用帳戶,則會顯示預設訂用帳戶的詳細數據。
az account show [--name --subscription]
選擇性參數
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
訂用帳戶的名稱或標識碼。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
屬性 | 值 |
---|---|
預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
屬性 | 值 |
---|---|
預設值: | False |
Output format.
屬性 | 值 |
---|---|
預設值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
屬性 | 值 |
---|---|
預設值: | False |