共用方式為


Add-AzTrafficManagerEndpointConfig

將端點新增至本機 流量管理員 配置檔物件。

Syntax

Add-AzTrafficManagerEndpointConfig
   -EndpointName <String>
   -TrafficManagerProfile <TrafficManagerProfile>
   -Type <String>
   [-TargetResourceId <String>]
   [-Target <String>]
   -EndpointStatus <String>
   [-Weight <UInt32>]
   [-Priority <UInt32>]
   [-EndpointLocation <String>]
   [-AlwaysServe <String>]
   [-MinChildEndpoints <UInt32>]
   [-MinChildEndpointsIPv4 <UInt32>]
   [-MinChildEndpointsIPv6 <UInt32>]
   [-GeoMapping <System.Collections.Generic.List`1[System.String]>]
   [-SubnetMapping <System.Collections.Generic.List`1[Microsoft.Azure.Commands.TrafficManager.Models.TrafficManagerIpAddressRange]>]
   [-CustomHeader <System.Collections.Generic.List`1[Microsoft.Azure.Commands.TrafficManager.Models.TrafficManagerCustomHeader]>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

Add-AzTrafficManagerEndpointConfig Cmdlet 會將端點新增至本機 Azure 流量管理員 配置文件物件。 您可以使用 New-AzTrafficManagerProfile 或 Get-AzTrafficManagerProfile Cmdlet 來取得配置檔。

此 Cmdlet 會在本機配置檔物件上運作。 使用 Set-AzTrafficManagerProfile Cmdlet,將變更認可至 流量管理員 配置檔。 若要在單一作業中建立端點並認可變更,請使用 New-AzTrafficManagerEndpoint Cmdlet。

範例

範例 1:將端點新增至配置檔

$TrafficManagerProfile = Get-AzTrafficManagerProfile -Name "ContosoProfile" -ResourceGroupName "ResourceGroup11"
Add-AzTrafficManagerEndpointConfig -EndpointName "contoso" -EndpointStatus Enabled -Target "www.contoso.com" -TrafficManagerProfile $TrafficManagerProfile -Type ExternalEndpoints -EndpointLocation "North Europe" -Priority 1 -Weight 10
Set-AzTrafficManagerProfile -TrafficManagerProfile $TrafficManagerProfile

第一個命令會使用 Get-AzTrafficManagerProfile Cmdlet 來取得 Azure 流量管理員 設定檔。 命令會將本機配置檔儲存在 $TrafficManagerProfile 變數中。

第二個命令會將名為 contoso 的端點新增至儲存在 $TrafficManagerProfile 中的配置檔。 此命令包含端點的組態數據。 此命令只會變更本機物件。

最後一個命令會更新 Azure 中的 流量管理員 配置檔,以符合 $TrafficManagerProfile 中的本機值。

參數

-AlwaysServe

如果已啟用 Always Serve,將會停用端點健全狀況探查,並將端點包含在流量路由方法中。

Type:String
Accepted values:Enabled, Disabled
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-CustomHeader

探查要求的自定義標頭名稱和值組清單。

Type:List<T>[TrafficManagerCustomHeader]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶。

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EndpointLocation

指定要在效能流量路由方法中使用的端點位置。 此參數僅適用於 ExternalEndpoints 或 NestedEndpoints 類型的端點。 使用效能流量路由方法時,您必須指定此參數。

指定 Azure 區域名稱。 如需 Azure 區域的完整清單,請參閱 Azure 區域http://azure.microsoft.com/regions/ (http://azure.microsoft.com/regions/)。

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EndpointName

指定此 Cmdlet 新增 流量管理員 端點的名稱。

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-EndpointStatus

指定端點的狀態。 有效值為:

  • 啟用
  • 停用

如果狀態為 [已啟用],則會探查端點健康情況,並包含在流量路由方法中。

Type:String
Accepted values:Enabled, Disabled
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-GeoMapping

使用「地理」流量路由方法時,對應至此端點的區域清單。 如需已接受值的完整清單,請參閱 流量管理員 檔

Type:List<T>[String]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MinChildEndpoints

子配置檔中必須可用的端點數目下限,才能將父配置檔中的巢狀端點視為可用。 僅適用於類型為 『NestedEndpoints』 的端點。

Type:Nullable<T>[UInt32]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MinChildEndpointsIPv4

子配置檔中必須有可用的 IPv4 (DNS 記錄類型 A) 端點數目下限,才能將父配置檔中的巢狀端點視為可用。 僅適用於類型為 『NestedEndpoints』 的端點。

Type:Nullable<T>[UInt32]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MinChildEndpointsIPv6

必須可在子配置檔中取得的 IPv6 (DNS 記錄類型 AAAA) 端點數目下限,才能將父配置檔中的巢狀端點視為可用。 僅適用於類型為 『NestedEndpoints』 的端點。

Type:Nullable<T>[UInt32]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Priority

指定 流量管理員 指派給端點的優先順序。 只有當已針對優先順序流量路由方法設定 流量管理員 配置檔時,才會使用此參數。 有效值為從 1 到 1000 的整數。 較低的值代表較高的優先順序。

如果您指定優先順序,則必須在配置檔中的所有端點上指定優先順序,而且兩個端點都不能共用相同的優先順序值。 如果您未指定優先順序,流量管理員 依配置檔列出端點的順序,將預設優先順序值指派給端點,從一個 (1) 開始。

Type:Nullable<T>[UInt32]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SubnetMapping

使用「子網」流量路由方法時,對應至此端點的位址範圍或子網清單。

Type:List<T>[TrafficManagerIpAddressRange]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Target

指定端點的完整 DNS 名稱。 流量管理員 將流量導向至此端點時,會在 DNS 回應中傳回此值。 僅針對 ExternalEndpoints 端點類型指定此參數。 針對其他端點類型,請改為指定 TargetResourceId 參數。

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-TargetResourceId

指定目標的資源識別碼。 僅針對 AzureEndpoints 和 NestedEndpoints 端點類型指定此參數。 針對 ExternalEndpoints 端點類型,請改為指定 Target 參數。

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-TrafficManagerProfile

指定本機 TrafficManagerProfile 物件。 此 Cmdlet 會修改此本機物件。 若要取得 TrafficManagerProfile 物件,請使用 Get-AzTrafficManagerProfile Cmdlet。

Type:TrafficManagerProfile
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Type

指定此 Cmdlet 新增至 Azure 流量管理員 設定檔的端點類型。 有效值為:

  • AzureEndpoints
  • ExternalEndpoints
  • NestedEndpoints
Type:String
Accepted values:AzureEndpoints, ExternalEndpoints, NestedEndpoints
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Weight

指定 流量管理員 指派給端點的權數。 有效值為從 1 到 1000 的整數。 預設值為一 (1)。 只有在使用加權流量路由方法設定 流量管理員 配置檔時,才會使用此參數。

Type:Nullable<T>[UInt32]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

輸入

TrafficManagerProfile

輸出

TrafficManagerProfile