您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

通过 Azure 计费和成本管理来防止意外费用Prevent unexpected charges with Azure billing and cost management

当注册 azure 时,有的支出更好地了解您可以做几件事情。When you sign up for Azure, there are several things you can do to get a better idea of your spending. 定价计算器可在创建 Azure 资源之前提供成本估计。The pricing calculator can provide an estimate of costs before you create an Azure resource. Azure 门户可提供订阅的当前成本细分和预测。The Azure portal provides you with the current cost breakdown and forecast for your subscription. 如果要对不同项目或团队的成本进行分组和了解,请查看资源标记If you want to group and understand costs for different projects or teams, look at resource tagging. 如果组织有希望使用的报告系统,请查看计费 APIIf your organization has a reporting system that you prefer to use, check out the billing APIs.

在添加 Azure 服务之前获取估计成本Get estimated costs before adding Azure services

使用定价计算器在线估计成本Estimate cost online using the pricing calculator

查看定价计算器,获取感兴趣的服务的每月估计成本。Check out the pricing calculator to get an estimated monthly cost of the service you're interested in. 可以添加任何第一方 Azure 资源,以获取估计成本。You can add any first party Azure resource to get an estimate cost.

定价计算器菜单的屏幕截图

例如,如果 A1 Windows 虚拟机 (VM) 保持一直运行,则其计算小时数预计花费 66.96 美元/月:For example, an A1 Windows Virtual Machine (VM) is estimated to cost $66.96 USD/month in compute hours if you leave it running the whole time:

定价计算器的屏幕截图,图中 A1 Windows VM 预计每月花费 66.96 美元

有关定价的详细信息,请参阅此常见问题解答For more information on pricing, see this FAQ. 或者,如果想要与 Azure 销售人员进行交流,请联系 1-800-867-1389。Or if you want to talk to an Azure salesperson, contact 1-800-867-1389.

在 Azure 门户中查看估计成本Review the estimated cost in the Azure portal

通常情况下,在 Azure 门户中添加服务时,会出现一个视图显示大概的每月预计成本。Typically when you add a service in the Azure portal, there's a view that shows you a similar estimated cost per month. 例如,选择 Windows VM 的大小时,可看到计算小时数的每月估计成本:For example, when you choose the size of your Windows VM, you see the estimated monthly cost for the compute hours:

示例:一台 A1 Windows VM 预计每月花费 66.96 美元

检查支出限制是否为开启状态Check if you have a spending limit on

如果有使用信用额度的订阅,则将默认开启支出限制。If you have a subscription that uses credits, then the spending limit is turned on for you by default. 这样一来,当信用额度花完时,不再对信用卡计费。This way, when you spend all your credits, your credit card doesn't get charged. 请参阅 Azure 产品/服务以及支出限制可用性的完整列表See the full list of Azure offers and the availability of spending limit.

但是,在达到支出限制时,服务会被禁用。However, if you hit your spending limit, your services get disabled. 这意味着 VM 会被解除分配。That means your VMs are deallocated. 若要避免服务中断,必须关闭支出限制。To avoid service downtime, you must turn off the spending limit. 任何超额都将对保存的信用卡收费。Any overage gets charged onto your credit card on file.

若要查看支出限制是否为开启状态,请转到帐户中心的订阅视图To see if you've got spending limit on, go to the Subscriptions view in the Account Center. 如果支出限制为开启状态,会显示以下标题:A banner appears if your spending limit is on:

帐户中心中,显示支出限制为开启状态的警告信息的屏幕截图

单击该标题,并按照提示移除支出限制。Click the banner and follow prompts to remove the spending limit. 如果注册时未输入信用卡信息,则必须输入信息才能移除支出限制。If you didn't enter credit card information when you signed up, you must enter it to remove the spending limit. 有关详细信息,请参阅 Azure 支出限制 - 其工作原理以及如何将其启用或移除For more information, see Azure spending limit – How it works and how to enable or remove it.

