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

配置应用服务环境 v1Configuring an App Service Environment v1

备注

本文介绍应用服务环境 v1。This article is about the App Service Environment v1. 应用服务环境有一个较新版本,此版本更易于使用并在更强大的基础结构上运行。There is a newer version of the App Service Environment that is easier to use and runs on more powerful infrastructure. 若要深入了解新版本,请先参阅应用服务环境简介To learn more about the new version start with the Introduction to the App Service Environment.

概述Overview

高级别 Azure 应用服务环境包括几个主要组件:At a high level, an Azure App Service Environment consists of several major components:

  • 在应用服务环境托管服务中运行的计算资源Compute resources that are running in the App Service Environment hosted service
  • 存储Storage
  • 数据库A database
  • 经典 (V1) 或 Resource Manager(V2) Azure 虚拟网络 (VNet)A Classic(V1) or Resource Manager(V2) Azure Virtual Network (VNet)
  • 内部运行应用服务环境托管服务的子网A subnet with the App Service Environment hosted service running in it

计算资源Compute resources

可以将计算资源用于四个资源池。You use the compute resources for your four resource pools. 每个应用服务环境 (ASE) 都有一组前端和三个可能的工作节点池。Each App Service Environment (ASE) has a set of front ends and three possible worker pools. 不需要三个辅助角色池都使用,如果需要,可以只使用其中一个或两个。You don't need to use all three worker pools--if you want, you can just use one or two.

租户无法直接访问资源池(前端和辅助角色)中的主机。The hosts in the resource pools (front ends and workers) are not directly accessible to tenants. 无法使用远程桌面协议 (RDP) 来连接它们、更改其预配,或充当其管理员。You can't use Remote Desktop Protocol (RDP) to connect to them, change their provisioning, or act as an admin on them.

但是可以设置资源池的数量和大小。You can set resource pool quantity and size. 在 ASE 中,有四个大小选项,标记为 P1 到 P4。In an ASE, you have four size options, which are labeled P1 through P4. 有关这些大小及其定价的详细信息,请参阅应用服务定价For details about those sizes and their pricing, see App Service pricing. 更改数量或大小的操作称为缩放操作。Changing the quantity or size is called a scale operation. 一次只能执行一项缩放操作。Only one scale operation can be in progress at a time.

前端:前端是保留在 ASE 中的应用的 HTTP/HTTPS 终结点。Front ends: The front ends are the HTTP/HTTPS endpoints for your apps that are held in your ASE. 不能在前端运行工作负荷。You don't run workloads in the front ends.

  • ASE 以两个 P2 开始,这对于开发/测试工作负荷和低级生产工作负荷而言已经足够。An ASE starts with two P2s, which is sufficient for dev/test workloads and low-level production workloads. 强烈建议针对中型到重型生产工作负荷使用 P3。We strongly recommend P3s for moderate to heavy production workloads.
  • 对于中型到重型生产工作负荷,建议至少有四个 P3,以确保在计划的维护开始运行时有足够的前端在运行。For moderate to heavy production workloads, we recommend that you have at least four P3s to ensure there are sufficient front ends running when scheduled maintenance occurs. 计划的维护活动一次会关闭一个前端。Scheduled maintenance activities will bring down one front end at a time. 这会减少维护活动期间可用的前端总容量。This reduces overall available front-end capacity during maintenance activities.
  • 前端预配可能需要多达一小时。Front ends can take up to an hour to provision.
  • 要进一步微调,应监视前端池的 CPU 百分比、内存百分比和活动请求等度量值。For further scale fine-tuning, you should monitor the CPU percentage, Memory percentage and Active Requests metrics for the front-end pool. 如果运行 P3 时 CPU 或内存百分比超出 70%,请添加更多前端。If the CPU or Memory percentages are above 70 percent when running P3s, add more front ends. 如果每个前端的活动请求数目平均达到 15,000 到 20,000 个请求,也应该添加更多前端。If the Active Requests value averages out to 15,000 to 20,000 requests per front end, you should also add more front ends. 总体目标是在运行 P3 时,将 CPU 和内存百分比维持在 70% 以下,将每个前端的活动请求平均数维持在 15,000 个请求以下。The overall goal is to keep CPU and Memory percentages below 70%, and Active Requests averaging out to below 15,000 requests per front end when you're running P3s.

