# AzureAISearchToolResource Properties

- Package: [Aspire.Hosting.Foundry](/reference/api/csharp/aspire.hosting.foundry.md)
- Type: [AzureAISearchToolResource](/reference/api/csharp/aspire.hosting.foundry/azureaisearchtoolresource.md)
- Kind: `Properties`
- Members: `2`

A Foundry tool resource that grounds an agent's responses using data from an Azure AI Search index.

## IndexName

- Name: `IndexName`
- Modifiers: `nullable` `get; set`
- Returns: `string?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/ToolResources/AzureAISearchToolResource.cs)

Gets or sets the optional search index name to query. If not set, the tool will use a default or prompt-specified index at runtime.

```csharp
public string? IndexName { get; set; }
```

## SearchResource

- Name: `SearchResource`
- Modifiers: `nullable` `get`
- Returns: `AzureSearchResource?`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/becb48e2d61099e35ae336d527d3875e928d6594/src/Aspire.Hosting.Foundry/ToolResources/AzureAISearchToolResource.cs)

Gets or sets the Azure AI Search resource backing this tool. Set by [PromptAgentBuilderExtensions.WithReference(IResourceBuilder<AzureAISearchToolResource>, IResourceBuilder<AzureSearchResource>)](/reference/api/csharp/aspire.hosting.foundry/promptagentbuilderextensions/methods.md#withreference-iresourcebuilder-azureaisearchtoolresource-iresourcebuilder-azuresearchresource).

```csharp
public AzureSearchResource? SearchResource { get; }
```