可以使用 Cloudyn 服务创建警报,自动通知利益干系人支出异常和超支风险。You can use the Cloudyn service to create alerts that automatically notify stakeholders of spending anomalies and overspending risks. 可以使用支持基于预算和成本阈值的警报的报表创建警报。You can create alerts using reports that support alerts based on budget and cost thresholds. 有关使用 Cloudyn 的更多信息,请参阅教程:查看使用情况和成本For more information on using Cloudyn, see Tutorial: Review usage and costs.

当你在 Azure VM 上的支出接近总预算时,此示例使用“一段时间的实际成本”报表来发送通知 。This example uses the Actual Cost Over Time report to send a notification when your spending on an Azure VM nears your total budget. 在此场景中,你的总预算为 20,000 美元,你希望在成本接近预算的一半(9,000 美元)时收到通知,在成本为 10,000 美元时再次收到警报。In this scenario, you have a total budget of $20,000 and you want to receive a notification when costs are approaching half of your budget, $9,000, and an additional alert when costs reach $10,000.

  1. 在 Cloudyn 门户顶部的菜单中,选择“成本” > “成本分析” > “时段实际成本” 。From the menu at the top of the Cloudyn portal, select Costs > Cost Analysis > Actual Cost Over Time.

  2. 将“组” 设置为“服务” ,并将“按服务筛选” 设置为“Azure/VM” 。Set Groups to Service and set Filter on the service to Azure/VM.

  3. 在报表的右上角,选择“操作”,然后选择“计划报表” 。In the top right of the report, select Actions and then select Schedule report.

  4. 若要按计划的时间间隔向自己发送有关报表的电子邮件,请在“保存或计划此报表”对话框中选择“计划”选项卡。 To send yourself an email of the report at scheduled interval, select the Scheduling tab in the Save or Schedule this report dialog. 请务必选择“通过电子邮件发送” 。Be sure to select Send via email. 你使用的任何标记、分组和筛选均包含在通过电子邮件发送的报表中。Any tags, grouping, and filtering you use are included in the emailed report.

  5. 选择“阈值”选项卡,然后选择“实际成本与阈值” 。Select the Threshold tab and then select Actual Cost vs. Threshold.

    1. 在“红色警报”阈值框中,输入 10000。 In the Red alert threshold box enter 10000.
    2. 在“黄色警报”阈值框中,输入 9000。 In the Yellow alert threshold box enter 9000.
    3. 在“连续警报数”框中,输入要接收的连续警报的数目。 In the Number of consecutive alerts box, enter the number of consecutive alerts to receive. 当你收到的警报总数达到指定数目时,就不会再发送任何其他警报。When you receive the total number of alerts that you specified, no additional alerts are sent.
  6. 选择“保存”。 Select Save.

    基于支出阈值显示红色和黄色警报的示例

还可以选择“成本百分比与预算”阈值指标来创建警报。 You can also choose the Cost Percentage vs. Budget threshold metric to create alerts. 这样就可以将阈值指定为预算的百分比而不是货币值。This allows you to specify the thresholds as percentages of your budget instead of currency values.

使用 Azure 服务时监视成本的方法Ways to monitor your costs when using Azure services

对资源添加标记以便对计费数据进行分组Add tags to your resources to group your billing data

可以使用标记来对受支持服务的计费数据进行分组。You can use tags to group billing data for supported services. 例如,当运行不同团队的多个 VM 时,则可以使用标记按成本中心(人力资源、市场营销、财务)或环境(生产,预生产、测试)对成本进行分类。For example, if you run several VMs for different teams, then you can use tags to categorize costs by cost center (HR, marketing, finance) or environment (production, pre-production, test).

显示在门户中设置标记的屏幕截图

各标记显示了完全不同的成本报告视图。The tags show up throughout different cost reporting views. 例如,在成本分析视图中可立即查看,而在详细使用情况 .csv 中则需在第一个计费期之后才能查看。For example, they're visible in your cost analysis view right away and detail usage .csv after your first billing period.

有关详细信息,请参阅使用标记来组织 Azure 资源For more information, see Using tags to organize your Azure resources.

定期查看门户中的成本明细和消耗率Regularly check the portal for cost breakdown and burn rate

