快速入門:使用成本分析探索及分析成本Quickstart: Explore and analyze costs with Cost analysis

您必須先了解成本源自組織內的何處,才能正確地控制 Azure 成本並進行最佳化。Before you can properly control and optimize your Azure costs, you need to understand where costs originated within your organization. 了解您服務成本的價值,以及支援哪些環境和系統也很實用。It's also useful to know how much money your services cost, and in support of what environments and systems. 使各個層面的成本透明化,對於精確地了解組織費用模式而言至關重要。Visibility into the full spectrum of costs is critical to accurately understand organizational spending patterns. 費用模式可用於強制執行成本控制機制 (例如預算)。Spending patterns can be used to enforce cost control mechanisms, like budgets.

在本快速入門中,您可以使用成本分析來探索及分析組織成本。In this quickstart, you use cost analysis to explore and analyze your organizational costs. 您可依組織檢視彙總的成本,以了解經過一段時間所產生的成本,並找出費用趨勢。You can view aggregated costs by organization to understand where costs occur over time and identify spending trends. 您可以檢視經過一段時間累積的成本,對照預算來預估每月、每季,或甚至每年的成本趨勢。You can view accumulated costs over time to estimate monthly, quarterly, or even yearly cost trends against a budget. 預算有助於遵守財務限制。A budget helps to provide adherence to financial constraints. 預算同時也能用於檢視每天或每月的成本,以找出費用的異常情況。And a budget is used to view daily or monthly costs to isolate spending irregularities. 此外,您可以下載目前報表的資料以供進一步分析,或在外部系統中使用。And, you can download the current report's data for further analysis or to use in an external system.

在此快速入門中,您可了解如何:In this quickstart, you learn how to:

  • 在成本分析中檢閱成本Review costs in cost analysis
  • 自訂成本檢視Customize cost views
  • 下載成本分析資料Download cost analysis data

必要條件Prerequisites

成本分析支援不同的 Azure 帳戶類型。Cost analysis supports different kinds of Azure account types. 若要檢視所支援帳戶類型的完整清單,請參閱了解成本管理資料To view the full list of supported account types, see Understand Cost Management data. 若要檢視成本資料,您至少需要 Azure 帳戶的讀取存取。To view cost data, you need at least read access for your Azure account.

針對 Enterprise 合約 (EA) 客戶,您必須至少具備一或多個下列範圍的讀取存取,才能檢視成本資料。For Enterprise Agreement (EA) customers, you must have at least read access to one or more of the following scopes to view cost data.

  • 計費帳戶Billing account
  • departmentDepartment
  • 註冊帳戶Enrollment account
  • 管理群組Management group
  • 訂用帳戶Subscription
  • 資源群組Resource group

如需成本管理資料的存取權指派詳細資訊,請參閱指派資料的存取權For more information about assigning access to Cost Management data, see Assign access to data.

登入 AzureSign in to Azure

在成本分析中檢閱成本Review costs in cost analysis

若要在成本分析中檢閱您的成本,請在 Azure 入口網站中開啟範圍,然後選取功能表中的 [成本分析] 。To review your costs in cost analysis, open the scope in the Azure portal and select Cost analysis in the menu. 例如,瀏覽至 [訂用帳戶] 、從清單中選取訂用帳戶,然後在功能表中選取 [成本分析] 。For example, navigate to Subscriptions, select a subscription from the list, and then select Cost analysis in the menu. 使用 [範圍] 框,以切換至成本分析中的不同範圍。Use the Scope pill to switch to a different scope in cost analysis. 如需有關範圍的詳細資訊,請參閱了解並使用範圍For more information about scopes, see Understand and work with scopes.

您選取的範圍會在成本管理過程中全程使用,以提供資料彙總,並控制成本資訊的存取權。The scope you select is used throughout Cost Management to provide data consolidation and to control access to cost information. 當您使用範圍時,您不會多重選取。When you use scopes, you don't multi-select them. 而是會選取一個其他人所積存的較大範圍,然後篩選出需要的巢狀範圍。Instead, you select a larger scope which others roll up to and then filter down to the nested scopes you need. 了解這個方法很重要,因為某些人並沒有單一父項範圍 (包含多個巢狀範圍) 的存取權。This approach is important to understand since some people may not have access to a single parent scope, which covers multiple nested scopes.

最初的成本分析檢視包含下列區域:The initial cost analysis view includes the following areas:

總計:顯示當月的總成本。Total – Shows the total costs for the current month.

預算:顯示已針對所選取範圍規劃的費用限制 (如果有的話)。Budget – Shows the planned spending limit for the selected scope, if available.

