Azure AI Search
Azure AI Search (formerly Azure Cognitive Search) enables full-text search capabilities across your Business Central data. This guide covers configuring Cloud Replicator to use Azure AI Search as a destination.
Overview
Azure AI Search indexes your Business Central data for powerful search capabilities:
| AI Search Concept | Business Central Mapping |
|---|---|
| Index | Business Central table name (sanitized, lowercase) |
| Document | Business Central record |
| Document Key | SystemId (GUID, required) |
| Fields | Business Central fields with appropriate types |
When to Use Azure AI Search
Azure AI Search is ideal for:
| Use Case | Benefit |
|---|---|
| Product search | Full-text search across item descriptions |
| Customer lookup | Find customers by partial name, address, etc. |
| Document search | Search posted documents by content |
| Knowledge bases | Create searchable help or FAQ systems |
Prerequisites
Before configuring Azure AI Search:
- Azure Subscription: Active Azure subscription
- Search Service: Azure AI Search service created
- Admin Key: Admin API key (not query key)
Creating an Azure AI Search Service
Step 1: Create Service in Azure Portal
- Sign in to the Azure Portal (https://portal.azure.com)
- Click "Create a resource"
- Search for "Azure AI Search" and select it
- Click "Create"
Step 2: Configure Basic Settings
| Setting | Recommendation |
|---|---|
| Subscription | Your subscription |
| Resource group | Create new or use existing |
| Service name | Unique name (becomes part of URL) |
| Location | Same region as Business Central |
| Pricing tier | Start with Basic or Standard |
Pricing Tier Selection
| Tier | Documents | Index Size | Use Case |
|---|---|---|---|
| Free | 10,000 | 50 MB | Testing only |
| Basic | 1 million | 2 GB | Small datasets |
| Standard | 15 million per partition | 25 GB per partition | Production |
| Standard 2/3 | Higher limits | Higher limits | Large scale |
Step 3: Complete Creation
- Click "Review + create"
- Review settings and click "Create"
- Wait for deployment to complete
Step 4: Get Admin Key
- Navigate to your Search service
- Go to "Keys" under Settings
- Copy one of the Admin keys (not Query keys)
Configuring Cloud Replicator
Setup Steps
- Search for "Cloud Replicator Setup" in Business Central
- Locate the Azure AI Search section
- Enter the following:
| Field | Value |
|---|---|
| Azure AI Search Service Name | Your service name (just the name, not URL) |
| Azure AI Search Key | An Admin API key |
Testing the Connection
After entering credentials:
- Create a table mapping (e.g., Customer or Item)
- Select "Azure AI Search" as the destination
- Ensure "SystemId as RowKey" is enabled (required for AI Search)
- Run a manual replication
- Check the Replication Log for success
- Verify index in Azure Portal > Search service > Indexes
Important Limitations
Azure AI Search has specific requirements and limitations:
SystemId Required
Azure AI Search requires SystemId as the document key:
- "SystemId as RowKey" is automatically enabled for AI Search destinations
- Cannot use primary key fields as the document key
Per Day Not Supported
The "Per Day" (series tables) feature is not available for Azure AI Search:
- This option is automatically disabled for AI Search destinations
- Use other destinations for time-series data
Deletions Not Supported
Record deletion tracking is not currently supported for Azure AI Search:
- Deleted records remain in the search index
- Manually remove deleted documents or rebuild indexes periodically
Company Name Field Not Added
Unlike the Azure Table and Cosmos DB destinations, the Field Name for Company configured in Cloud Replicator Setup is not written to Azure AI Search documents. As a result, you cannot filter the search index by company name. If you need to distinguish records by company, include a company-specific field via Field Actions, or use a separate index per company.
Index Structure
Index Creation
Cloud Replicator automatically:
- Creates an index for each replicated table
- Defines field types based on Business Central field types
- Configures searchable, filterable, and sortable attributes
Field Type Mapping
| Business Central Type | AI Search Type | Searchable |
|---|---|---|
| Text, Code | Edm.String | Yes |
| Date | Edm.DateTimeOffset | No |
| Integer, Duration | Edm.Int32 | No |
| BigInteger | Edm.Int64 | No |
| Decimal | Edm.Double | No |
| Boolean | Edm.Boolean | No |
| DateTime, Time, GUID, and any other type | Edm.String | Yes |
| Blob (as text) | Edm.String | Yes |
| Blob (as Base64) | Edm.String | Yes |
The document key field is SystemId (Edm.String, marked as the index key).
Index Naming
Index names are derived from table names:
- Spaces and special characters are removed
- Converted to lowercase
- Must be unique within the service
Example: "Sales Header" becomes "salesheader"
Querying the Search Index
Azure Portal
- Navigate to your Search service
- Select "Search explorer"
- Select your index
- Enter search queries
Example queries:
// Simple search
Adatum
// Field-specific search
Name:Adatum
// Filter by a field value
$filter=City eq 'Atlanta'
// Combined search and filter
searchText=Corporation&$filter=City eq 'Atlanta'
REST API
POST https://[service].search.windows.net/indexes/customers/docs/search?api-version=2024-07-01
Content-Type: application/json
api-key: [query-key]
{
"search": "Adatum",
"filter": "City eq 'Atlanta'",
"select": "Name, Address, City",
"top": 10
}
SDK Access
// C# Example
var client = new SearchClient(
new Uri("https://[service].search.windows.net"),
"customers",
new AzureKeyCredential("[query-key]"));
var results = await client.SearchAsync<Customer>("Adatum",
new SearchOptions
{
Filter = "City eq 'Atlanta'",
Select = { "Name", "Address", "City" }
});
Search Features
Full-Text Search
All text fields are searchable by default:
- Searches across all searchable fields
- Supports wildcards, fuzzy matching, and phrases
- Automatic language analysis
Filtering
Non-searchable fields support filtering:
- Exact match filters
- Range queries for dates and numbers
- Logical operators (and, or, not)
Faceted Navigation
Enable facets for category-based navigation:
- Group results by field values
- Show counts per category
- Build interactive search interfaces
Sorting
Sort results by any sortable field:
- Ascending or descending order
- Multiple sort criteria
Performance Considerations
Index Size
- Monitor index size in Azure Portal
- Upgrade tier if approaching limits
- Exclude unnecessary fields to reduce size
Query Performance
- Use filters to narrow results
- Limit selected fields with
$select - Use
$topto limit result count
Replication Performance
- AI Search indexing is moderately fast
- Large initial loads may take time
- Subsequent replications are incremental
Cost Management
Pricing Components
| Component | Description |
|---|---|
| Service tier | Monthly charge based on tier |
| Document count | Counted against tier limits |
| Storage | Included in tier, counted against limits |
| Queries | Included (no per-query charge) |
Cost Optimization
- Choose appropriate tier for your data volume
- Replicate only tables needed for search
- Exclude unnecessary fields
- Consider Basic tier for small datasets
Troubleshooting
Connection Errors
- Verify service name is correct (without
.search.windows.net) - Ensure you're using an Admin key, not Query key
- Check service firewall settings
Index Creation Fails
- Verify Admin key has create permissions
- Check for invalid characters in table names
- Review error in Replication Log
Documents Not Appearing
- Wait for indexing to complete (can take minutes)
- Check Replication Log for errors
- Verify table mapping is configured correctly
- Confirm "SystemId as RowKey" is enabled
Search Returns No Results
- Verify documents were indexed
- Check search syntax
- Ensure field names match (use sanitized names)
- Review filter syntax
Security Best Practices
Key Management
- Use Admin keys only for indexing/management
- Use Query keys for search applications
- Rotate keys periodically
- Store keys securely
Network Security
- Configure IP firewall rules
- Use private endpoints for production
- Restrict Admin key access
Data Security
- Index only necessary data
- Exclude sensitive fields using Field Actions
- Review what data is searchable