服务开始运行后,请定期查看其费用。After you get your services running, regularly check how much they're costing you. 可在 Azure 门户中查看当前费用和消耗率。You can see the current spend and burn rate in Azure portal.

  1. 访问 Azure 门户中的“订阅”并选择一个订阅。Visit the Subscriptions in the Azure portal and select a subscription.

  2. 如果你的订阅支持该功能,则可以查看成本明细和消耗率。If it's supported for your subscription, you see the cost breakdown and burn rate.

    Azure 门户中消耗率和明细的屏幕截图

  3. 将列表中的“成本分析” 单击到左侧,以便按资源查看成本明细。Click Cost analysis in the list to the left to see the cost breakdown by resource. 添加服务后请等待 24 小时让数据进行填充。Wait 24 hours after you add a service for the data to populate.

    Azure 门户中成本分析视图的屏幕截图

  4. 可按标记、资源类型、资源组和时间跨度等不同的属性进行筛选。You can filter by different properties like tags, resource type, resource group, and timespan. 单击“应用” 确认筛选条件,如果想要将视图导出为逗号分隔值 (.csv) 文件,请单击“下载” 。Click Apply to confirm the filters and Download if you want to export the view to a Comma-Separated Values (.csv) file.

  5. 此外,还可以单击资源,查看每日费用历史记录以及每天的资源成本。Additionally, you can click a resource to see your daily spend history and how much the resource costs each day.

    Azure 门户中费用历史记录视图的屏幕截图

建议将你看到的成本与你之前选择了服务时看到的估计值进行对比。We recommend you check the costs you see with the estimates you saw when you selected the services. 如果成本和估计值相差很大,请再次查看之前为资源选择的定价计划。If the costs are wildly different from the estimates, double check the pricing plan that you've selected for your resources.

对于 VM,建议启用自动关闭等降低成本的功能Consider enabling cost-cutting features like auto shutdown for VMs

可在 Azure 门户中为 VM 配置自动关闭,具体视方案而定。Depending on your scenario, you can configure auto shutdown for your VMs in the Azure portal. 有关详细信息,请参阅使用 Azure 资源管理器为 VM 设置自动关闭功能For more information, see Auto shutdown for VMs using Azure Resource Manager.

门户中的自动关闭选项的屏幕截图

自动关闭与在 VM 中使用电源选项进行关闭不同。Auto shutdown isn't the same as when you shut down within the VM with power options. 自动关闭会停止并解除分配 VM,以便停止额外的使用费。Auto shutdown stops and deallocates your VMs to stop additional usage charges. 有关详细信息,请参阅 Linux VMWindows VM 有关 VM 状态的定价常见问题解答。For more information, see pricing FAQ for Linux VMs and Windows VMs about VM states.

有关开发和测试环境的更多降低成本功能,请参阅 Azure 开发测试实验室For more cost-cutting features for your development and test environments, check out Azure DevTest Labs.

打开和查看 Azure 顾问建议Turn on and check out Azure Advisor recommendations

Azure 顾问是一项功能,通过识别很少使用的资源来帮助降低成本。Azure Advisor is a feature that helps you reduce costs by identifying resources with low usage. 在 Azure 门户访问顾问:Visit Advisor in the Azure portal:

Azure 门户中的 Azure 顾问按钮的屏幕截图

然后可在顾问仪表板的“成本” 选项卡中获取可行性建议:Then, you can get actionable recommendations in the Cost tab in the Advisor dashboard:

顾问成本建议示例的屏幕截图

有关详细信息,请参阅顾问成本建议For more information, see Advisor Cost recommendations.

在计费周期结束时查看成本Reviewing costs at the end of your billing cycle

在计费周期结束后,发票将变为可用。After the end of your billing cycle, your invoice will become available. 还可以下载过去的发票和详细使用情况文件,确保收费正确。You can also download past invoices and detail usage files to make sure you were charged correctly. 有关比较每日使用情况和发票的详细信息,请参阅了解 Microsoft Azure 帐单For more information about comparing your daily usage with your invoice, see Understand your bill for Microsoft Azure.

