Add-AzTrafficManagerCustomHeaderToEndpoint
Adds custom header information to a local Traffic Manager endpoint object.
Note
This is the previous version of our documentation. Please consult the most recent version for up-to-date information.
Syntax
Add-AzTrafficManagerCustomHeaderToEndpoint
-Name <String>
-Value <String>
-TrafficManagerEndpoint <TrafficManagerEndpoint>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Add-AzTrafficManagerCustomHeaderToEndpoint cmdlet adds custom header information to a local Azure Traffic Manager endpoint object. You can get an endpoint by using the New-AzTrafficManagerEndpoint or Get-AzTrafficManagerEndpoint cmdlets.
This cmdlet operates on the local endpoint object. Commit your changes to the endpoint for Traffic Manager by using the Set-AzTrafficManagerEndpoint cmdlet.
Examples
Example 1: Add custom header information to an endpoint
PS C:\> $TrafficManagerEndpoint = New-AzTrafficManagerEndpoint -EndpointStatus Enabled -Name "contoso" -ProfileName "ContosoProfile" -ResourceGroupName "ResourceGroup11" -Type AzureEndpoints -Priority 1 -TargetResourceId "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/Default-Web-CentralUS/providers/Microsoft.Web/sites/contoso-web-app" -Weight 10
PS C:\> Add-AzTrafficManagerCustomHeaderToEndpoint -TrafficManagerEndpoint $TrafficManagerEndpoint -Name "host" -Value "www.contoso.com"
PS C:\> Set-AzTrafficManagerEndpoint -TrafficManagerEndpoint $TrafficManagerEndpoint
The first command creates an Azure Traffic Manager endpoint by using the New-AzTrafficManagerEndpoint cmdlet. The command stores the local endpoint in the $TrafficManagerEndpoint variable. The second command adds custom header information to the endpoint stored in $TrafficManagerEndpoint. The final command updates the endpoint in Traffic Manager to match the local value in $TrafficManagerEndpoint.
Parameters
Prompts you for confirmation before running the cmdlet.
| Type: | SwitchParameter |
| Aliases: | cf |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with azure.
| Type: | IAzureContextContainer |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies the name of the custom header information to be added.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Specifies a local TrafficManagerEndpoint object. This cmdlet modifies this local object. To obtain a TrafficManagerEndpoint object, use the Get-AzTrafficManagerEndpoint or New-AzTrafficManagerEndpoint cmdlet.
| Type: | TrafficManagerEndpoint |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | True |
| Accept wildcard characters: | False |
Specifies the value of the custom header information to be added.
| Type: | String |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
| Type: | SwitchParameter |
| Aliases: | wi |
| Position: | Named |
| Default value: | None |
| Accept pipeline input: | False |
| Accept wildcard characters: | False |