Set-AzTrafficManagerProfile
Updates a Traffic Manager profile.
Syntax
Default (Default)
Set-AzTrafficManagerProfile
-TrafficManagerProfile <TrafficManagerProfile>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Set-AzTrafficManagerProfile cmdlet updates an Azure Traffic Manager profile. This cmdlet updates the settings of the profile from a local profile object. You can specify the profile object either by using the TrafficManagerProfile parameter or by using the pipeline.
You can obtain a local object that represents a profile by using the Get-AzTrafficManagerProfile cmdlet. Modify the object locally and then use Set-AzTrafficManagerProfile to commit your changes.
Examples
Example 1: Update a profile
$TrafficManagerProfile = Get-AzTrafficManagerProfile -Name "ContosoProfile" -ResourceGroupName "ResourceGroup11"
$TrafficManagerProfile.ProfileStatus = "Disabled"
Set-AzTrafficManagerProfile -TrafficManagerProfile $TrafficManagerProfile
The first command gets an Azure Traffic Manager profile by using the Get-AzTrafficManagerProfile cmdlet. The command stores the profile locally in the $TrafficManagerProfile variable.
The second command changes that profile locally. This command disables the profile.
The third command updates the Traffic Manager profile named ContosoProfile to match the local value in $TrafficManagerProfile.
Parameters
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.
Parameter properties
Type: | IAzureContextContainer |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-TrafficManagerProfile
Specifies a local TrafficManagerProfile object. This cmdlet updates Traffic Manager to match this local object.
Parameter properties
Type: | TrafficManagerProfile |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | True |
Value from pipeline: | True |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.