辅助角色:辅助角色是实际运行应用的位置。Workers: The workers are where your apps actually run. 增加应用服务计划时,将用尽关联辅助角色池中的辅助角色。When you scale up your App Service plans, that uses up workers in the associated worker pool.

  • 无法立即添加辅助角色。You cannot instantly add workers. 其预配可能需要多达一小时。They may take up to an hour to provision.
  • 缩放任何池的计算资源大小时,每个更新域都需要将近 1 小时来完成缩放。Scaling the size of a compute resource for any pool will take < 1 hour per update domain. ASE 中有 20 个更新域。There are 20 update domains in an ASE. 如果缩放包含 10 个实例的辅助角色池的计算大小,可能需要多达 10 小时才能完成。If you scaled the compute size of a worker pool with 10 instances, it could take up to 10 hours to complete.
  • 如果更改辅助角色池中所用计算资源的大小,将导致在该辅助角色池中运行的应用冷启动。If you change the size of the compute resources that are used in a worker pool, you will cause cold starts of the apps that are running in that worker pool.

更改未运行任何应用的辅助角色池的计算资源大小的最快捷方式是:The fastest way to change the compute resource size of a worker pool that is not running any apps is to:

  • 将辅助角色的数量减至 2 个。Scale down the quantity of workers to 2. 门户中的缩减大小下限为 2 个。The minimum scale down size in the portal is 2. 解除分配实例需要几分钟的时间。It will take a few minutes to deallocate your instances.
  • 选择新的计算大小与实例数目。Select the new compute size and number of instances. 从此处开始,需要多达 2 小时才能完成。From here, it will take up to 2 hours to complete.

如果应用需要更多计算资源,则无法利用前面的指导。If your apps require a larger compute resource size, you can't take advantage of the previous guidance. 可以改为在另一个辅助角色池中填充具有所需大小的辅助角色,并将应用转移到该池,而无需更改托管那些应用的辅助角色池的大小。Instead of changing the size of the worker pool that is hosting those apps, you can populate another worker pool with workers of the desired size and move your apps over to that pool.

  • 在另一个辅助角色池中创建具有所需计算大小的其他实例。Create the additional instances of the needed compute size in another worker pool. 这需要多达一小时才能完成。This will take up to an hour to complete.
  • 将需要更大大小且托管应用的应用服务计划重新分配到新配置的辅助角色池。Reassign your App Service plans that are hosting the apps that need a larger size to the newly configured worker pool. 这是一个快速操作,在一分钟内应可完成。This is a fast operation that should take less than a minute to complete.
  • 如果不再需要那些未使用的实例,请缩减第一个辅助角色池。Scale down the first worker pool if you don't need those unused instances anymore. 此操作需要数分钟才能完成。This operation takes a few minutes to complete.

自动缩放:可帮助管理计算资源消耗的工具之一。Autoscaling: One of the tools that can help you to manage your compute resource consumption is autoscaling. 可以针对前端或辅助角色池执行自动缩放。You can use autoscaling for front-end or worker pools. 可以执行以下操作:早上增加任何池类型的实例,而晚上减少实例。You can do things such as increase your instances of any pool type in the morning and reduce it in the evening. 或者,可以在辅助角色池中可用的辅助角色数目低于特定阈值时添加实例。Or perhaps you can add instances when the number of workers that are available in a worker pool drops below a certain threshold.

如果想要设置有关计算资源池度量值的自动缩放规则,请记得考虑预配所需的时间。If you want to set autoscale rules around compute resource pool metrics, then keep in mind the time that provisioning requires. 有关自动调整应用服务环境规模的详细信息,请参阅如何配置应用服务环境中的自动调整规模For more details about autoscaling App Service Environments, see How to configure autoscale in an App Service Environment.

存储Storage

每个 ASE 配置了 500 GB 的存储空间。Each ASE is configured with 500 GB of storage. 此空间用于 ASE 中的所有应用。This space is used across all the apps in the ASE. 此存储空间属于 ASE 的一部分,目前无法切换为使用存储空间。This storage space is a part of the ASE and currently can't be switched to use your storage space. 如果调整虚拟网络路由或安全性,仍然需要允许访问 Azure 存储,否则 ASE 将无法正常工作。If you're making adjustments to your virtual network routing or security, you need to still allow access to Azure Storage--or the ASE cannot function.

