Azure App Service 方案概觀Azure App Service plan overview

在 App Service (Web Apps、API Apps 或 Mobile Apps) 中,應用程式一律會在 App Service 方案 中執行。In App Service (Web Apps, API Apps, or Mobile Apps), an app always runs in an App Service plan. 此外, Azure Functions 也可以選擇在 App Service 方案 中執行。In addition, Azure Functions also has the option of running in an App Service plan. App Service 方案會針對要執行的 Web 應用程式定義一組計算資源。An App Service plan defines a set of compute resources for a web app to run. 這些計算資源類似于傳統 web 裝載中的 伺服器 陣列。These compute resources are analogous to the server farm in conventional web hosting. 一或多個應用程式可設定為在相同的計算資源上執行 (或在相同的 App Service 方案中執行)。One or more apps can be configured to run on the same computing resources (or in the same App Service plan).

當您在特定區域 (例如,西歐) 建立 App Service 方案時,會為該區域的方案建立一組計算資源。When you create an App Service plan in a certain region (for example, West Europe), a set of compute resources is created for that plan in that region. 無論您將何種應用程式置入此 App Service 方案,都會在該 App Service 方案定義的計算資源上執行。Whatever apps you put into this App Service plan run on these compute resources as defined by your App Service plan. 每個 App Service 方案都會定義:Each App Service plan defines:

  • 區域 (美國西部、美國東部等)Region (West US, East US, etc.)
  • 虛擬機器執行個體的數目Number of VM instances
  • 虛擬機器執行個體的大小 (小、中、大)Size of VM instances (Small, Medium, Large)
  • 定價層 (免費、共用、基本、標準、Premium、>premiumv2、PremiumV3、隔離) Pricing tier (Free, Shared, Basic, Standard, Premium, PremiumV2, PremiumV3, Isolated)

App Service 方案的 定價層 可決定您獲得哪些 App Service 功能,以及為該方案支付多少費用。The pricing tier of an App Service plan determines what App Service features you get and how much you pay for the plan. 定價層有幾個類別:There are a few categories of pricing tiers:

  • 共用計算免費共用,這兩個基底層會在與其他 App Service 應用程式相同的 Azure VM 上執行應用程式,包括其他客戶的應用程式。Shared compute: Free and Shared, the two base tiers, runs an app on the same Azure VM as other App Service apps, including apps of other customers. 這些層會將 CPU 配額配置到在共用資源上執行的每個應用程式,而且該資源無法向外延展。These tiers allocate CPU quotas to each app that runs on the shared resources, and the resources cannot scale out.
  • 專用計算基本標準Premium>premiumv2PremiumV3 層會在專用的 Azure vm 上執行應用程式。Dedicated compute: The Basic, Standard, Premium, PremiumV2, and PremiumV3 tiers run apps on dedicated Azure VMs. 只有位於相同 App Service 方案中的應用程式,才會共用相同的計算資源。Only apps in the same App Service plan share the same compute resources. 層越高,可用於向外延展的 VM 執行個體就越多。The higher the tier, the more VM instances are available to you for scale-out.
  • 隔離:此層會在專用的 Azure 虛擬網路上執行專用的 azure vm。Isolated: This tier runs dedicated Azure VMs on dedicated Azure Virtual Networks. 它會針對您的應用程式,在計算隔離之上提供網路隔離。It provides network isolation on top of compute isolation to your apps. 它提供了最大的向外延展能力。It provides the maximum scale-out capabilities.

注意

App Service 的免費和共用 (預覽) 主控方案均為基本層,在與其他 App Service 應用程式相同的 Azure 虛擬機器上執行。App Service Free and Shared (preview) hosting plans are base tiers that run on the same Azure virtual machines as other App Service apps. 某些應用程式可能屬於其他客戶。Some apps might belong to other customers. 這些層僅用於開發與測試。These tiers are intended to be used only for development and testing purposes.

