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.
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 instance, not the entire App Service.
We have found the following method:
public static Task RestartAsync(
this IWebAppsOperations operations,
string resourceGroupName,
string name,
bool? softRestart = null,
bool? synchronous = null,
CancellationToken cancellationToken = default
);
Under the Microsoft.Azure.Management.AppService.Fluent
namespaces WebAppsOperationsExtensions
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.
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?