Set-AzureRmTrafficManagerProfile
Updates a Traffic Manager profile.
Warning
The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.
Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.
Syntax
Set-AzureRmTrafficManagerProfile
-TrafficManagerProfile <TrafficManagerProfile>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Set-AzureRmTrafficManagerProfile 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-AzureRmTrafficManagerProfile cmdlet. Modify the object locally and then use Set-AzureRmTrafficManagerProfile to commit your changes.
Examples
Example 1: Update a profile
PS C:\>$TrafficManagerProfile = Get-AzureRmTrafficManagerProfile -Name "ContosoProfile" -ResourceGroupName "ResourceGroup11"
PS C:\> $TrafficManagerProfile.ProfileStatus = Disabled
PS C:\> Set-AzureRmTrafficManagerProfile -TrafficManagerProfile $TrafficManagerProfile
The first command gets an Azure Traffic Manager profile by using the Get-AzureRmTrafficManagerProfile 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.
Type: | IAzureContextContainer |
Aliases: | AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TrafficManagerProfile
Specifies a local TrafficManagerProfile object. This cmdlet updates Traffic Manager to match this local object.
Type: | TrafficManagerProfile |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Inputs
Microsoft.Azure.Commands.Network.TrafficManagerProfile
This cmdlet accepts a TrafficManagerProfile object.
Outputs
Microsoft.Azure.Commands.Network.TrafficManagerProfile
This cmdlet returns a TrafficManagerProfile object.