计费 APIBilling API

使用计费 API 以编程方式获取使用情况数据。Use our billing API to programmatically get usage data. 同时使用 RateCard API 和使用情况 API 获取计费使用情况。Use the RateCard API and the Usage API together to get your billed usage. 有关详细信息,请参阅深入了解 Microsoft Azure 资源消耗For more information, see Gain insights into your Microsoft Azure resource consumption.

其他资源和特殊情况Additional resources and special cases

EA、CSP 和赞助客户EA, CSP, and Sponsorship customers

请咨询帐户管理员或 Azure 合作伙伴以开始使用。Talk to your account manager or Azure partner to get started.

产品/服务Offer 资源Resources
企业协议 (EA)Enterprise Agreement (EA) EA 门户帮助文档 Power BI 报表EA portal, help docs, and Power BI report
云解决方案提供商 (CSP)Cloud Solution Provider (CSP) 咨询提供商Talk to your provider
Azure 赞助Azure Sponsorship 赞助门户Sponsorship portal

如果管理大型组织的 IT,建议阅读 Azure 企业基架企业 IT 白皮书(.pdf 下载,仅英文版)。If you're managing IT for a large organization, we recommend reading Azure enterprise scaffold and the enterprise IT white paper (.pdf download, English only).

在 Azure 门户中预览“企业协议”成本视图Preview Enterprise Agreement cost views within Azure portal

企业成本视图目前为公共预览版。Enterprise cost views are currently in Public Preview. 注意事项:Items to note:

  • 订阅费用基于使用情况,并且不包括预付金额、超额用量、已包含数量、调整和税。Subscription costs are based on usage and don't include prepaid amounts, overages, included quantities, adjustments, and taxes. 实际费用按注册级计算。Actual charges are computed at the Enrollment level.
  • Azure 门户中显示的金额可能不同于企业门户中显示的金额。Amounts shown in the Azure portal might be different than what's in the Enterprise portal. 企业门户中的更新可能要花费几分钟时间来完成,之后,更改才会显示在 Azure 门户中。Updates in the Enterprise portal may take a few minutes before the changes are shown in the Azure portal.
  • 如果未看到成本,可能是以下几种原因之一所致:If you aren't seeing costs, it might be for one of the following reasons:
    • 你在订阅级别没有权限。You don't have permissions at the subscription level. 若要查看企业成本视图,必须在订阅级别是账单读者、读者、参与者或所有者。To see enterprise cost views, you must be a Billing Reader, Reader, Contributor, or Owner at the subscription level.
    • 你是帐户所有者且你的注册管理员已禁用“AO 查看费用”设置。You're an Account Owner and your Enrollment Administrator has disabled the "AO view charges" setting. 请联系你的注册管理员以获取费用访问权限。Contact your Enrollment Administrator to get access to costs.
    • 你是部门管理员且你的注册管理员已禁用“DA 查看费用”设置。You're a Department Administrator and your Enrollment Administrator has disabled the "DA view charges" setting. 联系你的注册管理员以获取访问权限。Contact your Enrollment Administrator to get access.
    • 你是从某个渠道合作伙伴购买的 Azure,而该合作伙伴未发布定价信息。You bought Azure through a channel partner, and the partner didn't release pricing information.
  • 如果你在企业门户中更新与成本访问相关的设置,则更改过几分钟后才会显示在 Azure 门户中。If you update settings related to cost access in the Enterprise portal, there's a delay of a few minutes before the changes are shown in the Azure portal.
  • 支出限制和发票指南不适用于 EA 订阅。Spending limit, and invoice guidance don't apply to EA Subscriptions.

查看订阅和访问权限Check your subscription and access

若要查看成本,必须具有对计费信息的订阅级访问权限To view costs, you must have subscriptions-level access to billing information. 只有帐户管理员可以访问帐户中心、更改计费信息以及管理订阅。Only the Account Admin can access the Account Center, change billing information, and manage subscriptions. 帐户管理员是完成注册过程的人员。The Account Admin is the person who went through the sign-up process. 有关详细信息,请参阅添加或更改管理订阅或服务的 Azure 管理员角色For more information, see Add or change Azure administrator roles that manage the subscription or services.

