title: How to terminate a Durable orchestration with custom status in Azure Durable Functions
body: <p>I have a Durable Function, with the rough outline as shown in the code block below.
  If I end up in the else section, it is because of a functional issue (in this case, because I don't have authentication details cached).  And I would like to &quot;self-terminate&quot; the current instance of my orchestration.  I can do this by throwing an exception, but I would like to find a cleaner way (if there is) to terminate the active instance with a friendly message, indicating the reason for the Termination.</p>
  <p>Is this possible, and if yes, how?</p>
  <pre class="lang-cs prettyprint-override"><code>[FunctionName(nameof(UserHistorySyncWorkflow))]
  public async Task&lt;List&lt;Match&gt;&gt; RunOrchestrator(
    [OrchestrationTrigger] IDurableOrchestrationContext orchestrationContext, ILogger logger)
  {
    if(CanConnect())
    {
      // Call Activity function and return results
    }
    else
    {
      // How to gracefully Terminate here?
    }
  }
  </code></pre>