# AzureSearchExtensions

- Kind: `class`
- Package: [Aspire.Hosting.Azure.Search](/reference/api/csharp/aspire.hosting.azure.search.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Search/AzureSearchExtensions.cs)

Provides extension methods for adding the Azure AI Search resources to the application model.

## Definition

```csharp
namespace Aspire.Hosting;

public static class AzureSearchExtensions
{
    // ...
}
```

## Methods

- [AddAzureSearch(IDistributedApplicationBuilder, string)](/reference/api/csharp/aspire.hosting.azure.search/azuresearchextensions/methods.md#addazuresearch-idistributedapplicationbuilder-string) : `IResourceBuilder<AzureSearchResource>` `extension` `ats export` -- Adds an Azure AI Search service resource to the application model.
- [WithRoleAssignments(IResourceBuilder<T>, IResourceBuilder<AzureSearchResource>, SearchBuiltInRole[])](/reference/api/csharp/aspire.hosting.azure.search/azuresearchextensions/methods.md#withroleassignments-iresourcebuilder-t-iresourcebuilder-azuresearchresource-searchbuiltinrole) : `IResourceBuilder<T>` `extension` `ats ignored` -- Assigns the specified roles to the given resource, granting it the necessary permissions on the target Azure AI Search service resource. This replaces the default role assignments for the resource.