数据库Database

数据库会保存定义环境的信息,以及在其中运行的应用的详细信息。The database holds the information that defines the environment, as well as the details about the apps that are running within it. 这也是 Azure 保存的订阅的一部分。This too is a part of the Azure-held subscription. 但无法直接进行操作。It's not something that you have a direct ability to manipulate. 如果调整虚拟网络路由或安全性,仍然需要允许访问 SQL Azure,否则 ASE 将无法正常工作。If you're making adjustments to your virtual network routing or security, you need to still allow access to SQL Azure--or the ASE cannot function.

网络Network

与 ASE 配合使用的 VNet 可以是在创建 ASE 时创建的 VNet,也可以是现有的 VNet。The VNet that is used with your ASE can be one that you made when you created the ASE or one that you made ahead of time. 如果在创建 ASE 期间创建子网,会强制 ASE 位于与虚拟网络相同的资源组。When you create the subnet during ASE creation, it forces the ASE to be in the same resource group as the virtual network. 如果想要 ASE 所使用的资源组不同于 VNet 的资源组,那么需要使用 Resource Manager 模板创建 ASE。If you need the resource group used by your ASE to be different than that of your VNet, then you need to create your ASE using a resource manager template.

用于 ASE 的虚拟网络有一些限制:There are some restrictions on the virtual network that is used for an ASE:

  • 虚拟网络必须是区域虚拟网络。The virtual network must be a regional virtual network.
  • 需要有包含 8 个或更多个地址且为 ASE 部署位置的子网。There needs to be a subnet with 8 or more addresses where the ASE is deployed.
  • 将某个子网用于托管 ASE 之后,无法更改该子网的地址范围。After a subnet is used to host an ASE, the address range of the subnet can't be changed. 因此,建议子网至少包含 64 个地址以适应将来的 ASE 增长。For this reason, we recommend that the subnet contains at least 64 addresses to accommodate any future ASE growth.
  • 除了 ASE 以外,子网中不能有其他项目。There can be nothing else in the subnet but the ASE.

不同于包含 ASE 的托管服务,虚拟网络和子网都在用户的控制之下。Unlike the hosted service that contains the ASE, the virtual network and subnet are under user control. 可以通过虚拟网络 UI 或 PowerShell 管理虚拟网络。You can administer your virtual network through the Virtual Network UI or PowerShell. ASE 可以部署在经典 VNet 或 Resource Manager VNet 中。An ASE can be deployed in a Classic or Resource Manager VNet. 经典 VNet 与 Resource Manager VNet 之间的门户和 API 体验会稍有不同,但 ASE 体验相同。The portal and API experiences are slightly different between Classic and Resource Manager VNets but the ASE experience is the same.

用于托管 ASE 的 VNet 可以使用专用 RFC1918 IP 地址或使用公共 IP 地址。The VNet that is used to host an ASE can use either private RFC1918 IP addresses or it can use public IP addresses. 如果想要使用 RFC1918(10.0.0.0/8、172.16.0.0/12、192.168.0.0/16)未涵盖的 IP 范围,则必须在创建 ASE 之前,创建 VNet 和子网以供 ASE 使用。If you wish to use an IP range that is not covered by RFC1918 (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) then you need to create your VNet and subnet to be used by your ASE ahead of ASE creation.

因为此功能将 Azure 应用服务置于虚拟网络中,这意味着托管在 ASE 中的应用现在可直接访问通过 ExpressRoute 或站点到站点虚拟专用网 (VPN) 提供的资源。Because this capability places the Azure App Service into your virtual network, it means that your apps that are hosted in your ASE can now access resources that are made available through ExpressRoute or site-to-site virtual private networks (VPNs) directly. 应用服务环境中的应用不需要其他网络功能即可访问托管应用服务环境的虚拟网络可用的资源。The apps that are within your App Service Environment don't require additional networking features to access resources available to the virtual network that is hosting your App Service Environment. 这意味着无需使用 VNET 集成或混合连接,即可访问虚拟网络内部或连接到虚拟网络的资源。This means that you don't need to use VNET Integration or Hybrid Connections to get to resources in or connected to your virtual network. 但仍可以使用这两项功能访问网络中未连接到虚拟网络的资源。You can still use both of those features though to access resources in networks that are not connected to your virtual network.