累積成本:顯示從當月月初開始記錄的每日費用累積總計。Accumulated cost – Shows the total aggregate daily spending, starting from the beginning of the month. 在為計費帳戶或訂用帳戶建立預算之後,即可對照預算,快速查看費用趨勢。After you create a budget for your billing account or subscription, you can quickly see your spending trend against the budget. 將滑鼠停留在一個日期上方,即可檢視累積到當天的費用。Hover over a date to view the accumulated cost for that day.

樞紐分析圖 (環圈圖) – 提供動態樞紐分析,將總成本依一組常用的標準屬性進行細分。Pivot (donut) charts – Provide dynamic pivots, breaking down the total cost by a common set of standard properties. 它們會以從最高成本排到最低成本的順序,顯示當月成本記錄。They show the most to least costly for the current month. 您隨時都可選取不同的樞紐分析表來變更樞紐分析圖。You can change pivot charts at any time by selecting a different pivot. 成本分類依據:服務 (計量類別)、位置 (區域),以及子範圍 (預設)。Costs are categorized by: service (meter category), location (region), and child scope by default. 例如,計費帳戶下的註冊帳戶、訂用帳戶下的資源群組,以及資源群組下的資源。For example, enrollment accounts under billing accounts, resource groups under subscriptions, and resources under resource groups.

Azure 入口網站中的成本分析初始檢視

自訂成本檢視Customize cost views

成本分析具備四個內建的檢視,並已針對最常見的目標最佳化:Cost analysis has four built-in views, optimized for the most common goals:

檢視View 回答類似以下所列的問題...Answer questions like...
累積成本Accumulated cost 我這個月到目前為止支出了多少費用?How much have I spent so far this month? 我將維持在預算範圍內嗎?Will I stay within my budget?
每日成本Daily cost 過去 30 天每天的成本是否增加?Have there been any increases in the costs per day for the last 30 days?
依服務區分的成本Cost by service 為什麼過去 3 張發票列出的每月使用量落差很大?How has my monthly usage vary over the past 3 invoices?
依資源區分的成本Cost by resource 這個月到目前為止,哪一項資源最花錢?Which resources cost the most so far this month?

顯示一個本月選取項目範例的檢視選取器

不過,在許多情況下,您需要更深入的分析。However, there are many cases where you need deeper analysis. 自訂會從選取頁面上方的日期開始。Customization starts at the top of the page, with the date selection.

成本分析預設會顯示當月的資料。Cost analysis shows data for the current month by default. 請使用日期選取器快速切換至一般的日期範圍。Use the date selector to switch to common date ranges quickly. 幾個範例包括過去七天、過去一個月、今年,或自訂日期範圍。A few examples include the last seven days, last month, current year, or a custom date range. 隨用隨付訂用帳戶也會包含以您的計費週期 (例如目前或上一張發票的計費週期) 為依據的資料範圍,且計費週期不受日曆月份限制。Pay-as-you-go subscriptions also include date ranges based on your billing period, which isn't bound to the calendar month, like the current billing period or last invoice. 可使用功能表頂端的 [< 上一個] 和 [下一個 >] 連結,分別跳至上一個或下一個週期。Use the <PREVIOUS and NEXT> links at the top of the menu to jump to the previous or next period, respectively. 例如,[< 上一個] 會從過去七天切換至之前 8 到 14 天,然後再切換到之前 15 至 21 天。As an example, <PREVIOUS will switch from the last seven days to 8-14 days ago and then to 15-21 days ago.

顯示本月份範例選取項目的日期選取器

此外,成本分析預設會顯示累積的成本。Cost analysis shows accumulated costs by default. 累積的成本會包含每一天和之前天數的所有成本,以提供每日累積成本的持續成長檢視。Accumulated costs include all costs for each day plus the previous days, for a constantly growing view of your daily aggregate costs. 此檢視已經過最佳化,可顯示對照於所選時間範圍,您的預算趨勢為何。This view is optimized to show how you're trending against a budget for the selected time range.

另外,還有每日檢視,可顯示每一天的成本。There's also the daily view showing costs for each day. 每日檢視並不會顯示成長趨勢。The daily view doesn't show a growth trend. 因為成本尖峰或下降每日各有不同,所以該檢視設計為可顯示異常。The view is designed to show irregularities as cost spikes or dips from day to day. 若您選取了預算,則每日檢視也會顯示每日預算的估計值。If you've selected a budget, the daily view also shows an estimate of what your daily budget might look like. 若您的每日成本持續高於估計的每日預算,則您可預期將會超過每月預算。When your daily costs are consistently above the estimated daily budget, then you can expect you'll surpass your monthly budget. 估計的每日預算只是協助您在較低層級將預算視覺化的一種方法。The estimated daily budget is simply a means to help you visualize your budget at a lower level. 當您的每日成本出現波動時,則相較於您的每月預算,估計的每日預算較不精準。When you have fluctuations in daily costs, then the estimated daily budget comparison to your monthly budget is less precise.

一般而言,您可以預期會在 8 到 12 小時內看到已耗用資源的資料或通知。Generally, you can expect to see data or notifications for consumed resources within 8-12 hours.

顯示目前月份每日成本範例的每日檢視

可使用 [分組方式] 依適用屬性分組,以細分成本並識別成本最高的參與者。Group by common properties to break down costs and identify top contributors. 例如,若要依資源標記分組,請選取要作為分組方式的標記索引鍵。To group by resource tags, for instance, select the tag key you want to group by. 系統就會依每個標記值細分成本,並提供一個額外區段以顯示未套用該標記的資源。Costs are broken down by each tag value, with an extra segment for resources that don't have that tag applied.

大部分的 Azure 資源可支援標記,但某些標記無法在成本管理和計費中使用。Most Azure resources support tagging, however some tags aren't available in Cost Management and billing. 此外,也不支援資源群組標記。Additionally, resource group tags aren't supported. 只有在資源標記直接套用到資源的那天起,成本管理才會支援資源標記。Cost Management only supports resource tags from the date the tags are applied directly to the resource. 觀看如何使用 Azure 成本管理檢閱標記原則影片,了解如何運用 Azure 標記原則提升成本資料可見性。Watch the How to review tag policies with Azure Cost Management video to learn about using Azure tag policy to improve cost data visibility.

以下是上個月檢視的 Azure 服務成本檢視。Here's a view of Azure service costs for a view of the last month.

已分組的每日累積檢視,顯示上個月的 Azure 服務成本範例

主要圖表下的樞紐分析圖會顯示不同的群組,可讓您用更廣泛的視角來檢視所選期間和篩選條件下的整體成本。Pivot charts under the main chart show different groupings to give you a broader picture of your overall costs for the selected time period and filters. 選取屬性或標記來檢視以任何維度彙總的成本。Select a property or tag to view aggregated costs by any dimension.

目前檢視的完整資料,顯示資源群組名稱

上圖顯示資源群組名稱。The preceding image shows resource group names. 雖然您可以依標記分組來檢視每個標記的總成本,但您無法在任何成本分析檢視中檢視每個資源或資源群組的所有標記。While you can group by tag to view total costs per tag, viewing all tags per resource or resource group isn't available in any of the cost analysis views.

依特定屬性將成本分組時,會以最高至最低的順序,顯示前 10 名成本參與者。When grouping costs by a specific attribute, the top 10 cost contributors are shown from highest to lowest. 如果參與者超過 10 個,前 9 個成本參與者會以一個 [其他] 群組的方式顯示,裡面涵蓋了所有剩餘的群組。If more than 10, the top nine cost contributors are shown with an Others group, which covers all remaining groups together. 依標記分組時,您可能也會看到 [未標記] 群組,表示未套用標記索引鍵的成本。When grouping by tags, you may also see an Untagged group for costs that don't have the tag key applied. 未標記一律放在最後,即使未標記的成本高於已標記的成本也一樣。Untagged is always last, even if untagged costs are higher than tagged costs. 如果有 10 個以上的標記值存在,未標記的成本會包含在 [其他] 中。Untagged costs will be part of Others, if 10 or more tag values exist.

「傳統」 虛擬機器、網路和儲存體資源不會共用詳細的計費資料。Classic virtual machines, networking, and storage resources don't share detailed billing data. 這些資源會在成本分組時合併成 [傳統服務] 。They're merged as Classic services when grouping costs.

您可以檢視任何檢視的完整資料集。You can view the full data set for any view. 您所套用的任何選取項目或篩選條件都會影響所顯示的資料。Whatever selections or filters that you apply affect data presented. 若要查看完整的資料集,請按一下 [圖表類型] 清單,然後按一下 [資料表] 檢視。To see the full data set, click the chart type list and then click Table view.

在資料表檢視中目前檢視的資料

下載成本分析資料Download cost analysis data

您可以從成本分析下載資訊,為目前顯示於 Azure 入口網站中的所有資料,產生一個 CSV 檔案。You can Download information from cost analysis to generate a CSV file for all data currently shown in the Azure portal. 您套用的所有篩選或分組,都會包含在該檔案中。Any filters or grouping that you apply are included in the file. 未主動顯示的最上方總計圖下之資料,會納入該 CSV 檔案中。Underlying data for the top Total chart that isn't actively displayed is included in the CSV file.

後續步驟Next steps

請前進到第一個教學課程,了解如何建立及管理預算。Advance to the first tutorial to learn how to create and manage budgets.