---
title: Troubleshooting local search indexes on Azure
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

This page describes solutions to issues related to [locally stored smart search indexes](https://docs.kentico.com/13/configuring-xperience/setting-up-search-on-your-website/using-locally-stored-search-indexes.md) when running Xperience applications on Azure.

## Deleting .lock files

### Quick fix

If the search functionality is not working properly, you can try deleting files with the **.lock** extension on the blob storage. Connect to your blob storage (for example through [Cloudberry for Azure](http://www.cloudberrylab.com/free-microsoft-azure-explorer.aspx)) and manually delete them.

### Explanation

A blob storage is shared between all instances of Xperience. If your Azure environment operates in multiple instances, it is important to prevent collisions. Therefore, to prevent multiple instances from manipulating the same index at the same time and ensure exclusive write operations, Xperience uses**locking**. Every time the smart search needs to manipulate a search index, it creates a special file with the **.lock** extension. This file indicates that a search indexer is working with the index. When the work is done, the system deletes the file from the storage.

There are two different lock files in the blob storage:

- **searchtaskindexer.lock** – located in the\*\~/App\_Data/CMSModules/SmartSearch\* directory.
- **write.lock** – located in the directory of specific search indexes.

In some cases, these lock files may not get deleted. This may happen when the process working with the search index ends unexpectedly. When this happens, processing of indexing tasks for locally stored indexes becomes stuck. The solution is to manually delete the lock files.

This problem may occur again if you store the search indexes on an external storage. For example, a [scaled-out instance](https://docs.kentico.com/13/deploying-websites/running-xperience-on-microsoft-azure/deploying-to-azure-web-apps/scaling-azure-web-apps.md) can unexpectedly terminate while working with an index file. To prevent this issue, you can [Configure the scheduler to process search tasks](#configuring-the-scheduler-to-process-search-tasks).

### Configuring the scheduler to process search tasks

Add the following key to the _appSettings_ section of your Xperience administration project's _web.config_ file:

```csharp

<add key="CMSProcessSearchTasksByScheduler" value="true" />

```

Make sure that the **Execute local search tasks** [scheduled task](https://docs.kentico.com/13/configuring-xperience/scheduling-tasks.md) is enabled and set to a reasonable value (for example one hour).
