共用方式為


Set-AzureTrafficManagerEndpoint

更新 流量管理員 設定檔中端點的屬性。

注意

本文件中參考的 Cmdlet 用於管理使用 Azure Service Manager(ASM) API 的舊版 Azure 資源。 建立新的資源時,不建議使用此舊版 PowerShell 模組,因為 ASM 已排定淘汰。 如需詳細資訊,請參閱 Azure Service Manager 淘汰

Az PowerShell 模組是使用 PowerShell 管理 Azure Resource Manager (ARM) 資源的建議 PowerShell 模組。

語法

Set-AzureTrafficManagerEndpoint
   -DomainName <String>
   [-Location <String>]
   [-Type <String>]
   [-Status <String>]
   [-Weight <Int32>]
   [-MinChildEndpoints <Int32>]
   -TrafficManagerProfile <IProfileWithDefinition>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]

Description

Set-AzureTrafficManagerEndpoint Cmdlet 會更新 Microsoft Azure 流量管理員 配置檔中的端點屬性。 如果端點不存在於目前的配置檔中,此 Cmdlet 會建立它。 新增端點之後,請使用管線運算符,將結果傳遞至 Set-AzureTrafficManagerProfile Cmdlet。 該 Cmdlet 會連線到 Azure 以儲存變更。

範例

範例 1:更新配置檔的端點

PS C:\>$TrafficManagerProfile = Get-AzureTrafficManagerProfile -Name "ContosoProfile"
PS C:\> Set-AzureTrafficManagerEndpoint -TrafficManagerProfile $TrafficManagerProfile -DomainName "ContosoApp02.cloudapp.net" -Status "Enabled" -Type "CloudService" -Weight 2 -Location myLocation | Set-AzureTrafficManagerProfile

第一個命令會使用 Get-AzureTrafficManagerProfile Cmdlet 來取得名為 ContosoProfile 的配置檔,然後將它儲存在$TrafficManagerProfile變數中。

第二個命令會更新儲存在 $TrafficManagerProfile 流量管理員 配置檔中的端點。 端點具有域名 ContosoApp02.cloudapp.net。 此命令也會指定端點的狀態、類型、權數和位置。 此命令會將修改過的配置檔傳遞至 Set-AzureTrafficManagerProfile Cmdlet,以連線到 Azure 以儲存變更。

參數

-DomainName

指定要修改之端點的功能變數名稱。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Location

指定 Cmdlet 新增的端點位置。 這必須是 Azure 位置。

此參數必須包含類型為 「Any」 或類型 「TrafficManager」 之端點的值,該配置檔的負載平衡方法設定為 「效能」。 可能的值為 Azure 區域名稱,如 所列。https://azure.microsoft.com/regions/https://azure.microsoft.com/regions/

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-MinChildEndpoints

指定巢狀配置檔在在線必須有的端點數目下限,此端點才能視為在線。

類型:Int32
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Profile

指定此 Cmdlet 從中讀取的 Azure 設定檔。 如果您未指定設定檔,此 Cmdlet 會從本機預設配置檔讀取。

類型:AzureSMProfile
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Status

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

  • 啟用
  • 停用

如果您指定 Enabled 的值,流量管理員 監視端點,並在管理流量時考慮負載平衡方法。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-TrafficManagerProfile

指定要修改端點的 流量管理員 設定檔物件。

類型:IProfileWithDefinition
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-Type

指定端點的類型。 有效值為:

  • CloudService

  • AzureWebsite

  • TrafficManager

  • 任意

如果有多個 AzureWebsite 端點,端點必須位於不同的數據中心。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Weight

指定 Cmdlet 所新增端點的權數。 此參數的有效值範圍是 [1,1000]。

此參數僅用於 RoundRobin 負載平衡原則。

類型:Int32
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸出

Microsoft.WindowsAzure.Commands.Utilities.TrafficManager.Models.IProfileWithDefinition

此 Cmdlet 會產生 流量管理員 配置檔物件,其中包含更新配置檔的相關信息。