azurerm_search_service cost estimation
Managed full-text and vector search. Free tier for development. Basic at $75/month, Standard from $250/month per Search Unit. Semantic ranking and vector search included on Standard+.
Azure AI Search (formerly Azure Cognitive Search) is the managed search service supporting full-text, vector, and hybrid search. The azurerm_search_service resource creates the service instance. Pricing tiers differ in capacity, features, and cost.
Tier pricing per Search Unit (SU): - Free: $0 (1 service, 50 MB, no SLA). For testing only. - Basic: $75/month per SU (1-3 SUs, 2 GB) - Standard S1: $250/month per SU (1-12 SUs, 25 GB per partition) - Standard S2: $1,000/month per SU (1-12 SUs, 100 GB per partition) - Standard S3: $2,000/month per SU (1-12 SUs, 200 GB per partition) - Storage Optimized L1: $3,000/month per SU (2 TB) - Storage Optimized L2: $6,000/month per SU (8 TB)
Search Units = Replicas × Partitions. A 2-replica 2-partition Standard S1 = 4 SUs = $1,000/month. Replicas add query capacity; partitions add storage.
Semantic ranking (re-ranks results using ML for relevance): included up to 1,000 queries/month, then $4 per 1,000 queries.
Vector search: included in Standard+ tiers. Indexes embeddings (typically from Azure OpenAI) for similarity search. Storage for vectors counts against partition limits.
A typical production search service: Standard S1 with 1 replica + 1 partition = 1 SU = $250/month. For more queries-per-second, add replicas. For more data, add partitions.
Common cost surprise: scaling. Going from 1 SU to 4 SUs (for 4x throughput) is 4x cost. Right-size carefully.
c3x estimates AI Search based on sku, replica_count, and partition_count.
Terraform example
A minimal but realistic configuration that C3X can estimate.
resource "azurerm_search_service" "main" {
name = "prod-search"
resource_group_name = azurerm_resource_group.main.name
location = azurerm_resource_group.main.location
sku = "standard"
replica_count = 1
partition_count = 1
semantic_search_sku = "free" # Free 1K semantic queries/month
tags = {
Environment = "production"
}
}Pricing dimensions
What you actually pay for when you provision azurerm_search_service.
| Dimension | Unit | What's being charged |
|---|---|---|
| Basic tier | per SU-month | Entry-level tier for small workloads. Up to 3 SUs. $75/month per SU |
| Standard S1 | per SU-month | Production default. 25 GB per partition, up to 12 SUs. $250/month per SU |
| Standard S2 | per SU-month | Higher capacity tier. 100 GB per partition. $1,000/month per SU |
| Storage Optimized L1 | per SU-month | Large data sets. 2 TB per partition. $3,000/month per SU |
| Semantic queries | per 1,000 queries | ML-based re-ranking for relevance. First 1K/month free. $4 per 1K queries |
Optimization tips
Common ways to reduce azurerm_search_service cost without changing the workload.
Use Basic for small workloads
$175/month vs StandardBasic at $75/month handles up to 2 GB of indexed data and modest query rates. For internal tools, small SaaS, and dev environments, Basic is dramatically cheaper than Standard at $250/month.
Right-size replicas and partitions
$250+/month per removed SUReplicas multiply query capacity; partitions multiply storage. Adding a replica adds 100% to cost for 2x QPS — only justify based on measured load. Many teams over-provision; measure first.
Use semantic ranking selectively
VariableSemantic ranking costs $4/1K queries beyond 1K/month free. For queries where standard ranking works, skip semantic. Apply semantic only to queries that benefit (ambiguous user input, conversational search).
Filter cold data out of search index
Proportional to data reductionIndexing data you'll never search costs storage. Archive old records to blob storage; only index recent/relevant data. For e-commerce, may not need to index discontinued SKUs from 5 years ago.
Use Cosmos DB or PostgreSQL for simple lookups
AI Search is for full-text and vector queries with relevance ranking. For exact-match key lookups, primary key access on Cosmos DB or PostgreSQL is much cheaper than indexing in Search.
FAQ
When should I use AI Search vs Elasticsearch?
AI Search is managed (no operational overhead) and tightly integrated with Azure OpenAI for RAG patterns. Elasticsearch (self-hosted or Elastic Cloud) is more flexible, has more features, often cheaper at scale. For Azure-native workloads with moderate scale, AI Search; for advanced features or massive scale, Elastic.
Is vector search worth the cost?
For RAG (retrieval-augmented generation) chatbots and semantic search, yes — it's the primary value proposition. For simple keyword search, vector search adds storage and complexity without significant benefit. Use vector for semantic queries; full-text for keyword queries; hybrid for the best of both.
How do I scale AI Search?
Two axes: replicas (more query capacity) and partitions (more storage). For higher QPS, increase replicas. For larger indexes, increase partitions. Total Search Units = replicas × partitions, and you're billed for the product. Plan capacity carefully.
Can I move from one tier to another?
Upgrading is supported and usually online. Downgrading often requires recreating the index — limited by the next tier's partition size. Plan tier carefully; you can grow within a tier (more SUs) more easily than across tiers.
Related resources
Estimate this resource in your own Terraform
Free, open source, no API key. C3X parses your Terraform and shows line-item cost for every resource, including azurerm_search_service.