每一層也提供 App Service 功能的特定子集。Each tier also provides a specific subset of App Service features. 這些功能包括自訂網域與 TLS/SSL 憑證、自動調整、部署位置、備份、流量管理員整合等等。These features include custom domains and TLS/SSL certificates, autoscaling, deployment slots, backups, Traffic Manager integration, and more. 層越高,可用的功能就越多。The higher the tier, the more features are available. 若要了解每個定價層支援的功能,請參閱App Service 方案詳細資料To find out which features are supported in each pricing tier, see App Service plan details.

注意

新的 PremiumV3 定價層可保證具有更快處理器的機器 (每個虛擬 CPU) 的最小 195 ACU 、SSD 儲存體,以及相較于 標準 層的四個記憶體/核心比率。The new PremiumV3 pricing tier guarantees machines with faster processors (minimum 195 ACU per virtual CPU), SSD storage, and quadruple memory-to-core ratio compared to Standard tier. PremiumV3 也透過增加的實例計數支援更高的規模,同時仍提供在 標準 層中找到的所有先進功能。PremiumV3 also supports higher scale via increased instance count while still providing all the advanced capabilities found in Standard tier. 現有 >premiumv2 層中提供的所有功能都包含在 PremiumV3 中。All features available in the existing PremiumV2 tier are included in PremiumV3.

類似於其他專用層,此層有三個可用的 VM 大小:Similar to other dedicated tiers, three VM sizes are available for this tier:

  • Small (2 CPU 核心,8 GiB 的記憶體) Small (2 CPU core, 8 GiB of memory)
  • 中型 (4 個 CPU 核心,16 GiB 的記憶體) Medium (4 CPU cores, 16 GiB of memory)
  • 大型 (8 個 CPU 核心,32 GiB 的記憶體) Large (8 CPU cores, 32 GiB of memory)

如需 PremiumV3 定價資訊,請參閱 App Service 定價For PremiumV3 pricing information, see App Service Pricing.

若要開始使用新的 PremiumV3 定價層,請參閱 設定適用于 App Service 的 PremiumV3 層To get started with the new PremiumV3 pricing tier, see Configure PremiumV3 tier for App Service.

我的應用程式如何執行及調整縮放?How does my app run and scale?

免費共用 層中,應用程式會在共用的 VM 實例上收到 CPU 分鐘,而且無法相應放大。在其他階層中,應用程式會以下面方式執行和調整。In the Free and Shared tiers, an app receives CPU minutes on a shared VM instance and cannot scale out. In other tiers, an app runs and scales as follows.

當您在 App Service 中建立應用程式時,該應用程式會置入 App Service 方案。When you create an app in App Service, it is put into an App Service plan. 當應用程式執行時,會在 App Service 方案中設定的所有 VM 執行個體上執行。When the app runs, it runs on all the VM instances configured in the App Service plan. 如果有多個應用程式位於相同的 App Service 方案,它們會共用相同的 VM 執行個體。If multiple apps are in the same App Service plan, they all share the same VM instances. 如果一個應用程式有多個部署位置,所有部署位置也會在相同的 VM 執行個體上執行。If you have multiple deployment slots for an app, all deployment slots also run on the same VM instances. 如果您啟用診斷記錄、執行備份,或執行 WebJob,它們也會使用這些 VM 執行個體上的 CPU 週期和記憶體。If you enable diagnostic logs, perform backups, or run WebJobs, they also use CPU cycles and memory on these VM instances.

如此一來,App Service 方案是 App Service 應用程式的縮放單位。In this way, the App Service plan is the scale unit of the App Service apps. 如果方案設定為執行五個 VM 執行個體,則方案中的所有應用程式會在所有五個執行個體上執行。If the plan is configured to run five VM instances, then all apps in the plan run on all five instances. 如果方案設定為自動調整,則方案中的所有應用程式會根據自動調整設定一起向外延展。If the plan is configured for autoscaling, then all apps in the plan are scaled out together based on the autoscale settings.

如需有關向外延展應用程式的詳細資訊,請參閱手動或自動調整執行個體計數For information on scaling out an app, see Scale instance count manually or automatically.

