Set-AzureTrafficManagerProfile

Updates the properties of a Traffic Manager profile.

Note

The cmdlets referenced in this documentation are for managing legacy Azure resources that use Azure Service Manager (ASM) APIs. This legacy PowerShell module isn't recommended when creating new resources since ASM is scheduled for retirement. For more information, see Azure Service Manager retirement.

The Az PowerShell module is the recommended PowerShell module for managing Azure Resource Manager (ARM) resources with PowerShell.

Syntax

Set-AzureTrafficManagerProfile
   [-Name <String>]
   [-LoadBalancingMethod <String>]
   [-MonitorPort <Int32>]
   [-MonitorProtocol <String>]
   [-MonitorRelativePath <String>]
   [-Ttl <Int32>]
   -TrafficManagerProfile <IProfileWithDefinition>
   [-Profile <AzureSMProfile>]
   [<CommonParameters>]

Description

The Set-AzureTrafficManagerProfile cmdlet updates the properties of a Microsoft Azure Traffic Manager profile.

For profiles for which you have set the LoadBalancingMethod value to "Failover", you can determine the failover order of the endpoints you have added to your profile with the Add-AzureTrafficManagerEndpoint cmdlet. For more information, see Example 3 below.

Examples

Example 1: Set the TTL for a Traffic Manager profile

PS C:\>Set-AzureTrafficManagerProfile -TrafficManagerProfile $MyTrafficManagerProfile -Ttl 60

This command sets the TTL to 60 seconds for the Traffic Manager profile object MyTrafficManagerProfile.

Example 2: Set several values for a profile

PS C:\>Get-AzureTrafficManagerProfile -Name "MyProfile" | Set-AzureTrafficManagerProfile -LoadBalancingMethod "RoundRobin" -Ttl 30 -MonitorProtocol "Http" -MonitorPort 80 -MonitorRelativePath "/"

This command gets a Traffic Manager profile named MyProfile by using the Get-AzureTrafficManagerProfile cmdlet. The profile uses the RoundRobin load balancing method, a TTL of 30 seconds, the monitor protocol HTTP, the monitor port, and the relative path for a Traffic Manager profile.

Example 3: Reorder endpoints to desired failover order

PS C:\>$Profile = Get-AzureTrafficManagerProfile -Name "MyProfile"
PS C:\> $Profile.Endpoints[0],$Profile.Endpoints[1] = $Profile.Endpoints[1],$Profile.Endpoints[0]
PS C:\> $Profile = Set-AzureTrafficManagerProfile

This example reorders the endpoints added to MyProfile to the desired failover order.

The first command gets the Traffic Manager profile object named MyProfile and stores the object in the $Profile variable.

The second command re-orders the endpoints from the endpoints array to the order in which failover should occur.

The last command updates the Traffic Manager profile stored in $Profile with the new endpoint order.

Parameters

-LoadBalancingMethod

Specifies the load balancing method to use to distribute the connection. Valid values are:

  • Performance
  • Failover
  • RoundRobin
Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MonitorPort

Specifies the port used to monitor endpoint health. Valid values are integer values greater than 0 and less than or equal to 65,535.

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

-MonitorProtocol

Specifies the protocol to use to monitor endpoint health. Valid values are:

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

-MonitorRelativePath

Specifies the path relative to the endpoint domain name to probe for health state. The path must meet the following restrictions:

  • The path must be from 1 through 1000 characters.
  • It must start with a forward slash, /.
  • It must contain no XML elements, <>.
  • It must contain no double slashes, //.
  • It must contain no invalid HTML escape characters. For example, %XY.
Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of the Traffic Manager profile to update.

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

-Profile

Specifies the Azure profile from which this cmdlet reads. If you do not specify a profile, this cmdlet reads from the local default profile.

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

-TrafficManagerProfile

Specifies the Traffic Manager profile object you use to set the profile.

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

-Ttl

Specifies the DNS Time-to-Live (TTL) that informs the Local DNS resolvers how long to cache DNS entries. Valid values are an integer from 30 through 999,999.

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

Outputs

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

This cmdlet generates a Traffic Manager profile object.