Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot update traffic manager CustomHeader #1187

Closed
donma opened this issue Dec 22, 2020 · 0 comments · Fixed by #1188
Closed

Cannot update traffic manager CustomHeader #1187

donma opened this issue Dec 22, 2020 · 0 comments · Fixed by #1188
Assignees
Labels
Mgmt Management plane SDK related issues. Network - Traffic Manager

Comments

@donma
Copy link

donma commented Dec 22, 2020

Query/Question

I set a custom header test "testheader:I_AM_STRING" on the Azure portal.
I added new custom header is no problem, but I tried to update the header value to "app_edited".

            var trafficManagerProfile = azure.TrafficManagerProfiles.GetById("/subscriptions/xxxxxxxx-dddd-xxxx-ssss-ddddddddddddd/resourceGroups/spinus/providers/Microsoft.Network/trafficManagerProfiles/site1");

            var target = trafficManagerProfile.Update().UpdateExternalTargetEndpoint("client1")
                .WithCustomHeader("testheader", "app_edited").Parent().Apply();

I got error message

Unhandled exception. System.AggregateException: One or more errors occurred. (Duplicate custom header names for app_edited are not allowed.)
 ---> Microsoft.Rest.Azure.CloudException: Duplicate custom header names for app_edited are not allowed.
   at Microsoft.Azure.Management.TrafficManager.Fluent.EndpointsOperations.CreateOrUpdateWithHttpMessagesAsync(String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters, Dictionary`2 customHeaders, CancellationToken cancellationToken)
   at Microsoft.Azure.Management.TrafficManager.Fluent.EndpointsOperationsExtensions.CreateOrUpdateAsync(IEndpointsOperations operations, String resourceGroupName, String profileName, String endpointType, String endpointName, EndpointInner parameters, CancellationToken cancellationToken)
   at Microsoft.Azure.Management.TrafficManager.Fluent.TrafficManagerEndpointImpl.CreateAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Management.TrafficManager.Fluent.TrafficManagerEndpointImpl.UpdateAsync(CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at Microsoft.Azure.Management.TrafficManager.Fluent.TrafficManagerProfileImpl.UpdateResourceAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Management.TrafficManager.Fluent.TrafficManagerProfileImpl.CreateResourceAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Management.ResourceManager.Fluent.Core.ResourceActions.Creatable`4.Microsoft.Azure.Management.ResourceManager.Fluent.Core.ResourceActions.IResourceCreator<IResourceT>.CreateResourceAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Management.ResourceManager.Fluent.Core.DAG.CreatorTaskItem`1.ExecuteAsync(CancellationToken cancellationToken)
   at Microsoft.Azure.Management.ResourceManager.Fluent.Core.DAG.TaskGroupBase`1.ExecuteNodeTaskAsync(DAGNode`1 node, CancellationToken cancellationToken)
   at Microsoft.Azure.Management.ResourceManager.Fluent.Core.ResourceActions.CreatableUpdatable`5.ApplyAsync(CancellationToken cancellationToken, Boolean multiThreaded)
   at Microsoft.Azure.Management.ResourceManager.Fluent.Core.Extensions.Synchronize[TResult](Func`1 function)
   at Microsoft.Azure.Management.ResourceManager.Fluent.Core.ResourceActions.CreatableUpdatable`5.Apply()

Environment: .net core 3.1 + Microsoft.Azure.Management.Fluent 1.36.1

the error message on Azure portal

作業名稱
Create or Update a Traffic Manager External Endpoint
時間戳記
Tue Dec 22 2020 18:04:04 GMT+0800 (台北標準時間)
事件起始者
site1trafficmanager
錯誤碼
BadRequest
訊息
Duplicate custom header names for app_edited are not allowed.

thanks for help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mgmt Management plane SDK related issues. Network - Traffic Manager
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants