Skip to content

Commit b472288

Browse files
authored
Add README for Aspire hosting package (#26)
1 parent 420a464 commit b472288

2 files changed

Lines changed: 43 additions & 2 deletions

File tree

AzureSearchEmulator.Aspire/AzureSearchEmulator.Aspire.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<PackageTags>azure search emulator ai hosting docker</PackageTags>
1414
<Description>Azure Search Emulator hosting support for Aspire.</Description>
1515
<IsPackable>true</IsPackable>
16-
<Version>1.0.0-beta</Version>
16+
<Version>1.0.0-beta.2</Version>
1717
<Company>feature[23]</Company>
1818
<Copyright>Copyright (c) feature[23] 2025</Copyright>
1919
<Authors>Paul Irwin</Authors>
@@ -33,7 +33,7 @@
3333

3434
<ItemGroup>
3535
<None Include="../logo.png" Pack="true" PackagePath="\" />
36-
<None Include="../README.md" Pack="true" PackagePath="\" />
36+
<None Include="README.md" Pack="true" PackagePath="\" />
3737
</ItemGroup>
3838

3939
</Project>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Azure Search Emulator hosting for Aspire
2+
3+
This package adds Aspire hosting support for the [Azure Search Emulator by feature[23]](https://github.com/feature23/azuresearchemulator).
4+
5+
## Usage
6+
7+
In most cases, you'll probably want to persist your index volume.
8+
Add the following to your AppHost Program.cs:
9+
10+
```csharp
11+
var search = builder.AddAzureSearchEmulator("search")
12+
.WithIndexesVolume();
13+
```
14+
15+
You can leave off the `WithIndexesVolume()` if you want your search index data to be transient.
16+
17+
## Disable HTTPS Certificate Validation
18+
19+
The emulator runs with a self-signed cert.
20+
You will need to update your use of the Azure Search SDK to disable HTTPS certificate validation:
21+
22+
```csharp
23+
var options = new SearchClientOptions
24+
{
25+
Transport = new HttpClientTransport(new HttpClientHandler
26+
{
27+
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator,
28+
}),
29+
};
30+
```
31+
32+
Pass this `options` object as the last parameter to the constructor of `SearchClient`, `SearchIndexClient`, etc.:
33+
34+
```csharp
35+
var client = new SearchClient(new Uri(searchServiceEndpoint), indexName, new DefaultAzureCredential(), options);
36+
```
37+
38+
## Contributing
39+
40+
Submit issues or Pull Requests to us at our GitHub repo!
41+
https://github.com/feature23/azuresearchemulator

0 commit comments

Comments
 (0)