流量管理員端點Traffic Manager endpoints

Microsoft Azure 流量管理員可讓您控制如何將網路流量分散到在不同資料中心執行的應用程式部署。Microsoft Azure Traffic Manager allows you to control how network traffic is distributed to application deployments running in different datacenters. 您可以在流量管理員中將每個應用程式部署設定為「端點」。You configure each application deployment as an 'endpoint' in Traffic Manager. 當流量管理員收到 DNS 要求時,它會選擇可用的端點在 DNS 回應中傳回。When Traffic Manager receives a DNS request, it chooses an available endpoint to return in the DNS response. 流量管理員會根據目前的端點狀態和流量路由方法來選擇。Traffic manager bases the choice on the current endpoint status and the traffic-routing method. 如需詳細資訊,請參閱流量管理員的運作方式For more information, see How Traffic Manager Works.

流量管理員支援三種類型的端點:There are three types of endpoint supported by Traffic Manager:

  • Azure 端點 用於在 Azure 中裝載的服務。Azure endpoints are used for services hosted in Azure.
  • 外部端點適用於 IPv4/IPv6 位址、FQDN,或是裝載於 Azure 外部的服務 (可以是內部部署或搭配不同主機服務提供者的服務)。External endpoints are used for IPv4/IPv6 addresses, FQDNs, or for services hosted outside Azure that can either be on-premises or with a different hosting provider.
  • 嵌套的端點是用來結合流量管理員的設定檔,以建立更有彈性的流量路由配置,以支援更大型且更複雜部署的需求。Nested endpoints are used to combine Traffic Manager profiles to create more flexible traffic-routing schemes to support the needs of larger, more complex deployments.

在單一流量管理員設定檔中結合不同類型的端點的方式不受限。There is no restriction on how endpoints of different types are combined in a single Traffic Manager profile. 每個設定檔可以包含任意混合的端點類型。Each profile can contain any mix of endpoint types.

下列各節會更深入說明每個端點類型。The following sections describe each endpoint type in greater depth.

Azure 端點Azure endpoints

在流量管理員中,Azure 端點用於以 Azure 為基礎的服務。Azure endpoints are used for Azure-based services in Traffic Manager. 支援下列的 Azure 資源類型︰The following Azure resource types are supported:

  • PaaS 雲端服務PaaS cloud services.
  • Web 應用程式Web Apps
  • Web 應用程式位置Web App Slots
  • PublicIPAddress 資源 (可以直接或透過 Azure Load Balancer 連接至 VM)。PublicIPAddress resources (which can be connected to VMs either directly or via an Azure Load Balancer). PublicIpAddress 必須已獲指派 DNS 名稱,才能在流量管理員設定檔中使用。The publicIpAddress must have a DNS name assigned to be used in a Traffic Manager profile.

PublicIPAddress 資源是 Azure Resource Manager 資源。PublicIPAddress resources are Azure Resource Manager resources. 它們不存在於傳統部署模型中。They do not exist in the classic deployment model. 因此,僅在流量管理員的 Azure Resource Manager 經驗中才支援。Thus they are only supported in Traffic Manager's Azure Resource Manager experiences. 透過 Resource Manager 和傳統部署模型可支援其他端點類型。The other endpoint types are supported via both Resource Manager and the classic deployment model.

使用 Azure 端點時,流量管理員會偵測 Web 應用程式何時停止和啟動。When using Azure endpoints, Traffic Manager detects when a Web App is stopped and started. 此狀態會反映在端點狀態中。This status is reflected in the endpoint status. 如需詳細資訊,請參閱流量管理員端點監視See Traffic Manager endpoint monitoring for details. 當基礎服務停止時,流量管理員不會執行端點健康情況檢查或將流量導向端點。When the underlying service is stopped, Traffic Manager does not perform endpoint health checks or direct traffic to the endpoint. 已停止的執行個體不會產生流量管理員計費事件。No Traffic Manager billing events occur for the stopped instance. 重新啟動服務時,計費會繼續,端點也能夠接收流量。When the service is restarted, billing resumes and the endpoint is eligible to receive traffic. 這項偵測並不適用於 PublicIpAddress 端點。This detection does not apply to PublicIpAddress endpoints.

外部端點External endpoints