例如,可以使用 VNET 集成来与订阅中未连接到 ASE 所在虚拟网络的虚拟网络集成。For example, you can use VNET Integration to integrate with a virtual network that is in your subscription but isn't connected to the virtual network that your ASE is in. 像平时一样,仍可使用混合连接来访问其他网络中的资源。You can still also use Hybrid Connections to access resources that are in other networks, just like you normally can.

如果虚拟网络配置了 ExpressRoute VPN,则应注意 ASE 的某些路由要求。If you do have your virtual network configured with an ExpressRoute VPN, you should be aware of some of the routing needs that an ASE has. 某些用户定义的路由 (UDR) 配置与 ASE 不兼容。There are some user-defined route (UDR) configurations that are incompatible with an ASE. 有关使用 ExpressRoute 在虚拟网络中运行 ASE 的更多详细信息,请参阅使用 ExpressRoute 在虚拟网络中运行应用服务环境For more details about running an ASE in a virtual network with ExpressRoute, see Running an App Service Environment in a virtual network with ExpressRoute.

保护入站流量Securing inbound traffic

有两种主要方法可控制 ASE 的入站流量。There are two primary methods to control inbound traffic to your ASE. 可以使用网络安全组 (NSG) 来控制哪些 IP 地址可以访问 ASE(请参阅如何控制应用服务环境中的入站流量),也可以使用内部负载均衡器 (ILB) 配置 ASE。You can use Network Security Groups(NSGs) to control what IP addresses can access your ASE as described here How to control inbound traffic in an App Service Environment and you can also configure your ASE with an Internal Load Balancer(ILB). 如果要使用 NSG 限制对 ILB ASE 的访问,这些功能也可以一起使用。These features can also be used together if you want to restrict access using NSGs to your ILB ASE.

创建 ASE 时,它会在 VNet 中创建 VIP。When you create an ASE, it will create a VIP in your VNet. VIP 有两种类型:外部和内部。There are two VIP types, external and internal. 创建具有外部 VIP 的 ASE 时,可以通过 Internet 可路由 IP 地址访问 ASE 中的应用。When you create an ASE with an external VIP then your apps in your ASE will be accessible via an internet routable IP address. 如果选择内部 VIP,ASE 会使用 ILB 进行配置,并且无法通过 Internet 直接访问。When you select Internal your ASE will be configured with an ILB and will not be directly internet accessible. ILB ASE 仍需要外部 VIP,但它只用来进行 Azure 管理和维护访问。An ILB ASE still requires an external VIP but it is only used for Azure management and maintenance access.

在 ILB ASE 创建期间,需要提供 ILB ASE 所用的子域,而且必须针对你指定的子域管理自己的 DNS。During ILB ASE creation you provide the subdomain used by the ILB ASE and will have to manage your own DNS for the subdomain you specify. 你设置了子域名称,所以也需要管理用于 HTTPS 访问的证书。Because you set the subdomain name you also need to manage the certificate used for HTTPS access. 创建 ASE 之后,系统会提示提供证书。After ASE creation you are prompted to provide the certificate. 若要了解有关创建和使用 ILB ASE 的详细信息,请参阅在应用服务环境中使用内部负载均衡器To learn more about creating and using an ILB ASE read Using an Internal Load Balancer with an App Service Environment.

门户Portal

可以使用 Azure 门户中的 UI 来管理和监视应用服务环境。You can manage and monitor your App Service Environment by using the UI in the Azure portal. 如果有 ASE,则可能会在边栏上看到应用服务符号。If you have an ASE, then you are likely to see the App Service symbol on your sidebar. 此符号用于表示 Azure 门户中的应用服务环境:This symbol is used to represent App Service Environments in the Azure portal:

应用服务环境符号

要打开列出所有的应用服务环境的 UI,可以使用图标,或选择边栏底部的 V 形标记(“>”符号),并选择应用服务环境。To open the UI that lists all of your App Service Environments, you can use the icon or select the chevron (">" symbol) at the bottom of the sidebar to select App Service Environments. 选择其中一个列出的 ASE 会打开用于监视和管理该 ASE 的 UI。By selecting one of the ASEs listed, you open the UI that is used to monitor and manage it.

