Skip to content

Commit d289456

Browse files
Merge pull request #310340 from msangapu-msft/patch-25
Document Azure Storage mount health checks and recovery
2 parents 8553a85 + d19b3ee commit d289456

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

articles/app-service/includes/configure-azure-storage/azure-storage-linux-container-pivot.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,46 @@ To validate that the Azure Storage is mounted successfully for the app:
203203
tcpping Storageaccount.file.core.windows.net
204204
```
205205

206+
### Storage mount health checks and auto‑recovery
207+
208+
Azure App Service includes a built‑in health‑check mechanism to ensure that mounted Azure Storage volumes (Azure Files or Azure Blob) remain accessible and responsive. This system helps prevent application hangs caused by stale or disconnected storage mounts.
209+
210+
#### How the health check works
211+
212+
1. **Periodic I/O test**
213+
App Service periodically performs file I/O on a marker file named `__lastCheckTime.txt`.
214+
- **Location:** A `LogFiles` subdirectory under the mounted path (for example, `/mount/path/LogFiles/__lastCheckTime.txt`).
215+
- **Behavior:**
216+
- A read operation is attempted on this file.
217+
- The file does *not* need to exist—“file not found” is treated as a successful check.
218+
219+
2. **Frequency**
220+
The check runs every **5 seconds** by default.
221+
222+
3. **Failure handling**
223+
- Each failed or timed‑out check increments a *failed ping counter*.
224+
- When failures exceed the configured threshold:
225+
- **Azure Files:** 18 failed pings
226+
- **Azure Blob:** 15 failed pings
227+
- The mount is marked **Faulted**, and **App Service automatically restarts the app** to restore connectivity to the share.
228+
229+
#### Configuration via App Settings
230+
231+
You can customize health‑check behavior using the following app settings.
232+
233+
| Storage type | Setting name | Default value | Description |
234+
|--------------|--------------|---------------|-------------|
235+
| Azure Files | `WEBSITE_BYOS_FILES_HEALTH_CHECK_FREQUENCY` | `5` | Interval in seconds between health checks. |
236+
| Azure Files | `WEBSITE_BYOS_FILES_MAX_FAILED_PINGS` | `18` | Number of consecutive failures before marking the volume as faulted. |
237+
| Azure Files | `WEBSITE_BYOS_FILES_AUTO_RECOVERY_ENABLED` | `true` | Set to `false` to disable auto‑recovery logic. |
238+
| Azure Blob | `WEBSITE_BYOS_BLOB_HEALTH_CHECK_FREQUENCY` | `5` | Interval in seconds between health checks. |
239+
| Azure Blob | `WEBSITE_BYOS_BLOB_MAX_FAILED_PINGS` | `15` | Number of consecutive failures before marking the volume as faulted. |
240+
| Azure Blob | `WEBSITE_BYOS_BLOB_AUTO_RECOVERY_ENABLED` | `true` | Set to `false` to disable auto‑recovery logic. |
241+
242+
#### Notes
243+
- Auto‑recovery helps prevent long‑running application hangs caused by unresponsive storage paths.
244+
- Disabling auto‑recovery is not recommended unless troubleshooting specific mount behavior.
245+
206246
## Best practices
207247

208248
### Performance

0 commit comments

Comments
 (0)