title: Policy rewrite-uri To Append Context Variable in Azure APIM
body: <p>What is the approach to a simple append to the url of a context variable such as <code>context.Variables["accountKey"]</code> during a policy rewrite? </p>
  
  <p>The end result should be <code>/accounts/232</code>.</p>
  
  <p>I have success earlier in setting it</p>
  
  <pre><code>set-variable (0.003 ms)
  {
      "message": "Context variable was successfully set.",
      "name": "accountKey",
      "value": "232"
  }
  </code></pre>
  
  <p>One of the things tried:</p>
  
  <pre><code>&lt;policies&gt;
      &lt;inbound&gt;
          &lt;base /&gt;
          &lt;rewrite-uri template="/accounts/{accountKey}" /&gt;
      &lt;/inbound&gt;
  </code></pre>
  
  <p>But I get this error</p>
  
  <pre><code>&gt; Error Receive
  &gt;     rewrite-uri (0.260 ms) {
  &gt;     "messages": [
  &gt;         null,
  &gt;         "Variable accountKey has no value.",
  &gt;         "Variable accountKey has no value."
  &gt;     ] }
  </code></pre>