用于监视和管理应用服务环境的 UI

这是第一个边栏选项卡,其中显示 ASE 的某些属性和每个资源池的度量值图表。This first blade shows some properties of your ASE, along with a metric chart per resource pool. “基本信息”块中显示的某些属性同时也是超链接,将打开与其关联的边栏选项卡。Some of the properties that are shown in the Essentials block are also hyperlinks that will open up the blade that is associated with it. 例如,可选择虚拟网络名称,以打开与运行 ASE 的虚拟网络关联的 UI。For example, you can select the Virtual Network name to open up the UI associated with the virtual network that your ASE is running in. “应用服务计划”和“应用”将分别打开不同的边栏选项卡,其中列出位于 ASE 中的项。App Service plans and Apps each open up blades that list these items that are in your ASE.

监视Monitoring

通过图表可以查看每个资源池中各种不同的性能指标。The charts allow you to see a variety of performance metrics in each resource pool. 对于前端池,可以监视平均 CPU 和内存。For the front-end pool, you can monitor the average CPU and memory. 对于辅助角色池,可以监视已用和可用的数量。For worker pools, you can monitor the quantity that is used and the quantity that is available.

多个应用服务计划可以使用同一个辅助角色池中的辅助角色。Multiple App Service plans can make use of the workers in a worker pool. 工作负荷不是通过与前端服务器相同的方式分布,因此 CPU 和内存使用率不能提供很多有用的信息。The workload is not distributed in the same fashion as with the front-end servers, so the CPU and memory usage don't provide much in the way of useful information. 更重要的是要跟踪已用和可用的辅助角色数目,特别是在管理此系统以供他人使用时。It's more important to track how many workers that you have used and are available--especially if you're managing this system for others to use.

也可以使用所有可在图表中跟踪的度量值来设置警报。You can also use all of the metrics that can be tracked in the charts to set up alerts. 在此设置警报的效果与在应用服务的其他位置相同。Setting up alerts here works the same as elsewhere in App Service. 可从“警报”UI 部分设置警报,也可以钻取到任何度量值 UI 并选择“添加警报”进行设置。You can set an alert from either the Alerts UI part or from drilling into any metrics UI and selecting Add Alert.

度量值 UI

刚刚所讨论的度量值是应用服务环境度量值。The metrics that were just discussed are the App Service Environment metrics. 另外也有可在应用服务计划级别使用的度量值。There are also metrics that are available at the App Service plan level. 在其中监视 CPU 和内存是很合理的做法。This is where monitoring CPU and memory makes a lot of sense.

在 ASE 中,所有应用服务计划都是专用的应用服务计划。In an ASE, all of the App Service plans are dedicated App Service plans. 这意味着,只有在分配给该应用服务计划的主机上运行的应用才是该应用服务计划中的应用。That means that the only apps that are running on the hosts allocated to that App Service plan are the apps in that App Service plan. 若要查看有关应用服务计划的详细信息,可从 ASE UI 中的任何列表或通过访问浏览应用服务计划(其中列出了全部计划)显示应用服务计划。To see details on your App Service plan, bring up your App Service plan from any of the lists in the ASE UI or from Browse App Service plans (which lists all of them).

设置Settings

ASE 边栏选项卡中有一个包含几项重要功能的“设置”部分:Within the ASE blade, there is a Settings section that contains several important capabilities:

“设置” > “属性”:“设置”边栏选项卡在显示 ASE 边栏选项卡时会自动打开。Settings > Properties: The Settings blade automatically opens when you bring up your ASE blade. 位于顶部的是“属性”。At the top is Properties. 此处显示了许多与“基本信息”重复的项,但“虚拟 IP 地址”和“出站 IP 地址”是非常有用的项。There are a number of items in here that are redundant to what you see in Essentials, but what is very useful is Virtual IP Address, as well as Outbound IP Addresses.

“设置”边栏选项卡和“属性”

