Configuring an index for Azure AI Search
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 201
Description
See the discussion [here](https://github.com/dotnet/aspire/pull/2070#discussion_r1505375084).
Today the `Aspire.Azure.Search.Documents` component only adds a `SearchIndexClient` to the application because it doesn't know the name of the index the application is working with. Similarly, for its health check, it is using `GetServiceStatisticsAsync` to check if the connection is healthy.
https://github.com/dotnet/aspire/blob/1c7e051c0c120d16574f727a1f49c9e57ea4cc38/src/Components/Aspire.Azure.Search.Documents/AzureSearchIndexHealthCheck.cs#L21-L27
(See also https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/issues/2156).
We should consider adding a `string? SearchIndexName` in the settings so applications can be configured with a specific index. Setting this would make the health check use the standard `AzureSearchHealthCheck`, which takes an index name.
We could also consider adding a `SearchClient` (which needs an index name) to DI, either in the existing `AddAzureSearch` method, or from a new extension method which ensured the `SearchIndexName` property was set.
Contributor guide
Research direction
Start with src/Components/Aspire.Azure.Search.Documents/AzureSearchIndexHealthCheck.cs and the existing AddAzureSearch method. Review how the component settings and dependency injection registrations are structured, then trace the AzureSearchHealthCheck usage referenced in the issue. Done means applications can configure an index name and receive the corresponding health-check and client behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend, cloud
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100