How to Deploy Azure AI Search with a Private Endpoint using Terraform

Guillermo Musumeci
6 min readJun 25, 2024

In this story, we will learn how to deploy Azure AI Search service with Private Endpoint using Terraform in Azure.

The Azure AI Search Service (formerly known as “Azure Cognitive Search”) provides secure information retrieval at scale over user-owned content in traditional and generative AI search applications.

Information retrieval is foundational to any app that surfaces text and vectors. Common scenarios include catalog or document search, data exploration, and increasingly chat-style apps over proprietary grounding data.

1. Defining the Azure Provider

First, we will define Azure authentication variables.

We will use a Service Principal with a Client Secret. Check the link below for more info about Azure authentication for Terraform: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/guides/service_principal_client_secret

variable "azure_subscription_id" {
type = string
description = "Azure Subscription ID"
}

variable "azure_client_id" {
type = string
description = "Azure Client ID"
}

variable "azure_client_secret" {
type = string
description = "Azure Client Secret"
}

variable "azure_tenant_id" {
type = string…

--

--

Guillermo Musumeci

Certified AWS, Azure & GCP Architect | HashiCorp Ambassador | Terraform SME | KopiCloud Founder | ex-AWS | Entrepreneur | Book Author | Husband & Dad of ✌