我的 App Service 方案費用是多少?How much does my App Service plan cost?

本節描述 App Service 應用程式的計費方式。This section describes how App Service apps are billed. 如需特定區域價格的詳細資訊,請參閱 App Service 價格For detailed, region-specific pricing information, see App Service Pricing.

除了 免費 層之外,App Service 方案會對其使用的計算資源收費。Except for Free tier, an App Service plan carries a charge on the compute resources it uses.

  • 共用 層中,每個應用程式都會收到 cpu 分鐘的配額,因此 每個應用程式 都需支付 cpu 配額的費用。In the Shared tier, each app receives a quota of CPU minutes, so each app is charged for the CPU quota.
  • 在「基本」、「標準 」、「高階」、「>premiumv2」、「標準」、「高階」、 ****、 PremiumV3) 的專用計算 (層中,APP SERVICE 的方案會定義應用程式所調整的 vm 實例數目,因此 App Service 計畫中的 每個 vmIn the dedicated compute tiers (Basic, Standard, Premium, PremiumV2, PremiumV3), the App Service plan defines the number of VM instances the apps are scaled to, so each VM instance in the App Service plan is charged. 無論有多少個應用程式在 VM 執行個體上執行,這些 VM 執行個體皆採相同收費。These VM instances are charged the same regardless how many apps are running on them. 為了避免產生非預期的費用,請參閱清除 App Service 方案To avoid unexpected charges, see Clean up an App Service plan.
  • 隔離 層中,App Service 環境會定義執行您應用程式的隔離式背景工作角色數目,而 每個背景工作 會收取費用。In the Isolated tier, the App Service Environment defines the number of isolated workers that run your apps, and each worker is charged. 此外,執行 App Service 環境本身會有一般的戳記費用。In addition, there's a flat Stamp Fee for the running the App Service Environment itself.

使用您 (設定自訂網域、TLS/SSL 憑證、部署位置、備份等 ) 的 App Service 功能時,不需付費。You don't get charged for using the App Service features that are available to you (configuring custom domains, TLS/SSL certificates, deployment slots, backups, etc.). 例外狀況為:The exceptions are:

  • App Service 網域 - 當您在 Azure 中購買一個網域且採每年續訂時,即需要付費。App Service Domains - you pay when you purchase one in Azure and when you renew it each year.
  • App Service 憑證 - 當您在 Azure 中購買一個憑證且採每年續訂時,即需要付費。App Service Certificates - you pay when you purchase one in Azure and when you renew it each year.
  • 以 IP 為基礎的 TLS 連線-每個以 IP 為基礎的 TLS 連線都有每小時的費用,但某些 標準 層或更高版本提供您一個以 ip 為基礎的 tls 連線,可供免費使用。IP-based TLS connections - There's an hourly charge for each IP-based TLS connection, but some Standard tier or above gives you one IP-based TLS connection for free. 以 SNI 為基礎的 TLS 連接是免費的。SNI-based TLS connections are free.

注意

如果您將 App Service 與另一個 App Service 整合,可能需要考慮來自其他服務的費用。If you integrate App Service with another Azure service, you may need to consider charges from these other services. 例如,如果您使用 Azure 流量管理員來調整您的異地應用程式、Azure 流量管理員也會根據您的使用量來收費。For example, if you use Azure Traffic Manager to scale your app geographically, Azure Traffic Manager also charges you based on your usage. 若要預估您在 Azure 中的跨服務成本,請參閱價格計算器To estimate your cross-services cost in Azure, see Pricing calculator.

想要最佳化並節省您的雲端費用嗎?Want to optimize and save on your cloud spending?

Azure 服務成本費用。Azure services cost money. Azure 成本管理可協助您設定預算和設定警示以控制費用。Azure Cost Management helps you set budgets and configure alerts to keep spending under control. 使用成本管理來分析、管理和最佳化您的 Azure 成本。Analyze, manage, and optimize your Azure costs with Cost Management. 若要深入了解,請參閱分析成本的快速入門To learn more, see the quickstart on analyzing your costs.

如果我的應用程式需要更多的功能?What if my app needs more capabilities or features?

可以隨時相應增加和相應減少您的 App Service 方案。Your App Service plan can be scaled up and down at any time. 這與更改方案的定價層一樣簡單。It is as simple as changing the pricing tier of the plan. 一開始,您可以選擇較低的定價層,當您之後需要更多 App Service 功能時,再相應增加。You can choose a lower pricing tier at first and scale up later when you need more App Service features.

例如,您可以開始測試 免費 App Service 方案中的 Web 應用程式,無須支付任何費用。For example, you can start testing your web app in a Free App Service plan and pay nothing. 當您想要將 自訂 DNS 名稱 加入 Web 應用程式時,只要將您的方案相應增加至 共用 層即可。When you want to add your custom DNS name to the web app, just scale your plan up to Shared tier. 稍後,當您想要 建立 TLS系結時,請將您的方案調整到 基本 層。Later, when you want to create a TLS binding, scale your plan up to Basic tier. 當您想要有 預備環境時,相應增加至 標準 層。When you want to have staging environments, scale up to Standard tier. 當您需要更多核心、記憶體或儲存體時,可以在同一層中相應增加到較大的 VM 大小。When you need more cores, memory, or storage, scale up to a bigger VM size in the same tier.

反向的運作方式也是一樣。The same works in the reverse. 當您覺得不再需要更高層的功能時,可以相應減少到較低層,這樣可以節省費用。When you feel you no longer need the capabilities or features of a higher tier, you can scale down to a lower tier, which saves you money.

如需有關相應增加 App Service 方案的詳細資訊,請參閱在 Azure 中相應增加應用程式For information on scaling up the App Service plan, see Scale up an app in Azure.

如果您的應用程式與其他應用程式處於相同的 App Service 方案中,您可以藉由隔離計算資源以改善應用程式的效能。If your app is in the same App Service plan with other apps, you may want to improve the app's performance by isolating the compute resources. 您可以透過將應用程式移到不同的 App Service 方案來實現。You can do it by moving the app into a separate App Service plan. 如需詳細資訊,請參閱將應用程式移至另一個 App Service 方案For more information, see Move an app to another App Service plan.

我應該將應用程式置入新的方案或現有方案?Should I put an app in a new plan or an existing plan?

由於您要針對 App Service 方案配置的計算資源付費 (請參閱我的 App Service 方案成本是多少?),您可以將多個應用程式置入一個 App Service 方案來節省費用。Since you pay for the computing resources your App Service plan allocates (see How much does my App Service plan cost?), you can potentially save money by putting multiple apps into one App Service plan. 只要現有方案有足夠資源處理負載,即可繼續將應用程式新增至該方案。You can continue to add apps to an existing plan as long as the plan has enough resources to handle the load. 不過,請記住,同個 App Service 方案中的應用程式皆會共用相同的計算資源。However, keep in mind that apps in the same App Service plan all share the same compute resources. 若要判斷新的應用程式是否有所需的資源,您必須了解現有 App Service 方案的容量,以及新應用程式的預期負載。To determine whether the new app has the necessary resources, you need to understand the capacity of the existing App Service plan, and the expected load for the new app. 多載 App Service 方案可能會導致新的和現有的應用程式停機。Overloading an App Service plan can potentially cause downtime for your new and existing apps.

如果有下列情況,請將您的應用程式隔離至新的 App Service 方案中:Isolate your app into a new App Service plan when:

  • 應用程式會耗用大量資源。The app is resource-intensive.
  • 您想要將應用程式與現有方案中的其他應用程式分開調整。You want to scale the app independently from the other apps in the existing plan.
  • 應用程式需要不同地理區域中的資源。The app needs resource in a different geographical region.

這樣可讓您為應用程式配置一組新的資源,更充分掌控您的應用程式。This way you can allocate a new set of resources for your app and gain greater control of your apps.

管理 App Service 方案Manage an App Service plan