Azure Stack Hub 上的 Azure 应用服务计费概述和常见问题解答Azure App Service on Azure Stack Hub billing overview and FAQ

本文介绍 Azure 如何对提供 Azure Stack Hub 上的 Azure 应用服务的云运营商计费,以及云运营商如何对租户收取服务使用费。This article shows how cloud operators are billed for offering Azure App Service on Azure Stack Hub and how they can bill their tenants for using the service.

计费概述Billing overview

Azure Stack Hub 云运营商选择将 Azure Stack Hub 上的 Azure 应用服务部署在其 Azure Stack Hub 缩放单元上,以便为其客户提供 Azure 应用服务和 Azure Functions 的租户功能。Azure Stack Hub cloud operators choose to deploy Azure App Service on Azure Stack Hub onto their Azure Stack Hub stamp to offer the tenant capabilities of Azure App Service and Azure Functions to their customers. Azure 应用服务资源提供程序包括多个可划分为基础结构层或辅助角色层的角色。The Azure App Service resource provider consists of multiple types of roles that can be divided between infrastructure and worker tiers.

基础结构角色对于服务的核心操作是不可或缺的,因此不会产生费用。Infrastructure roles aren't billed because they're required for the core operation of the service. 可根据需要横向扩展基础结构角色,以支持云运营商租户的需求。Infrastructure roles can be scaled out as required to support the demands of the cloud operator's tenants. 基础结构角色包括:The infrastructure roles are as follows:

  • 控制器Controllers
  • 管理角色Management roles
  • 发布服务器Publishers
  • 前端Front ends

辅助角色层包括两种主要类型:共享和专用。Worker tiers consist of two main types: shared and dedicated. 辅助角色使用费将根据以下准则计入云运营商的默认提供商订阅帐户。Worker usage is billed to the cloud operator's default provider subscription according to the following criteria.

共享辅助角色Shared workers

共享辅助角色是多租户、无主机的共享应用服务计划和基于消耗量的 Azure Functions,可供许多租户使用。Shared workers are multi-tenant and host free and shared App Service plans and consumption-based Azure functions for many tenants. 共享辅助角色在 Azure 应用服务资源提供程序中标记为就绪时,将发出用量指标。Shared workers emit usage meters when marked as ready in the Azure App Service resource provider.

专用辅助角色Dedicated workers

专用辅助角色绑定到租户创建的应用服务计划。Dedicated workers are tied to the App Service plans that tenants create. 例如,在 S1 SKU 中,租户默认可以扩展到 10 个实例。For example, in the S1 SKU, tenants can scale to 10 instances by default. 当租户创建 S1 应用服务计划时,Azure 应用服务会将小型辅助角色层规模集中的一个实例分配到该租户的应用服务计划。When a tenant creates an S1 App Service plan, Azure App Service allocates one of the instances in the small worker tier scale set to that tenant's App Service plan. 然后,分配的辅助角色不再可以分配到其他任何租户。The assigned worker is then no longer available to be assigned to any other tenants. 如果租户选择将应用服务计划扩展到 10 个实例,则会进一步从可用池中删除 9 个辅助角色,并将其分配到租户的应用服务计划。If the tenant chooses to scale the App Service plan to 10 instances, nine more workers are removed from the available pool and are assigned to the tenant's App Service plan.

专用辅助角色在以下情况下发出指标:Meters are emitted for dedicated workers when they're:

  • 在 Azure 应用服务资源提供程序中标记为就绪。Marked as ready in the Azure App Service resource provider.
  • 已分配到应用服务计划。Assigned to an App Service plan.

这种计费模式可让云运营商预配随时可供客户使用的专用辅助角色池,并且可等到租户的应用服务计划有效预留辅助角色之后,再支付辅助角色的费用。This billing model lets cloud operators provision a pool of dedicated workers ready for customers to use without paying for the workers until they're effectively reserved by their tenant's App Service plan.

例如,假设你的小型辅助角色层中包含 20 个辅助角色。For example, say you have 20 workers in the small worker tier. 随后有 5 个客户各创建了两个 S1 应用服务计划,且分别将应用服务计划扩展到两个实例,则你没有可用的辅助角色。Then if you have five customers that create two S1 App Service plans each, and they each scale the App Service plan up to two instances, you have no workers available. 因此,任何现有客户或新客户也没有足够的容量可扩展或创建新的应用服务计划。As a result, there's also no capacity for any of your customers or new customers to scale out or create new App Service plans.

云运营商可以在 Azure Stack Hub 管理界面的 Azure 应用服务配置中查看辅助角色层,以查看每个辅助角色层当前可用的辅助角色数目。Cloud operators can view the current number of available workers per worker tier by looking at the worker tiers in the Azure App Service configuration on Azure Stack Hub administration.

应用服务 - 辅助角色层屏幕

使用 Azure Stack Hub 用量服务查看客户的用量See customer usage by using the Azure Stack Hub usage service

云运营商可以查询 Azure Stack Hub 租户资源用量 API 以检索客户的用量信息。Cloud operators can query the Azure Stack Hub Tenant Resource Usage API to retrieve usage information for their customers. 可以在使用情况常见问题解答中,找到应用服务发出的用于描述租户用量的每个指标。You can find all of the individual meters that App Service emits to describe tenant usage in the Usage FAQ. 然后,这些指标将用于计算每个客户订阅的用量,以计算费用。These meters then are used to calculate the usage per customer subscription to calculate charges.

