您现在访问的是微软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 spend. 定价计算器可在创建 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 美元

设置计费警报Set up billing alerts

设置计费警报,以便在使用费用超过指定金额时收到电子邮件。Set up billing alerts to get emails when your usage costs exceed an amount that you specify. 如果有每月信用额度,设置在达到指定金额时发出警报。If you have monthly credits, set up alerts for when you use up a specified amount. 有关详细信息,请参阅为 Microsoft Azure 订阅设置计费警报For more information, see Set up billing alerts for your Microsoft Azure subscriptions.

计费警报电子邮件的屏幕截图

备注

此功能仍处于预览阶段,因此请定期查看使用情况。This feature is still in preview so you should check your usage regularly.

设置第一个警报时,建议以定价计算器中的成本预估为准。You might want to use the cost estimate from the pricing calculator as a guideline for your first alert.

检查支出限制是否为开启状态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.

使用 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 blade in Azure portal and select a subscription.

  2. 应该在弹出边栏选项卡中查看成本明细和消耗率。You should see the cost breakdown and burn rate in the popup blade. 产品/服务可能不支持此项(此时会在顶部附近显示一条警告)。It may not be supported for your offer (a warning would be displayed near the top).

    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 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 daily spend history and how much the resource costs each day.

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

建议对比选择服务时看到的预计值查看现在的费用。We recommend that you check the costs you see with the estimates you saw when you selected the services. 如果成本和预计值相差很大,请再次查看之前为资源选择的定价计划(例如 A1 或 A0 VM)。If the costs wildly differ from estimates, double check the pricing plan (A1 vs A0 VM, for example) 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 could 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 preview feature that helps you reduce costs by identifying resources with low usage. 在 Azure 门户中打开它:Turn it on 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 do not account for prepaid amounts, overages, included quantities, adjustments, and taxes. 实际费用按注册级计算。Actual charges are computed at the Enrollment level.
  • 与企业门户中的值相比,Azure 门户中显示的数量可能会存在延迟。Amounts displayed within the Azure portal might be delayed compared to values in the Enterprise portal.
  • 如果未看见费用,可能是以下几种原因之一所致:If you are not seeing costs, it might be due to one of the following reasons:
    • 你在订阅级别的 RBAC 权限不足。You don't have enough RBAC permission 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 are 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 are a Department Administrator and your Enrollment Administrator has disabled the "DA view charges" setting. 请联系注册管理员以获取访问权限。Contact your Enrollment Administrator to gain access.
    • 是通过一个通道合作伙伴购买的 Azure,而该合作伙伴尚未发布定价信息。You purchased Azure through a channel partner, and the partner has not released pricing information.
  • 与费用访问相关的设置在企业门户中更新后,Azure 门户几分钟后才会反映相应更改。When settings related to cost access are updated within the Enterprise portal, there is a delay of a few minutes before the changes are reflected in the Azure portal.
  • 支出限制、帐单警报和发票指南不适用于 EA 订阅。Spending limit, billing alerts, and invoice guidance do not pertain to EA Subscriptions.

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

查看成本需要对计费信息具有订阅级别访问权限,但只有帐户管理员可以访问帐户中心、更改计费信息和管理订阅。Viewing costs require subscriptions-level access to billing information, but only the Account admin can access the Account Center, change billing info, 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 the Subscriptions blade in the Azure portal and 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 via Azure Active Directory Role-based Access Control (RBAC). 要管理订阅和更改计费信息,请查找帐户管理员,请其执行该任务或请其将订阅转交给你To manage subscriptions and change billing info, find the Account admin and ask them to perform 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 support.

需要帮助?Need help? 联系支持人员Contact support

如果需要帮助,请联系支持人员以快速解决问题。If you need help, contact support to get your issue resolved quickly.