若要查看你是否为帐户管理员,请转到 Azure 门户中的“订阅”To see if you're the Account admin, go to Subscriptions in the Azure portal. 查看你有权访问的订阅的列表。Look at the list of subscriptions you have access to. 在“我的角色” 下查看。Look under My role. 如果显示帐户管理员,则可以进行操作。If it says Account admin, then you're ok. 如果显示所有者 等其他信息,则表示没有完全权限。If it says something else like Owner, then you don't have full privileges.

Azure 门户中订阅视图中的角色的屏幕截图

如果你不是帐户管理员,则某人也许可以使用 Azure Active Directory 基于角色的访问控制 (RBAC) 向你授予部分访问权限。If you're not the Account admin, then somebody probably gave you partial access by using Azure Active Directory Role-based Access Control (RBAC). 若要管理订阅以及更改计费信息,请查找帐户管理员。请求帐户管理员来执行任务,或者将订阅转让给你To manage subscriptions and change billing info, find the Account Admin. Ask the Account Admin to do the tasks or transfer the subscription to you.

当帐户管理员不再属于组织,并且需要管理帐单时,请联系我们If your Account admin is no longer with your organization and you need to manage billing, contact us.

如何请求服务事件的服务级别协议信用额度How to request a Service Level Agreement credit for a service incident

服务级别协议 (SLA) 描述 Microsoft 关于运行时间和连接性方面的承诺。The Service Level Agreement (SLA) describes Microsoft’s commitments for uptime and connectivity. Azure 服务的影响正常运行时间或连接,通常称为"中断"。 遇到的问题时,会报告服务事件A service incident is reported when Azure services experience an issue that impacts uptime or connectivity, often referred to as an “outage.” 如果我们不是实现 SLA 中所述为每个服务维护服务级别,然后你可能符合用于你的每月服务费用的一部分的信用额度。If we do not achieve and maintain the Service Levels for each Service as described in the SLA, then you might be eligible for a credit towards a portion of your monthly service fees.

若要请求信用额度:To request a credit:

  1. 登录到 Azure 门户Sign in to the Azure portal. 如果有多个帐户,请确保您使用一个受 Azure 停机时间。If you have multiple accounts, make sure that you use the one that was affected by Azure downtime. 这有助于支持自动收集必要的背景信息和更快地解决这种情况。This helps Support automatically collect the necessary background information and resolve the case faster.
  2. 创建新的支持请求。Create a new support request.
  3. 问题类型,选择计费Under Issue type, select Billing.
  4. 问题类型,选择退款请求Under Problem type, select Refund Request.
  5. 添加详细信息,以指定你要让 for SLA 信用额度,提到日期/时间/时区,以及受影响的服务 (如 Vm、 网站等)。Add details to specify that you’re asking for an SLA credit, mention the date/time/time-zone as well as the impacted services (VMs, Web Sites, etc.)
  6. 验证你的联系人详细信息,并选择创建按钮以提交你的请求。Verify your contact details and select the Create button to submit your request.

SLA 阈值因服务而异。SLA thresholds vary by service. 例如,SQL Web 层提供 99.9%的 SLA、 虚拟机具有 99.95%的 SLA 和 SQL 标准层提供 99.99%的 SLA。For example, SQL Web Tier has an SLA of 99.9%, VMs have an SLA of 99.95%, and SQL Standard Tier has an SLA of 99.99%.

对于某些服务,没有要应用的 SLA 的先决条件。For some services, there are prerequisites for the SLA to apply. 例如,虚拟机必须具有同一可用性集中部署两个或多个实例。For example, Virtual Machines must have two or more instances deployed in the same Availability Set.

有关详细信息,请参阅服务级别协议文档并的 Azure 服务的 SLA 摘要文档。For more information, see the Service Level Agreements documentation and the SLA summary for Azure services documentation.

需要帮助?Need help? 请联系我们。Contact us.

如果有疑问或需要帮助,请创建支持请求If you have questions or need help, create a support request.