常见问题Frequently asked questions

如何为先决条件中所需的 SQL Server 和文件服务器基础结构授权?How do I license the SQL Server and file server infrastructure required in the prerequisites?

此文介绍了如何为 Azure 应用服务资源提供程序所需的 SQL Server 和文件服务器基础结构授权:在 Azure Stack Hub 上部署应用服务的先决条件Licensing for SQL Server and file server infrastructure, required by the Azure App Service resource provider, is covered here: Prerequisites for deploying App Service on Azure Stack Hub.

“使用情况常见问题解答”列出了租户计量,但未列出这些计量的价格。The usage FAQ lists the tenant meters but not the prices for those meters. 在哪里可以找到这些信息?Where can I find them?

云运营商可以任意对客户应用自己的定价模型。As a cloud operator, you're free to apply your own pricing model to your customers. 使用情况服务将提供用量计量值。The usage service provides the usage metering. 你可以使用计量数量根据确定的定价模型向客户收费。You can then use the meter quantity to charge your customers based on the pricing model you determine. 自行定价可让不同的 Azure Stack Hub 运营商各自保留独特之处。The ability to set pricing enables operators to differentiate from other Azure Stack Hub operators.

身为 CSP,我要如何提供免费和共享的 SKU 让客户试用服务?As a CSP, how can I offer free and shared SKUs for customers to try out the service?

云运营商提供免费和共享的 SKU 会产生费用,由于这些 SKU 托管在共享的辅助角色中。As a cloud operator, you incur costs for offering free and shared SKUs because they're hosted in shared workers. 若要尽量降低成本,可以选择将共享辅助角色层缩减到最低限度。To minimize that cost, you can choose to scale down the shared worker tier to a bare minimum.


对于新安装,Azure Stack Hub(2020 年第二季度)上 Azure 应用服务中共享辅助角色的安装程序默认设置已更改。The installer defaults for Shared Workers were changed in Azure App Service on Azure Stack Hub 2020.Q2 for new installations. 默认情况下,共享辅助角色使用 A4_v2 计算 SKU 进行预配,操作员可以在安装时或安装后对其进行更改。By default Shared Workers are provisioned using the A4_v2 compute SKU which can be changed by the operator at installation time or post install.

例如,若要提供免费和共享的应用服务计划 SKU,并提供基于用量的功能,至少需要 1 个可用的 A1 实例。For example, to offer free and shared App Service plan SKUs and to offer consumption-based functions, you need a minimum of one A1 instance available. 共享辅助角色是多租户的,因此可以托管多个客户应用,每个应用独立且受应用服务沙盒保护。Shared workers are multi-tenant, so they can host multiple customer apps, each individually isolated and protected by the App Service sandbox. 以这种方式缩放共享的辅助角色层,可将支出限制为每月 1 个 vCPU 的成本。By scaling the shared worker tier in this way, you can limit your outlay to the cost of one vCPU per month.

然后,可以选择创建要在计划中使用的配额,此计划只提供免费和共享 SKU,并且限制客户可以创建的免费和共享应用服务计划数。You can then choose to create a quota for use in a plan, which only offers free and shared SKUs and limits the number of free and shared App Service plans your customer can create.

用于帮助计费的脚本示例Sample scripts to assist with billing

Azure 应用服务团队创建了 PowerShell 脚本示例,以帮助客户查询 Azure Stack Hub 使用情况服务。The Azure App Service team created sample PowerShell scripts to assist with querying the Azure Stack Hub usage service. 云运营商可以使用这些示例脚本为租户准备计费。Cloud operators can use these sample scripts to prepare their own billing for their tenants. 示例脚本位于 GitHub 上的 Azure Stack Hub 工具存储库中。The sample scripts are in the Azure Stack Hub Tools repository in GitHub. 应用服务脚本位于 Usage 下的 AppService 文件夹中。The App Service scripts are in the AppService folder under Usage.

可用的脚本示例如下:The sample scripts available are:

  • Get-AppServiceBillingRecords:此示例从 Azure Stack Hub 用量 API 提取 Azure Stack Hub 上的 Azure 应用服务计费记录。Get-AppServiceBillingRecords: This sample fetches Azure App Service on Azure Stack Hub billing records from the Azure Stack Hub Usage API.
  • Get-AppServiceSubscriptionUsage:此示例计算每个订阅的 Azure Stack Hub 上的 Azure 应用服务用量金额。Get-AppServiceSubscriptionUsage: This sample calculates Azure App Service on Azure Stack Hub usage amounts per subscription. 此脚本根据用量 API 中的数据和云运营商对每种计量所提供的价格,计算用量金额。This script calculates usage amounts based on data from the Usage API and the prices provided per meter by the cloud operator.
  • Suspend-UserSubscriptions:此示例根据云运营商指定的用量限制来暂停或启用订阅。Suspend-UserSubscriptions: This sample suspends or enables subscriptions based on usage limits specified by the cloud operator.

后续步骤Next steps