
How to Configure a “Healing” Rule
If your application experiences performance degradation or connectivity issues due to saturated sockets, you can configure Auto-Heal to monitor and restart the process before the app becomes unreachable:
-
Access the Portal: Go to your App Service in the Azure Portal.
-
Navigation: In the left-hand menu, select “Diagnose and solve problems”.
-
Tools: Select “Diagnostic Tools” and then click on “Auto-Heal”.
-
Define Conditions: Choose “Request Count”.
-
Configure Actions: Select “Recycle”.
-
Finalize: Click “Save” to apply the rule.
By setting this up, Azure will monitor the traffic patterns. If it detects an anomalous spike (which often precedes a socket lockout), it will automatically recycle the worker process to clear the connection table.
How to Remove an “Auto-Heal” Rule
Once the root cause (such as a non-singleton CosmosClient) is fixed, you may want to disable the automated recycling:
-
Locate the tool: Navigate back to Diagnose and solve problems > Auto-Heal.
-
Toggle Off: You will see a main toggle at the top (usually labeled “Enable Auto-Heal”).
-
Disable: Switch the toggle to Off (or Disabled). This immediately deactivates all saved rules.
-
Confirm: Remember to click “Save” at the bottom of the page to apply the changes.