“设置” > “IP 地址”:在 ASE 中创建 IP 安全套接字层 (SSL) 应用时,需要有一个 IP SSL 地址。Settings > IP Addresses: When you create an IP Secure Sockets Layer (SSL) app in your ASE, you need an IP SSL address. 要获取该地址,ASE 需要拥有一些可分配的 IP SSL 地址。In order to obtain one, your ASE needs IP SSL addresses that it owns that can be allocated. 创建的 ASE 最初有一个 IP SSL 地址用于此目的,但可以添加更多地址。When an ASE is created, it has one IP SSL address for this purpose, but you can add more. 额外的 IP SSL 地址需要付费,如应用服务定价(在有关 SSL 连接的一节中)所述。There is a charge for additional IP SSL addresses, as shown in App Service pricing (in the section on SSL connections). 额外的价格是 IP SSL 价格。The additional price is the IP SSL price.

设置 > 前端池 / 辅助角色池:其中的每个资源池边栏选项卡可让用户查看仅与该资源池有关的信息,并获得全面缩放该资源池所需的控制权。Settings > Front End Pool / Worker Pools: Each of these resource pool blades offers the ability to see information only on that resource pool, in addition to providing controls to fully scale that resource pool.

每个资源池的基本边栏选项卡分别提供一个图表,其中包含该资源池的度量值。The base blade for each resource pool provides a chart with metrics for that resource pool. 就像 ASE 边栏选项卡中的图表一样,可以进入该图表并设置所需的警报。Just like with the charts from the ASE blade, you can go into the chart and set up alerts as desired. 从 ASE 边栏选项卡为特定的资源池设置警报,效果等同于从资源池进行设置。Setting an alert from the ASE blade for a specific resource pool does the same thing as doing it from the resource pool. 在辅助角色池的“设置”边栏选项卡中,有权访问在此辅助角色池中运行的所有应用或应用服务计划。From the worker pool Settings blade, you have access to all the Apps or App Service plans that are running in this worker pool.

辅助角色池设置 UI

门户缩放功能Portal scale capabilities

共有三种缩放操作:There are three scale operations:

  • 更改 ASE 中可供 IP SSL 使用的 IP 地址数。Changing the number of IP addresses in the ASE that are available for IP SSL usage.
  • 更改用于资源池的计算资源大小。Changing the size of the compute resource that is used in a resource pool.
  • 以手动方式或通过自动缩放更改用于资源池的计算资源数。Changing the number of compute resources that are used in a resource pool, either manually or through autoscaling.

在门户中,有三种方式可控制资源池中的服务器数:In the portal, there are three ways to control how many servers that you have in your resource pools:

  • 顶部主要 ASE 边栏选项卡中的缩放操作。A scale operation from the main ASE blade at the top. 可以对前端池和辅助角色池进行多项缩放配置更改。You can make multiple scale configuration changes to the front-end and worker pools. 它们全部以单个操作的方式应用。They are all applied as a single operation.
  • 单个资源池的“缩放”边栏选项卡(位于“设置”下)中的手动缩放操作。A manual scale operation from the individual resource pool Scale blade, which is under Settings.
  • 可从单个资源池的“缩放”边栏选项卡设置的自动缩放。Autoscaling, which you set up from the individual resource pool Scale blade.

要使用 ASE 边栏选项卡上的缩放操作,请将滑块拖到所需的数量并保存。To use the scale operation on the ASE blade, drag the slider to the quantity you want and save. 此 UI 还支持更改大小。This UI also supports changing the size.

缩放 UI

若要使用特定资源池中的手动或自动缩放功能,请根据需要转到“设置” > “前端池” / “辅助角色池”。To use the manual or autoscale capabilities in a specific resource pool, go to Settings > Front End Pool / Worker Pools as appropriate. 然后打开要更改的池。Then open up the pool that you want to change. 转到“设置” > “扩大”或“设置” > “增加”。Go to Settings > Scale Out or Settings > Scale Up. 通过“扩大”边栏选项卡可控制实例数量。The Scale Out blade enables you to control instance quantity. 使用“增加”可控制资源大小。Scale Up enables you to control resource size.

缩放设置 UI

容错注意事项Fault-tolerance considerations

