az costmanagement export
備註
此參考是 Azure CLI 的 costmanagement 延伸模組的一部分(2.55.0 版或更高版本)。 擴充功能會在您第一次執行 az costmanagement export 命令時自動安裝。 深入瞭解擴充功能。
Costmanagement 導出。
命令
| 名稱 | Description | 類型 | 狀態 |
|---|---|---|---|
| az costmanagement export create |
建立導出的作業。 |
擴充套件 | GA |
| az costmanagement export delete |
要刪除匯出的作業。 |
擴充套件 | GA |
| az costmanagement export list |
列出指定範圍內所有導出的作業。 |
擴充套件 | GA |
| az costmanagement export show |
依匯出名稱取得所定義範圍之匯出執行歷程記錄的作業。 |
擴充套件 | GA |
| az costmanagement export update |
更新導出的作業。 |
擴充套件 | GA |
az costmanagement export create
建立導出的作業。
az costmanagement export create --name
--scope
--storage-account-id
--storage-container
--timeframe {BillingMonthToDate, Custom, MonthToDate, TheLastBillingMonth, TheLastMonth, WeekToDate}
[--dataset-configuration]
[--recurrence {Annually, Daily, Monthly, Weekly}]
[--recurrence-period]
[--schedule-status {Active, Inactive}]
[--storage-directory]
[--time-period]
[--type {ActualCost, AmortizedCost, Usage}]
範例
建立ManagementGroup範圍的導出
az costmanagement export create --name "TestExport" --type "Usage" --dataset-configuration columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --timeframe "MonthToDate" --storage-container="exports" --storage-account-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" --storage-directory="ad-hoc" --recurrence "Weekly" --recurrence-period from="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Management/managementGroups/TestMG"
建立 ResourceGroup 範圍的導出
az costmanagement export create --name "TestExport" --type "Usage" --dataset-configuration columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --timeframe "MonthToDate" --storage-container="exports" --storage-account-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" --storage-directory="ad-hoc" --recurrence "Weekly" --recurrence-period from="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"
建立訂用帳戶範圍的匯出
az costmanagement export create --name "TestExport" --type "Usage" --dataset-configuration columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --timeframe "MonthToDate" --storage-container="exports" --storage-account-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" --storage-directory="ad-hoc" --recurrence "Weekly" --recurrence-period from="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "subscriptions/00000000-0000-0000-0000-000000000000"
必要參數
匯出名稱。
與查詢和匯出作業相關聯的範圍。 這包括訂用帳戶範圍的 '/subscriptions/{subscriptionId}/' 、資源群組範圍的 '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'、'/providers/Microsoft.Management/managementGroups/{managementGroupId} 。
要儲存導出的記憶體帳戶標識碼。
| 屬性 | 值 |
|---|---|
| 參數群組: | Delivery Destination Info Arguments |
要傳遞導出的記憶體容器。
| 屬性 | 值 |
|---|---|
| 參數群組: | Delivery Destination Info Arguments |
提取查詢數據的時間範圍。 如果為 custom,則必須提供特定的時間週期。
| 屬性 | 值 |
|---|---|
| 參數群組: | Export Definition Arguments |
| 接受的值: | BillingMonthToDate, Custom, MonthToDate, TheLastBillingMonth, TheLastMonth, WeekToDate |
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
具有匯出中數據的組態資訊。 如果提供匯總和群組,將會忽略組態。 預期值:columns=xx。
| 屬性 | 值 |
|---|---|
| 參數群組: | Export Definition Arguments |
排程週期。
| 屬性 | 值 |
|---|---|
| 參數群組: | Schedule Info Arguments |
| 接受的值: | Annually, Daily, Monthly, Weekly |
具有周期的開始和結束日期。 開始日期必須在未來。 如果存在,結束日期必須大於開始日期。 預期值:KEY1=VALUE1 KEY2=VALUE2 ... ,可用的 KEY 是:from、 to。 時間格式就像 2020-05-01T00:00:00。
| 屬性 | 值 |
|---|---|
| 參數群組: | Schedule Info Arguments |
匯出排程的狀態。 如果非使用中,導出的排程執行會暫停。
| 屬性 | 值 |
|---|---|
| 參數群組: | Schedule Info Arguments |
| 預設值: | Inactive |
| 接受的值: | Active, Inactive |
要儲存匯出之記憶體容器中的根目錄。
| 屬性 | 值 |
|---|---|
| 參數群組: | Delivery Destination Info Arguments |
有提取查詢數據的時間週期。 預期值:from=TIMESTAMP1 to=TIMESTAMP2。 時間戳格式就像 2020-05-01T00:00:00。未來必須有TIMESTAMP1,TIMESTAMP2必須大於TIMESTAMP1。
| 屬性 | 值 |
|---|---|
| 參數群組: | Export Definition Arguments |
查詢的類型。
| 屬性 | 值 |
|---|---|
| 參數群組: | Export Definition Arguments |
| 預設值: | Usage |
| 接受的值: | ActualCost, AmortizedCost, Usage |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az costmanagement export delete
要刪除匯出的作業。
az costmanagement export delete --name
--scope
[--yes]
範例
刪除 ManagementGroup 範圍的匯出
az costmanagement export delete --name "TestExport" --scope "providers/Microsoft.Management/managementGroups/TestMG"
刪除 ResourceGroup 範圍的導出
az costmanagement export delete --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"
刪除訂閱範圍的匯出
az costmanagement export delete --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-000000000000"
必要參數
匯出名稱。
與查詢和匯出作業相關聯的範圍。 這包括訂用帳戶範圍的 '/subscriptions/{subscriptionId}/' 、資源群組範圍的 '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'、'/providers/Microsoft.Management/managementGroups/{managementGroupId} 。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
請勿提示確認。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az costmanagement export list
列出指定範圍內所有導出的作業。
az costmanagement export list --scope
範例
列出ManagementGroup範圍中的匯出
az costmanagement export list --scope "providers/Microsoft.Management/managementGroups/TestMG"
列出 ResourceGroup 範圍中的匯出
az costmanagement export list --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"
列出訂用帳戶範圍中的匯出
az costmanagement export list --scope "subscriptions/00000000-0000-0000-0000-000000000000"
必要參數
與查詢和匯出作業相關聯的範圍。 這包括訂用帳戶範圍的 '/subscriptions/{subscriptionId}/' 、資源群組範圍的 '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'、'/providers/Microsoft.Management/managementGroups/{managementGroupId} 。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az costmanagement export show
依匯出名稱取得所定義範圍之匯出執行歷程記錄的作業。
az costmanagement export show --name
--scope
範例
在 ManagementGroup 範圍中顯示匯出
az costmanagement export show --name "TestExport" --scope "providers/Microsoft.Management/managementGroups/TestMG"
在 ResourceGroup 範圍內顯示導出
az costmanagement export show --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"
在訂用帳戶範圍中顯示匯出
az costmanagement export show --name "TestExport" --scope "subscriptions/00000000-0000-0000-0000-000000000000"
必要參數
匯出名稱。
與查詢和匯出作業相關聯的範圍。 這包括訂用帳戶範圍的 '/subscriptions/{subscriptionId}/' 、資源群組範圍的 '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'、'/providers/Microsoft.Management/managementGroups/{managementGroupId} 。
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
az costmanagement export update
更新導出的作業。
az costmanagement export update --name
--scope
[--dataset-configuration]
[--recurrence {Annually, Daily, Monthly, Weekly}]
[--recurrence-period]
[--schedule-status {Active, Inactive}]
[--storage-account-id]
[--storage-container]
[--storage-directory]
[--time-period]
[--timeframe {BillingMonthToDate, Custom, MonthToDate, TheLastBillingMonth, TheLastMonth, WeekToDate}]
範例
更新 ManagementGroup 範圍中的匯出
az costmanagement export update --name "TestExport" --dataset-configuration columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --timeframe "MonthToDate" --storage-container="exports" --storage-account-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" --storage-directory="ad-hoc" --recurrence "Weekly" --recurrence-period from="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "providers/Microsoft.Management/managementGroups/TestMG"
更新 ResourceGroup 範圍內的導出
az costmanagement export update --name "TestExport" --dataset-configuration columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --timeframe "MonthToDate" --storage-container="exports" --storage-account-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" --storage-directory="ad-hoc" --recurrence "Weekly" --recurrence-period from="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG"
更新訂用帳戶範圍中的匯出
az costmanagement export update --name "TestExport" --dataset-configuration columns="Date" columns="MeterId" columns="InstanceId" columns="ResourceLocation" columns="PreTaxCost" --timeframe "MonthToDate" --storage-container="exports" --storage-account-id="/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MYDEVTESTRG/providers/Microsoft.Storage/storageAccounts/ccmeastusdiag182" --storage-directory="ad-hoc" --recurrence "Weekly" --recurrence-period from="2018-06-01T00:00:00Z" to="2018-10-31T00:00:00Z" --schedule-status "Active" --scope "subscriptions/00000000-0000-0000-0000-000000000000"
必要參數
匯出名稱。
與查詢和匯出作業相關聯的範圍。 這包括訂用帳戶範圍的 '/subscriptions/{subscriptionId}/' 、資源群組範圍的 '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}'、'/providers/Microsoft.Management/managementGroups/{managementGroupId} 。
選擇性參數
下列參數是選擇性參數,但視內容而定,命令可能需要一或多個參數才能成功執行。
具有匯出中數據的組態資訊。 如果提供匯總和群組,將會忽略組態。 預期值:columns=xx。
| 屬性 | 值 |
|---|---|
| 參數群組: | Export Definition Arguments |
排程週期。
| 屬性 | 值 |
|---|---|
| 參數群組: | Schedule Info Arguments |
| 接受的值: | Annually, Daily, Monthly, Weekly |
具有周期的開始和結束日期。 開始日期必須在未來。 如果存在,結束日期必須大於開始日期。 預期值:KEY1=VALUE1 KEY2=VALUE2 ... ,可用的 KEY 是:from、 to。 時間格式就像 2020-05-01T00:00:00。
| 屬性 | 值 |
|---|---|
| 參數群組: | Schedule Info Arguments |
匯出排程的狀態。 如果非使用中,導出的排程執行會暫停。
| 屬性 | 值 |
|---|---|
| 參數群組: | Schedule Info Arguments |
| 接受的值: | Active, Inactive |
要儲存導出的記憶體帳戶標識碼。
| 屬性 | 值 |
|---|---|
| 參數群組: | Delivery Destination Info Arguments |
要傳遞導出的記憶體容器。
| 屬性 | 值 |
|---|---|
| 參數群組: | Delivery Destination Info Arguments |
要儲存匯出之記憶體容器中的根目錄。
| 屬性 | 值 |
|---|---|
| 參數群組: | Delivery Destination Info Arguments |
有提取查詢數據的時間週期。 預期值:from=TIMESTAMP1 to=TIMESTAMP2。 時間戳格式就像 2020-05-01T00:00:00。未來必須有TIMESTAMP1,TIMESTAMP2必須大於TIMESTAMP1。
| 屬性 | 值 |
|---|---|
| 參數群組: | Export Definition Arguments |
提取查詢數據的時間範圍。 如果為 custom,則必須提供特定的時間週期。
| 屬性 | 值 |
|---|---|
| 參數群組: | Export Definition Arguments |
| 接受的值: | BillingMonthToDate, Custom, MonthToDate, TheLastBillingMonth, TheLastMonth, WeekToDate |
全域參數
提高日誌詳細程度以顯示所有調試日誌。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
顯示此說明訊息並結束。
只顯示錯誤,隱藏警告。
| 屬性 | 值 |
|---|---|
| 預設值: | False |
輸出格式。
| 屬性 | 值 |
|---|---|
| 預設值: | json |
| 接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/。
訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。
增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。
| 屬性 | 值 |
|---|---|
| 預設值: | False |