教學課程:建立和管理 Azure 預算Tutorial: Create and manage Azure budgets

成本管理中的預算可協助您進行規劃並促進組織責任歸屬。Budgets in Cost Management help you plan for and drive organizational accountability. 透過預算,您可以說明您在特定期間所取用或訂閱的 Azure 服務。With budgets, you can account for the Azure services you consume or subscribe to during a specific period. 它們可協助您通知其他人其費用的相關資訊以主動管理成本,並監視費用在經過一段時間的進展方式。They help you inform others about their spending to proactively manage costs, and to monitor how spending progresses over time. 當超過您所建立的預算閾值時,只會觸發通知。When the budget thresholds you've created are exceeded, only notifications are triggered. 您的資源都會不受到影響,而您的使用量並不會停止。None of your resources are affected and your consumption isn't stopped. 當您分析成本時,您可以使用預算來比較及追蹤費用。You can use budgets to compare and track spending as you analyze costs.

每月預算將根據每四個小時的支出進行評估。Monthly budgets are evaluated against spending every four hours. 但是,已耗用的資源的資料和通知可在八小時內提供。However, data and notifications for consumed resources are available within eight hours.

當您在未來選取到期日時,預算會在期間 (每月、每季或每年) 結束時自動重設相同的預算金額。Budgets reset automatically at the end of a period (monthly, quarterly, or annually) for the same budget amount when you select an expiration date in the future. 因為它們會使用相同的預算金額重設,所以,在預算的貨幣金額與未來期間不同時您需要另外建立預算。Because they reset with the same budget amount, you need to create separate budgets when budgeted currency amounts differ for future periods.

此教學課程的範例會引導您針對 Azure Enterprise 合約 (EA) 訂用帳戶建立和編輯預算。The examples in this tutorial walk you through creating and editing a budget for an Azure Enterprise Agreement (EA) subscription.

監看式如何建立要監視您的消費使用 Azure 成本管理預算影片以了解如何建立預算,以及在 Azure 中監視消費。Watch the How to create a budget to monitor your spending with Azure Cost Management video to see how you can create budgets in Azure to monitor spending.

在本教學課程中,您了解如何:In this tutorial, you learn how to:

  • 在 Azure 入口網站中建立預算Create a budget in the Azure portal
  • 編輯預算Edit a budget

必要條件Prerequisites

預算功能支援各種不同的 Azure 帳戶類型。Budgets are supported for a variety of Azure account types. 若要檢視所支援帳戶類型的完整清單,請參閱了解成本管理資料To view the full list of supported account types, see Understand Cost Management data. 若要檢視預算,您至少需要 Azure 帳戶的讀取存取。To view budgets, you need at least read access for your Azure account.

針對 Azure EA 訂用帳戶,您必須具備檢視預算的讀取存取權。For Azure EA subscriptions, you must have read access to view budgets. 若要建立及管理預算,您必須具有參與者權限。To create and manage budgets, you must have contributor permission. 您可以個別為 EA 訂用帳戶和資源群組建立預算。You can create individual budgets for EA subscriptions and resource groups. 不過,您無法為 EA 帳單帳戶建立預算。However, you cannot create budgets for EA billing accounts.

依使用者和群組,會將下列的 Azure 權限或範圍,支援每個訂用帳戶的預算。The following Azure permissions, or scopes, are supported per subscription for budgets by user and group. 如需有關範圍的詳細資訊,請參閱了解並使用範圍For more information about scopes, see Understand and work with scopes.

  • 擁有者:可以建立、修改或刪除訂用帳戶的預算。Owner – Can create, modify, or delete budgets for a subscription.
  • 參與者和成本管理參與者 – 可以建立、修改或刪除他們自己的預算。Contributor and Cost Management contributor – Can create, modify, or delete their own budgets. 可以修改其他人所建立之預算的預算金額。Can modify the budget amount for budgets created by others.
  • 讀者和成本管理讀者 – 可以檢視他們有權限的預算。Reader and Cost Management reader – Can view budgets that they have permission to.

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

登入 AzureSign in to Azure

在 Azure 入口網站中建立預算Create a budget in the Azure portal

您可以針對每月、每季或每年期間建立 Azure 訂用帳戶預算。You can create an Azure subscription budget for a monthly, quarterly, or annual period. Azure 入口網站中瀏覽的內容會決定您是否建立訂用帳戶或管理群組的預算。Your navigational content in the Azure portal determines whether you create a budget for a subscription or for a management group.

若要建立或檢視的預算,開啟 在 Azure 入口網站,然後選取 所需的範圍內預算功能表中。To create or view a budget, open the desired scope in the Azure portal and select Budgets in the menu. 例如,瀏覽至訂用帳戶從清單中,選取訂用帳戶,然後選取預算功能表中。For example, navigate to Subscriptions, select a subscription from the list, and then select Budgets in the menu. 使用範圍丸切換到不同的範圍,管理群組,在預算等。Use the Scope pill to switch to a different scope, like a management group, in Budgets. 如需有關範圍的詳細資訊,請參閱了解並使用範圍For more information about scopes, see Understand and work with scopes.

建立預算之後,會針對它們顯示您目前費用的簡單檢視。After you create budgets, they show a simple view of your current spending against them.

按一下 [新增] 。Click Add.

在 Azure 入口網站中顯示的成本管理預算

