This article shows how to implement a full text search in  Blazor using  Azure Cognitive Search. The search results are returned using paging and the search index can be created, deleted from a Blazor application.

Code:  https://github.com/damienbod/AspNetCoreAzureSearch

Posts in this series

  • Implement a full text search using Azure Cognitive Search in ASP.NET Core
  • Using Azure Cognitive Search Suggesters in ASP.NET Core and Autocomplete
  • Implement a Blazor full text search using Azure Cognitive Search

Creating the Blazor App

The Blazor application was created using Visual Studio. The application requires an API which will be used to access, request the Azure Cognitive search service. We do not want to access the Azure Cognitive Search service directly from the WASM application because the free version requires an API key (or the paid versions can use an API key) and an API key cannot be stored safely in a SPA. The WASM app will only use its backend in the same domain and can be secured as required. The trusted backend can forward requests to other APIs, in our case to the Azure Cognitive search.

Creating an ASP.NET Core hosted Blazor application is slightly hidden. Once you select the Blazor WASM as your UI in Visual Studio, you need to select the ASP.NET Core hosted checkbox in the second step. This could probably be created using the dotnet new command as well, maybe someone knows how to do this.

#asp.net core #.net core #azure #blazor

Implement a Blazor full text search using Azure Cognitive Search
8.10 GEEK