外部端點會用於 IPv4/IPv6 位址、Fqdn 或 Azure 外部的服務。External endpoints are used for either IPv4/IPv6 addresses, FQDNs, or for services outside of Azure. 使用 IPv4/IPv6 位址端點可讓流量管理員無需端點的 DNS 名稱便能檢查端點的健康情況。Use of IPv4/IPv6 address endpoints allows traffic manager to check the health of endpoints without requiring a DNS name for them. 如此一來,流量管理員便可以在於回應中傳回該端點時,回應具有 A/AAAA 記錄的查詢。As a result, Traffic Manager can respond to queries with A/AAAA records when returning that endpoint in a response. Azure 外部的服務可以包含在內部部署託管或具有不同提供者的服務。Services outside of Azure can include a service hosted on-premises or with a different provider. 外部端點可以單獨使用,或在相同的流量管理員設定檔中與 Azure 端點結合使用 (指定為 IPv4 或 IPv6 位址的端點除外,因為它們只能作為外部端點)。External endpoints can be used individually or combined with Azure Endpoints in the same Traffic Manager profile except for endpoints specified as IPv4 or IPv6 addresses which can only be external endpoints. 結合 Azure 端點與外部端點可以解決各種情況:Combining Azure endpoints with External endpoints enables various scenarios:

  • 使用 Azure 以主動-主動或主動-被動容錯移轉模式,為現有的內部部署應用程式提供提升的備援性。Provide increased redundancy for an existing on-premises application in either an active-active or active-passive failover model using Azure.
  • 將流量路由至沒有與其相關聯之 DNS 名稱的端點。Route traffic to endpoints that do not have a DNS name associated with them. 此外,透過移除執行第二個 DNS 查詢以取得回傳 DNS 名稱之 IP 位址的需求,來減少整體的 DNS 查詢延遲。In addition, decrease the overall DNS lookup latency by removing the need to run a second DNS query to get an IP address of a DNS name returned.
  • 在 Azure 中為世界各地的使用者提供更低的應用程式延遲,並將現有的內部部署應用程式延伸至其他地理位置。Reduce application latency for users around the world, extend an existing on-premises application to additional geographic locations in Azure. 如需詳細資訊,請參閱流量管理員「效能」流量路由For more information, see Traffic Manager 'Performance' traffic routing.
  • 使用 Azure 以連續方式或「高載至雲端」解決方案來因應需求遽增的情形,來為現有的內部部署應用程式提供額外容量。Provide additional capacity for an existing on-premises application, either continuously or as a 'burst-to-cloud' solution to meet a spike in demand using Azure.

在某些情況下,使用外部端點來參考 Azure 服務很實用 (如需範例,請參閱常見問題集)。In certain cases, it is useful to use External endpoints to reference Azure services (for examples, see the FAQ). 在此情況下,健康情況檢查是以 Azure 端點費率計費 (而不是外部端點費率)。In this case, health checks are billed at the Azure endpoints rate, not the External endpoints rate. 但是,不同於 Azure 端點,如果您停止或刪除基礎服務,健康檢查會持續計費,直到您在流量管理員中停用或刪除端點為止。However, unlike Azure endpoints, if you stop or delete the underlying service, health check billing continues until you disable or delete the endpoint in Traffic Manager.

巢狀端點Nested endpoints

巢狀端點結合多個流量管理員設定檔,以建立有彈性的流量路由配置,並支援更大型和更複雜部署的需求。Nested endpoints combine multiple Traffic Manager profiles to create flexible traffic-routing schemes and support the needs of larger, complex deployments. 透過巢狀端點,「子」設定檔會當做端點新增至「父」設定檔。With Nested endpoints, a 'child' profile is added as an endpoint to a 'parent' profile. 子設定檔和父設定檔都可以包含任何類型的其他端點,包括其他巢狀設定檔。Both the child and parent profiles can contain other endpoints of any type, including other nested profiles. 如需詳細資訊,請參閱 巢狀流量管理員設定檔For more information, see nested Traffic Manager profiles.

Web Apps 做為端點Web Apps as endpoints

