Special characters in api policy

Hi

I’m facing an issue when trying to create a api policy

Here’s a snippet from my Terraform file:

policy {
xml_content =<<EOT
<policies>
<inbound>
<set-variable name=“body” value="@(context.Request.Body.As<string>(preserveContent: true))"/>

</policies>
EOT
}

And here’s the error I face when trying to apply my TF state:

  • azurerm_api_management.vdp_apim: Error setting Policies for API Management Service “vdp-dummy2” (Resource Group “vdp-az-api”): apimanagement.PolicyClient#CreateOrUpdate: Failure responding to request: StatusCode=400 – Original Error: autorest/azure: Service returned an error. Status=400 Code=“ValidationError” Message=“One or more fields contain incorrect values:” Details=[{“code”:“ValidationError”,“message”:"’\u003c’, hexadecimal value 0x3C, is an invalid attribute character. Line 3, position 67.",“target”:“representation”}]*

The only place in my policy definition where I have the < and > characters is in this place where I try to store the body (except for all the start and end tags).
Should these two characters be escaped in some way since they’re inside a start and end tag/character?

/R