Azure AI Search (formerly Azure Cognitive Search) is a powerful AI-powered search-as-a-service tool that helps you deliver rich, full-text search experiences over your portal’s content, structured and unstructured. When integrated with Power Pages, it provides enhanced search experiences across knowledge articles, FAQs, uploaded documents, and dynamic portal content.
This guide walks you through how to integrate Azure AI Search with Power Pages, enabling intelligent, high-speed, and scalable search for your portal users.
Why Use Azure AI Search?
Power Pages provides out-of-the-box search capabilities, but these are limited to Dataverse search scopes. Azure AI Search enhances this by:
- Indexing content across multiple Dataverse tables and external sources (PDFs, DOCX, etc.)
- Supporting AI enrichment like OCR, key phrase extraction, language detection
- Enabling fuzzy matching, auto-suggestions, semantic search, and filters
- Returning ranked results using cognitive scoring
🔹 Prerequisites
- Azure Subscription
- Azure Cognitive Search resource
- Power Pages site connected to a Dataverse environment
- Access to Power Automate or Azure Functions (for automation)
- Indexable portal content (knowledge articles, blog entries, product catalog, etc.)
Step 1: Prepare Your Portal Content for Indexing
- Identify the Dataverse tables and content you want to make searchable:
- Knowledge Articles
- Blog/News Posts
- Documents (stored in SharePoint or Dataverse files)
- Custom content like FAQs, policy entries
- For document-based content:
- Ensure files are stored in a structured manner
- Prefer text-rich formats (PDF, DOCX, TXT)
- Create a view or virtual table (optional) to aggregate data into a search-friendly structure.
Step 2: Set Up Azure Cognitive Search
- Go to Azure Portal → Create a resource → Cognitive Search
- Select region, pricing tier (Free is OK for development)
- After deployment:
- Go to the Search Service
- Set up an index with fields (e.g., title, summary, category, content, URL)
- Define a data source:
- Option A: Azure Blob Storage or SharePoint (for documents)
- Option B: Azure SQL or Cosmos DB (for structured data synced from Dataverse)
- Option C: Use a custom data push approach via REST API (for dynamic content)
Step 3: Push Portal Content to Azure AI Search
Option 1: Using Power Automate
- Create a Scheduled or Triggered flow:
- Trigger: Manual or based on record creation/update
- Actions:
- Retrieve content from Dataverse
- Format into Azure Search index schema (JSON)
- Use HTTP action to POST to:
https://<your-search-service>.search.windows.net/indexes/<your-index-name>/docs/index?api-version=2021-04-30-Preview
- In Headers:
Content-Type
: application/jsonapi-key
: your Azure Search Admin Key
- In Body:
{ "value": [ { "@search.action": "mergeOrUpload", "id": "record-id", "title": "Title", "content": "Full content", "url": "https://portalurl.com/details?id=record-id" } ] }
Option 2: Using Azure Function
- Write a scheduled or event-based function
- Connect to Dataverse using Microsoft Dataverse SDK or Web API
- Push data to Azure Search using SearchClient
Step 4: Configure AI Enrichment (Optional)
In Azure Search:
- Set up Skillset for:
- OCR (for images and scanned documents)
- Language Detection
- Key Phrase Extraction
- Entity Recognition
- Link the skillset to your indexer pipeline for documents and enrich structured metadata for better searchability.
🔹 Step 5: Add Search Experience to Power Pages
A. Create a Custom Search Page
- Create a new web page (e.g.,
/smart-search
) - Add a Web Template with HTML + Liquid + JavaScript
B. JavaScript to Call Azure Search API
async function searchAzure() {
let query = document.getElementById("searchInput").value;
const response = await fetch("https://<your-search-service>.search.windows.net/indexes/<your-index-name>/docs?api-version=2021-04-30-Preview&search=" + encodeURIComponent(query), {
method: "GET",
headers: {
"api-key": "<your-query-key>"
}
});
const results = await response.json();
displayResults(results.value);
}
function displayResults(items) {
const container = document.getElementById("results");
container.innerHTML = "";
items.forEach(item => {
const html = `<div><h3>${item.title}</h3><p>${item.content}</p><a href="${item.url}">View More</a></div>`;
container.innerHTML += html;
});
}
C. HTML Markup
<input type="text" id="searchInput" placeholder="Search..." />
<button onclick="searchAzure()">Search</button>
<div id="results"></div>
You can apply Liquid filters to include dynamic portal content and user roles.
Step 6: Add Filters and Facets
Enhance UX with:
- Categories or Tags
- Date filters
- Dynamic facets based on data (use
facet=true
in API calls)
Example API:
&facet=category,count:10&filter=createdDate gt 2023-01-01
Step 7: Secure Search
- Use Query Keys for client-side access (never expose admin keys)
- Implement search access control by filtering indexed content based on user roles or permissions
- Restrict API access by CORS and network restrictions
Step 8: Monitor & Optimize
- Use Azure Search metrics for indexing and query performance
- Use synonym maps to map business terms (e.g., “invoice” = “bill”)
- Apply semantic ranking for natural language queries (optional with premium tier)
Benefits of Azure AI Search Integration
Feature | Description |
---|---|
Intelligent Search | NLP, semantic relevance, AI enrichments |
Speed | High-performance full-text search |
Scale | Handles large volumes of structured/unstructured data |
Customizability | Fully customizable UI and filters |
Enrichment | Add OCR, entity recognition, sentiment, and translation |
Real-Life Use Cases
- Internal policy search across PDFs and knowledge base
- AI-based product catalog search with filters
- Multi-language search for public websites
- Support portal search with OCR on uploaded files