Review public network access to Azure AI Search

Limit search-service access to the required clients.

Description

Foundry IQ (Azure AI Search, formerly Cognitive Search) accepts public-network requests when its public endpoint is enabled. Firewall rules and authentication determine who can use the service.

Potential impact

An unnecessary public path can expose search data if credentials leak or authentication is misconfigured.

Remediation

For private-only access, configure the private endpoint and DNS. From an existing client, confirm the service hostname resolves to the private endpoint’s IP and send an authenticated request over that connection. Then set public_network_access_enabled = false and repeat the request.

Examples

Both examples use the same Standard-tier service. The flag changes from true to false. Configure the private connection and authentication separately.

Before

hcl
resource "azurerm_search_service" "example" {
  name                          = "example-search-service"
  resource_group_name           = azurerm_resource_group.example.name
  location                      = azurerm_resource_group.example.location
  sku                           = "standard"
  public_network_access_enabled = true
}

After

hcl
resource "azurerm_search_service" "example" {
  name                          = "example-search-service"
  resource_group_name           = azurerm_resource_group.example.name
  location                      = azurerm_resource_group.example.location
  sku                           = "standard"
  public_network_access_enabled = false
}

References