Task and expected outcome
I have the following outbound policies in Azure API Management. The first removes a header if it exists and the second returns the Certificate expiration date/time (which I was using for testing).
Problem
There were several headers being removed initially, but I found that some of my custom outbound headers were disappearing.
It seems to be the policy immediately following the delete action that is being skipped. I have tried changing the order and the issue persists. I have also tried changing the delete action by adding a separate closing tag instead of self-closing, but that didn't work either.
I also removed and recreated the API from API Management and the issue remained.
Code and question
Is this due to a syntax error in my code?
<outbound>
<base />
<set-header name="x-ms-workflow-name" exists-action="delete" />
<set-header name="Certificate-Expiration" exists-action="override">
<value>@{
var response = context.Request.Certificate.NotAfter;
return response.ToString();
}</value>
</set-header>
<set-header name="Certificate-Thumbprint" exists-action="override">
<value>@{
var response = context.Request.Certificate.Thumbprint;
return response.ToString();
}</value>
</set-header>
<set-header name="Certificate-Subject" exists-action="override">
<value>@{
var response = context.Request.Certificate.PublicKey.Key.ToXmlString(false);
return response.ToString();
}</value>
</set-header>
</outbound>