在 [建立預算] 視窗中,輸入預算名稱和預算金額。In the Create budget window, enter a budget name and budget amount. 然後選擇每月、每季或每年持續期間。Then, choose either a monthly, quarterly, or annual duration period. 接下來,選取結束日期。Next, select an end date. 預算需要至少一個成本閾值 (預算的百分比) 與對應的電子郵件地址。Budgets require at least one cost threshold (% of budget) and a corresponding email address. 您可以選擇性地在單一預算中最多包含五個閾值與五個電子郵件地址。You can optionally include up to five thresholds and five email addresses in a single budget. 當達到預算閾值時,通常會在 8 小時內收到電子郵件通知。When a budget threshold is met, email notifications are normally received in less than eight hours. 如需有關通知的詳細資訊,請參閱使用成本警示For more information about notifications, see Use cost alerts.

如果您有隨用隨付、MSDN 或 Visual Studio 訂用帳戶,則您發票的計費期間可能與行事曆月份不同。If you have a Pay-As-You-Go, MSDN, or Visual Studio subscription, your invoice billing period might not align to the calendar month. 對於這些類型的訂用帳戶和資源群組中中,,您可以建立對齊預算發票期間或行事曆月。For those types of subscriptions and resource groups, you can create a budget that's aligned to your invoice period or to calendar months. 若要建立符合您的發票期間的預算,選取 重設時間計費月份、 計費季或年計費。To create a budget aligned to your invoice period, select a reset period of Billing month, Billing quarter or Billing year. 若要建立日曆月份調整預算,選取的重設期間的每月、 每季或每年。To create a budget aligned to the calendar month, select a reset period of Monthly, Quarterly or Annually.

以下是建立每月美金 $4,500 的預算範例。Here's an example of creating a monthly budget for $4,500. 達到預算的 90% 時,就會產生電子郵件警示。An email alert gets generated when 90% of the budget is reached.

[建立預算] 方塊中顯示的範例資訊

當您建立每季預算時,它的運作方式與與每月預算相同。When you create a quarterly budget, it works in the same way as a monthly budget. 差異在於當季預算金額會平均分配於當季的三個月。The difference is that the budget amount for the quarter is evenly divided among the three months of the quarter. 如您所預期的,每年預算金額會平均分配於該日曆年度的所有 12 個月。As you might expect, an annual budget amount is evenly divided among all 12 months of the calendar year.

每當成本管理接收到更新的計費資料時,即會對照預算來更新目前支出。Current spending against budgets is updated whenever Cost Management receives updated billing data. 通常是每日進行。Typically, daily.

顯示目前預算支出的範例資訊

建立預算之後,即會在成本分析中顯示它。After you create a budget, it is shown in cost analysis. 當您開始分析成本和費用時,首要步驟之一就是檢視與您費用趨勢相關的預算。Viewing your budget in relation to your spending trend is one of the first steps when you start to analyze your costs and spending.

成本分析中顯示的預算和支出範例

在上述範例中,您已針對訂用帳戶建立預算。In the preceding example, you created a budget for a subscription. 不過,您也可以針對資源群組建立預算。However, you can also create a budget for a resource group. 如果您想要針對資源群組建立預算,請瀏覽至[成本管理 + 計費] >[訂用帳戶] > 選取訂用帳戶 > [資源群組] > 選取資源群組 > [預算] > 然後新增預算。If you want to create a budget for a resource group, navigate to Cost Management + Billing > Subscriptions > select a subscription > Resource groups > select a resource group > Budgets > and then Add a budget.

編輯預算Edit a budget

根據您擁有的存取層級,您可以編輯預算來變更其屬性。Depending on the level of access that you have, you can edit a budget to change its properties. 在下列範例中,部分屬性是唯讀的,因為使用者只具備訂用帳戶的參與者權限。In the following example, some of the properties are read-only because the user has only Contributor permission to the subscription. 目前已停用 [到期日] ,而且一旦設定之後就無法修改。Currently, the Expiration date is disabled and can't be modified once set.

編輯預算以變更各種屬性的範例

觸發程序的動作群組Trigger an action group

當您建立或編輯訂用帳戶或資源群組範圍的預算時,您可以設定它來呼叫動作群組。When you create or edit a budget for a subscription or resource group scope, you can configure it to call an action group. 符合您預算臨界值時,動作群組可以執行各種不同的動作。The action group can perform a variety of different actions when your budget threshold is met. 如需有關動作群組的詳細資訊,請參閱 < 建立和管理 Azure 入口網站中的動作群組For more information about Action Groups, see Create and manage action groups in the Azure portal. 如需使用預算為基礎的自動化與動作群組的詳細資訊,請參閱使用 Azure 的預算管理成本For more information about using budget-based automation with action groups, see Manage costs with Azure budgets.

若要建立或更新動作群組,按一下管理動作群組而您要建立或編輯在預算。To create or update action groups, click Manage action groups while you're creating or editing a budget.

建立的預算,向管理動作群組的範例

接下來,按一下新增動作群組和建立動作群組。Next, click Add action group and create the action group.

新增動作群組中的映像

動作群組建立之後,關閉此方塊可返回您的預算。After the action group is created, close the box to return to your budget.

設定您的預算符合個別的臨界值時,請使用動作群組。Configure your budget to use your action group when an individual threshold is met. 最多五個不同的臨界值支援。Up to five different thresholds are supported.

顯示警示的條件的動作群組選取項目範例

下列範例顯示設定為 50%、 75%和 100%的預算臨界值。The following example shows budget thresholds set to 50%, 75% and 100%. 每個已設定為觸發程序在指定的動作群組內指定的動作。Each is configured to trigger the specified actions within the designated action group.

範例,示範使用各種不同的動作群組和動作的類型設定的警示狀況

後續步驟Next steps

在本教學課程中,您已了解如何:In this tutorial, you learned how to:

  • 在 Azure 入口網站中建立預算Create a budget in the Azure portal
  • 編輯預算Edit a budget

請前進到下一個教學課程,以建立成本管理資料的週期性匯出。Advance to the next tutorial to create a recurring export for your cost management data.