Quickstart: Deploy Azure AI Search using an Azure Resource Manager template

This article walks you through the process for using an Azure Resource Manager (ARM) template to deploy an Azure AI Search resource in the Azure portal.

An Azure Resource Manager template is a JavaScript Object Notation (JSON) file that defines the infrastructure and configuration for your project. The template uses declarative syntax. You describe your intended deployment without writing the sequence of programming commands to create the deployment.

Only those properties included in the template are used in the deployment. If more customization is required, such as setting up network security, you can update the service as a post-deployment task. To customize an existing service with the fewest steps, use Azure CLI or Azure PowerShell. If you're evaluating preview features, use the Management REST API.

Assuming your environment meets the prerequisites and you're familiar with using ARM templates, select the Deploy to Azure button. The template will open in the Azure portal.

Deploy to Azure

Prerequisites

If you don't have an Azure subscription, create a trial subscription before you begin.

Review the template

The template used in this quickstart is from Azure Quickstart Templates.

{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "metadata": {
    "_generator": {
      "name": "bicep",
      "version": "0.5.6.12127",
      "templateHash": "11257266040777038564"
    }
  },
  "parameters": {
    "name": {
      "type": "string",
      "maxLength": 60,
      "minLength": 2,
      "metadata": {
        "description": "Service name must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and is limited between 2 and 60 characters in length."
      }
    },
    "sku": {
      "type": "string",
      "defaultValue": "standard",
      "metadata": {
        "description": "The pricing tier of the search service you want to create (for example, basic or standard)."
      },
      "allowedValues": [
        "free",
        "basic",
        "standard",
        "standard2",
        "standard3",
        "storage_optimized_l1",
        "storage_optimized_l2"
      ]
    },
    "replicaCount": {
      "type": "int",
      "defaultValue": 1,
      "maxValue": 12,
      "minValue": 1,
      "metadata": {
        "description": "Replicas distribute search workloads across the service. You need at least two replicas to support high availability of query workloads (not applicable to the free tier)."
      }
    },
    "partitionCount": {
      "type": "int",
      "defaultValue": 1,
      "allowedValues": [
        1,
        2,
        3,
        4,
        6,
        12
      ],
      "metadata": {
        "description": "Partitions allow for scaling of document count as well as faster indexing by sharding your index over multiple search units."
      }
    },
    "hostingMode": {
      "type": "string",
      "defaultValue": "default",
      "allowedValues": [
        "default",
        "highDensity"
      ],
      "metadata": {
        "description": "Applicable only for SKUs set to standard3. You can set this property to enable a single, high density partition that allows up to 1000 indexes, which is much higher than the maximum indexes allowed for any other SKU."
      }
    },
    "location": {
      "type": "string",
      "defaultValue": "[resourceGroup().location]",
      "metadata": {
        "description": "Location for all resources."
      }
    }
  },
  "resources": [
    {
      "type": "Microsoft.Search/searchServices",
      "apiVersion": "2020-08-01",
      "name": "[parameters('name')]",
      "location": "[parameters('location')]",
      "sku": {
        "name": "[parameters('sku')]"
      },
      "properties": {
        "replicaCount": "[parameters('replicaCount')]",
        "partitionCount": "[parameters('partitionCount')]",
        "hostingMode": "[parameters('hostingMode')]"
      }
    }
  ]
}

The Azure resource defined in this template:

Deploy the template

Select the following image to sign in to Azure and open a template. The template creates an Azure AI Search resource.

Deploy to Azure

The portal displays a form that allows you to easily provide parameter values. Some parameters are pre-filled with the default values from the template. You will need to provide your subscription, resource group, location, and service name. If you want to use Azure AI services in an AI enrichment pipeline, for example to analyze binary image files for text, choose a location that offers both Azure AI Search and Azure AI services. Both services are required to be in the same region for AI enrichment workloads. Once you have completed the form, you will need to agree to the terms and conditions and then select the purchase button to complete your deployment.

Azure portal display of template

Review deployed resources

When your deployment is complete you can access your new resource group and new search service in the portal.

Clean up resources

Other Azure AI Search quickstarts and tutorials build upon this quickstart. If you plan to continue on to work with subsequent quickstarts and tutorials, you may wish to leave this resource in place. When no longer needed, you can delete the resource group, which deletes the Azure AI Search service and related resources.

Next steps

In this quickstart, you created an Azure AI Search service using an ARM template, and validated the deployment. To learn more about Azure AI Search and Azure Resource Manager, continue on to the articles below.