title: Redirect to a different sub-domain from Outlook add-in page
body: <p>I'm currently working on the modification to our Outlook Add-In that requires redirecting a user to a different sub-domain depending on which region the user belongs to. The sub-domain page loads with an office.js exception: </p>
  
  <blockquote>
    <p>Function <code>ContextActivationManager_getAppContextAsync</code> call failed. ErrorCode is <code>-2</code>, exception: <code>Failed origin check</code></p>
  </blockquote>
  
  <p>Our setup looks like this:</p>
  
  <ul>
  <li><p><code>https://outlook.company.com</code> - the domain hosts all urls from the add-in manifest file such as <code>functionFile</code>, <code>composeTaskPane</code> and <code>readTaskPaneUrl</code></p></li>
  <li><p><code>https://outlook.subdomain.company.com</code> - that's the sub-domain user is redirected to from <code>readTaskPaneUrl</code> for example. The page also references office.js and allows THE user to perform all regular add-in actions.</p></li>
  </ul>
  
  <p>Adding subdomain URL to the <code>AppDomains</code> section of the manifest file works fine. But we'd like to avoid that to have the flexibility of adding new sub-domains without re-publishing the add-in. Is there a way to resolve this?</p>