This is a minimal single-page application demo that lets you configure Azure AI Search connection values and run simple searches against an index.
Features
- Sliding configuration panel (stores values in localStorage)
- Index selector with pre-configured options
- Search box and results list
- Uses @azure/search-documents SDK (browser) — demo fallback to mock results when API key is missing
Quick start
- Install dependencies:
npm install- Start dev server:
npm run devNotes
- This app stores the API key in localStorage for convenience; do NOT use it as-is in production.
- The SDK used is @azure/search-documents; the sample switches to mock results if the API key looks fake or missing. Adjust as needed.
Before publishing
- Verify there are no real API keys, connection strings, SAS tokens, or account keys in any source files.
- Remove or replace any demo values in
src/main.jsorai-search-service-setup.restwith placeholders (example:<YOUR_SEARCH_API_KEY>). - Ensure
.gitignorecontainsnode_modules/,.env, and other local-only files. - Consider using environment variables, a secrets manager, or a secure token exchange for production credentials rather than embedding keys in client code.
Next steps
- Add more robust index discovery via the Search Service REST API
- Add pagination and highlight snippets
- Add secure token exchange for keys