title: How can I restart an Azure App Service instance programmatically?
body: <p>I have a set of Azure App Services which occasionally have single instances that become unhealthy. We've identified that restarting that specific instance via Advanced Diagnostics brings the instance back up.</p>
  
  <p>We'd like to build some automation such that once this unhealthy instance is detected, we will automatically go and restart that instance. Note that we only want to restart the unhealthy <em>instance</em>, not the entire App Service. </p>
  
  <p>We have found the following method:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public static Task RestartAsync(
    this IWebAppsOperations operations, 
    string resourceGroupName, 
    string name, 
    bool? softRestart = null, 
    bool? synchronous = null, 
    CancellationToken cancellationToken = default
  );
  </code></pre>
  
  <p>Under the <code>Microsoft.Azure.Management.AppService.Fluent</code> namespaces <code>WebAppsOperationsExtensions</code> class, and similar methods in the non-Fluent ARM library. However, these only allow us to restart the entire App Service. We want to minimise disruption and only target a specific instance with the restart.</p>
  
  <p>Is there a mechanism through either a .NET library, or a REST API (where we would build the request ourselves) which will allow us to restart a single App Service instance?</p>