title: Why would a previously stable and working Liquid template fail after the most recent Azure API Management upgrade?
body: <p>We have an Azure API Management endpoint that receives requests in the following format:</p>
  <pre><code>{
      &quot;messageType&quot;: &quot;EVENT&quot;,
      &quot;eventData&quot;: {
          &quot;installedApp&quot;: {
              &quot;installedAppId&quot;: &quot;xxx&quot;,
              &quot;locationId&quot;: &quot;yyy&quot;
          },
          &quot;events&quot;: [
              {
                  &quot;eventTime&quot;: &quot;2020-11-13T13:14:50.8011105+00:00&quot;,
                  &quot;eventType&quot;: &quot;DEVICE_EVENT&quot;,
                  &quot;deviceEvent&quot;: {
                      &quot;eventId&quot;: &quot;3a08b3f3-25b1-11eb-962f-975d499d1166&quot;,
                      &quot;locationId&quot;: &quot;yyy&quot;,
                      &quot;ownerId&quot;: &quot;a975533a-a1ae-49f7-88f1-94368bd4d605&quot;,
                      &quot;ownerType&quot;: &quot;LOCATION&quot;,
                      &quot;deviceId&quot;: &quot;c3fdc7c6-08f2-4ba3-92b3-0cdfa2b141f5&quot;,
                      &quot;componentId&quot;: &quot;main&quot;,
                      &quot;capability&quot;: &quot;motionSensor&quot;,
                      &quot;attribute&quot;: &quot;motion&quot;,
                      &quot;value&quot;: &quot;inactive&quot;,
                      &quot;valueType&quot;: &quot;string&quot;,
                      &quot;stateChange&quot;: true,
                      &quot;data&quot;: {},
                      &quot;subscriptionName&quot;: &quot;all_motion_sub&quot;
                  }
              }
          ]
      }
  }
  </code></pre>
  <p>It passes them through a Liquid template:</p>
  <pre><code>&lt;set-body template=&quot;liquid&quot;&gt;{
      &quot;id&quot;: &quot;{{context.Variables[&quot;RequestId&quot;]}}&quot;,
      &quot;API&quot;: &quot;SmartThings&quot;,
      &quot;InstalledAppId&quot;: &quot;{{body.eventData.installedApp.installedAppId}}&quot;,
      &quot;LocationId&quot;: &quot;{{body.eventData.installedApp.locationId}}&quot;,
      &quot;DeviceEvents&quot;:[
          {% assign device_events = body.eventData.events | Where: &quot;eventType&quot;, &quot;DEVICE_EVENT&quot; %}
          {% JSONArrayFor event in device_events %}
          {
              &quot;EventId&quot;: &quot;{{event.deviceEvent.eventId}}&quot;,
              &quot;LocationId&quot;: &quot;{{event.deviceEvent.locationId}}&quot;,
              &quot;DeviceId&quot;: &quot;{{event.deviceEvent.deviceId}}&quot;,
              &quot;ComponentId&quot;: &quot;{{event.deviceEvent.componentId}}&quot;,
              &quot;Capability&quot;: &quot;{{event.deviceEvent.capability}}&quot;,
              &quot;Attribute&quot;: &quot;{{event.deviceEvent.attribute}}&quot;,
              &quot;Value&quot;: &quot;{{event.deviceEvent.value}}&quot;,
              &quot;StateChange&quot;: {{event.deviceEvent.stateChange}},
              &quot;EventTime&quot;: &quot;{{event.eventTime | Date: &quot;yyyy-MM-ddTHH:mm:sszzz&quot; | Default: context.Variables[&quot;RequestDateTime&quot;] }}&quot;
          }
          {% endJSONArrayFor  %}
      ],
      &quot;EventTime&quot;: &quot;{{context.Variables[&quot;RequestDateTime&quot;]}}&quot;
  }&lt;/set-body&gt;
  </code></pre>
  <p>And generates an output which is sent to a Logic App for further processing:</p>
  <pre><code>{
      &quot;id&quot;: &quot;d5e2a032-14b3-40ca-9c6b-4e13f8d2285c&quot;,
      &quot;API&quot;: &quot;SmartThings&quot;,
      &quot;InstalledAppId&quot;: &quot;xxx&quot;,
      &quot;LocationId&quot;: &quot;yyy&quot;,
      &quot;DeviceEvents&quot;: [
          {
              &quot;EventId&quot;: &quot;3a08b3f3-25b1-11eb-962f-975d499d1166&quot;,
              &quot;LocationId&quot;: &quot;yyy&quot;,
              &quot;DeviceId&quot;: &quot;c3fdc7c6-08f2-4ba3-92b3-0cdfa2b141f5&quot;,
              &quot;ComponentId&quot;: &quot;main&quot;,
              &quot;Capability&quot;: &quot;motionSensor&quot;,
              &quot;Attribute&quot;: &quot;motion&quot;,
              &quot;Value&quot;: &quot;inactive&quot;,
              &quot;StateChange&quot;: true,
              &quot;EventTime&quot;: &quot;2020-11-13T13:14:50.8011105+00:00&quot;
          }
      ],
      &quot;EventTime&quot;: &quot;2020-11-13T13:14:50.8011105+00:00&quot;
  }
  </code></pre>
  <p>Until around 23:00Z on 11/11/2020, this worked as expected, and had been working in production for several months. Commencing at that time, the Liquid mapping began to fail, producing instead:</p>
  <pre><code>{
      &quot;id&quot;: &quot;2c93647c-f9ef-4747-adfb-985805a71f0c&quot;,
      &quot;API&quot;: &quot;SmartThings&quot;,
      &quot;InstalledAppId&quot;: &quot;xxx&quot;,
      &quot;LocationId&quot;: &quot;yyy&quot;,
      &quot;DeviceEvents&quot;: [
          {
              &quot;EventId&quot;: &quot;&quot;,
              &quot;LocationId&quot;: &quot;&quot;,
              &quot;DeviceId&quot;: &quot;&quot;,
              &quot;ComponentId&quot;: &quot;&quot;,
              &quot;Capability&quot;: &quot;&quot;,
              &quot;Attribute&quot;: &quot;&quot;,
              &quot;Value&quot;: &quot;&quot;,
              &quot;StateChange&quot;: ,
              &quot;EventTime&quot;: &quot;2020-11-13T13:14:50.8011105+00:00&quot;
          }
      ],
      &quot;EventTime&quot;: &quot;2020-11-13T13:14:50.8011105+00:00&quot;
  }
  </code></pre>
  <p>We have a scheduled maintenance event in the logs to 'Upgrade API Management' from midnight Thursday, so it looks like there was some kind of breaking change.</p>
  <p>What changed to cause this, and how do we go about fixing it?</p>