可将应用服务环境配置为总共使用最多 55 个计算资源。You can configure an App Service Environment to use up to 55 total compute resources. 在这 55 个计算资源中,只有 50 个可用于承载工作负荷。Of those 55 compute resources, only 50 can be used to host workloads. 其原因有两个。The reason for this is twofold. 至少有 2 个前端计算资源。There is a minimum of 2 front-end compute resources. 还剩最多 53 个来支持辅助角色池分配。That leaves up to 53 to support the worker-pool allocation. 为了提供容错功能,还需根据以下规则分配额外计算资源:In order to provide fault tolerance, you need to have an additional compute resource that is allocated according to the following rules:

  • 每个辅助角色池至少需要 1 个无法被分配工作负荷的额外计算资源。Each worker pool needs at least 1 additional compute resource that is not available to be assigned a workload.
  • 当辅助角色池中计算资源的数量超出特定值时,则需要另一个计算资源以实现容错。When the quantity of compute resources in a worker pool goes above a certain value, then another compute resource is required for fault tolerance. 在前端池中不需要这样做。This is not the case in the front-end pool.

在任何单个辅助角色池中,对于分配到辅助角色池的给定 X 个资源,容错要求如下:Within any single worker pool, the fault-tolerance requirements are that for a given value of X resources assigned to a worker pool:

  • 如果 X 介于 2 和 20 之间,则可用于工作负荷的可用计算资源量为 X-1。If X is between 2 and 20, the amount of usable compute resources that you can use for workloads is X-1.
  • 如果 X 介于 21 和 40 之间,则可用于工作负荷的可用计算资源量为 X-2。If X is between 21 and 40, the amount of usable compute resources that you can use for workloads is X-2.
  • 如果 X 介于 41 和 53 之间,则可用于工作负荷的可用计算资源量为 X-3。If X is between 41 and 53, the amount of usable compute resources that you can use for workloads is X-3.

最少的使用量具有 2 个前端服务器和 2 个辅助角色。The minimum footprint has 2 front-end servers and 2 workers. 上述理论可通过几个示例来进一步说明:With the above statements then, here are a few examples to clarify:

  • 如果在单个池中有 30 个辅助角色,则其中有 28 个可用于托管工作负荷。If you have 30 workers in a single pool, then 28 of them can be used to host workloads.
  • 如果在单个池中有 2 个辅助角色,则有 1 个可用于托管工作负荷。If you have 2 workers in a single pool, then 1 can be used to host workloads.
  • 如果在单个池中有 20 个辅助角色,则有 19 个可用于托管工作负荷。If you have 20 workers in a single pool, then 19 can be used to host workloads.
  • 如果在单个池中有 21 个辅助角色,则同样只有 19 个可用于托管工作负荷。If you have 21 workers in a single pool, then still only 19 can be used to host workloads.

容错是很重要的环节,但在缩放超过特定阈值时必须留意。The fault-tolerance aspect is important, but you need to keep it in mind as you scale above certain thresholds. 如果想要从 20 个实例添加更多容量,请缩放到 22 或更高,因为 21 并不额外添加任何容量。If you want to add more capacity going from 20 instances, then go to 22 or higher because 21 doesn't add any more capacity. 缩放到 40 以上时也是一样,下一个添加容量的数为 42。The same is true going above 40, where the next number that adds capacity is 42.

删除应用服务环境Deleting an App Service Environment

如果想要删除应用服务环境,只需使用“应用服务环境”边栏选项卡顶部的“删除”操作即可。If you want to delete an App Service Environment, then simply use the Delete action at the top of the App Service Environment blade. 当执行此操作时,系统会提示输入应用服务环境的名称,以确认你确实想要执行此操作。When you do this, you'll be prompted to enter the name of your App Service Environment to confirm that you really want to do this. 请注意,删除应用服务环境时,将同时删除其中包含的所有内容。Note that when you delete an App Service Environment, you delete all of the content within it as well.

删除应用服务环境 UI

入门Getting started

若要开始使用应用服务环境,请参阅如何创建应用服务环境To get started with App Service Environments, see How to create an App Service Environment.

备注

如果要在注册 Azure 帐户之前开始使用 Azure 应用服务,请转到试用应用服务,可以在应用服务中立即创建一个生存期较短的入门 Web 应用。If you want to get started with Azure App Service before signing up for an Azure account, go to Try App Service, where you can immediately create a short-lived starter web app in App Service. 不需要使用信用卡,也不需要做出承诺。No credit cards required; no commitments.