將 Web Apps 設定為流量管理員中的端點時,適用其他一些考量:Some additional considerations apply when configuring Web Apps as endpoints in Traffic Manager:

  1. 只有「標準」SKU 或更高的 Web Apps 才能搭配流量管理員使用。Only Web Apps at the 'Standard' SKU or above are eligible for use with Traffic Manager. 嘗試新增較低 SKU 的 Web 應用程式會失敗。Attempts to add a Web App of a lower SKU fail. 將現有 Web 應用程式的 SKU 降級,將會導致流量管理員不再將流量傳送到該 Web 應用程式。Downgrading the SKU of an existing Web App results in Traffic Manager no longer sending traffic to that Web App. 如需支援計劃相關的詳細資訊,請參閱 App Service 方案For more information on supported plans see the App Service Plans
  2. 當端點收到 HTTP 要求時,它會使用要求中的 'host’ 標頭來決定哪個 Web 應用程式應該處理要求。When an endpoint receives an HTTP request, it uses the 'host' header in the request to determine which Web App should service the request. Host 標頭包含用來起始要求的 DNS 名稱,例如 'contosoapp.azurewebsites.net'。The host header contains the DNS name used to initiate the request, for example 'contosoapp.azurewebsites.net'. 若要讓 Web 應用程式使用不同的 DNS 名稱,此 DNS 名稱必須註冊為該應用程式的自訂網域名稱。To use a different DNS name with your Web App, the DNS name must be registered as a custom domain name for the App. 將 Web 應用程式端點新增為 Azure 端點時,將會自動為該應用程式註冊流量管理員設定檔 DNS 名稱。When adding a Web App endpoint as an Azure endpoint, the Traffic Manager profile DNS name is automatically registered for the App. 刪除端點時,會自動移除此註冊。This registration is automatically removed when the endpoint is deleted.
  3. 每個流量管理員設定檔最多可以有來自每個 Azure 區域的一個 Web 應用程式端點。Each Traffic Manager profile can have at most one Web App endpoint from each Azure region. 若要克服此限制,您可以將 Web 應用程式設定為外部端點。To work around for this constraint, you can configure a Web App as an External endpoint. 如需詳細資訊,請參閱常見問題集For more information, see the FAQ.

啟用和停用端點Enabling and disabling endpoints

在流量管理員中停用端點,有利於從處於維護模式或正在重新部署的端點中暫時移除流量。Disabling an endpoint in Traffic Manager can be useful to temporarily remove traffic from an endpoint that is in maintenance mode or being redeployed. 一旦端點再次執行,即可重新啟用。Once the endpoint is running again, it can be re-enabled.

可透過流量管理員入口網站、PowerShell、CLI 或 REST API 來啟用和停用端點。Endpoints can be enabled and disabled via the Traffic Manager portal, PowerShell, CLI or REST API.


停用 Azure 端點會與其在 Azure 中的部署狀態無關。Disabling an Azure endpoint has nothing to do with its deployment state in Azure. Azure 服務 (例如,VM 或 Web 應用程式) 即使在流量管理員中停用,仍會持續執行,且能夠接收流量。An Azure service (such as a VM or Web App remains running and able to receive traffic even when disabled in Traffic Manager. 流量可以直接定址到服務執行個體,而不必透過流量管理員設定檔 DNS 名稱。Traffic can be addressed directly to the service instance rather than via the Traffic Manager profile DNS name. 如需詳細資訊,請參閱 流量管理員的運作方式For more information, see how Traffic Manager works.

目前,每個端點接收流量的能力取決於下列因素︰The current eligibility of each endpoint to receive traffic depends on the following factors:

  • 設定檔狀態 (啟用/停用)The profile status (enabled/disabled)
  • 端點狀態 (啟用/停用)The endpoint status (enabled/disabled)
  • 該端點的健康情況檢查結果The results of the health checks for that endpoint

如需詳細資訊,請參閱 流量管理員端點監視For details, see Traffic Manager endpoint monitoring.


由於流量管理員是在 DNS 層級上運作,所以無法影響任何端點的現有連線。Since Traffic Manager works at the DNS level, it is unable to influence existing connections to any endpoint. 當端點無法使用時,流量管理員會將新連接導向另一個可用的端點。When an endpoint is unavailable, Traffic Manager directs new connections to another available endpoint. 不過,已停用或狀況不良端點背後的主機可透過現有的連接來繼續接收流量,直到這些工作階段終止為止。However, the host behind the disabled or unhealthy endpoint may continue to receive traffic via existing connections until those sessions are terminated. 應用程式應該限制工作階段持續時間,以排光現有連接的流量。Applications should limit the session duration to allow traffic to drain from existing connections.

如果設定檔中的所有端點都已停用,或設定檔本身已停用,流量管理員會傳送 'NXDOMAIN' 回應給新的 DNS 查詢。If all endpoints in a profile are disabled, or if the profile itself is disabled, then Traffic Manager sends an 'NXDOMAIN' response to a new DNS query.


後續步驟Next steps