Share via


Indexes - Create Or Update Version

Create a new or update an existing Index with the given version id

PATCH {endpoint}/indexes/{name}/versions/{version}?api-version=v1

URI Parameters

Name In Required Type Description
endpoint
path True

string (uri)

Project endpoint. In the form "https://your-ai-services-account-name.services.ai.azure.com/api/projects/_project" if your Foundry Hub has only one Project, or to use the default Project in your Hub. Or in the form "https://your-ai-services-account-name.services.ai.azure.com/api/projects/your-project-name" if you want to explicitly specify the Foundry Project name.

name
path True

string

The name of the resource

version
path True

string

The specific version id of the Index to create or update.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Media Types: "application/merge-patch+json"

The request body can be one of the following:

Name Description
AzureAISearchIndex

Azure AI Search Index Definition

CosmosDBIndex

CosmosDB Vector Store Index Definition

ManagedAzureAISearchIndex

Managed Azure AI Search Index Definition

AzureAISearchIndex

Azure AI Search Index Definition

Name Required Type Description
connectionName True

string

Name of connection to Azure AI Search

indexName True

string

Name of index in Azure AI Search resource to attach

type True string:

AzureSearch

Type of index

description

string

The asset description text.

fieldMapping

FieldMapping

Field mapping configuration

tags

object

Tag dictionary. Tags can be added, removed, and updated.

CosmosDBIndex

CosmosDB Vector Store Index Definition

Name Required Type Description
connectionName True

string

Name of connection to CosmosDB

containerName True

string

Name of CosmosDB Container

databaseName True

string

Name of the CosmosDB Database

embeddingConfiguration True

EmbeddingConfiguration

Embedding model configuration

fieldMapping True

FieldMapping

Field mapping configuration

type True string:

CosmosDBNoSqlVectorStore

Type of index

description

string

The asset description text.

tags

object

Tag dictionary. Tags can be added, removed, and updated.

ManagedAzureAISearchIndex

Managed Azure AI Search Index Definition

Name Required Type Description
type True string:

ManagedAzureSearch

Type of index

vectorStoreId True

string

Vector store id of managed index

description

string

The asset description text.

tags

object

Tag dictionary. Tags can be added, removed, and updated.

Responses

Name Type Description
200 OK Index:

The request has succeeded.

201 Created Index:

The request has succeeded and a new resource has been created as a result.

Other Status Codes

Azure.Core.Foundations.ErrorResponse

An unexpected error response.

Headers

x-ms-error-code: string

Security

OAuth2Auth

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/v2.0/authorize

Scopes

Name Description
https://ai.azure.com/.default

Examples

Indexes_CreateOrUpdateVersion_MaximumSet
Indexes_CreateOrUpdateVersion_MinimumSet

Indexes_CreateOrUpdateVersion_MaximumSet

Sample request

PATCH {endpoint}/indexes/kptgsnpfjcunvvdgzfjdmnurq/versions/hxutytnzwioiijfinpdojrnrqhqb?api-version=v1

{
  "type": "Index",
  "description": "wtjqhnlwihffw",
  "tags": {
    "key1654": "aqtywrvy"
  }
}

Sample response

{
  "type": "Index",
  "id": "xtjevbrwrwuwkbujuwpq",
  "name": "wwikvkcdcobt",
  "version": "swnonkxmjl"
}
{
  "type": "Index",
  "id": "xtjevbrwrwuwkbujuwpq",
  "name": "wwikvkcdcobt",
  "version": "swnonkxmjl"
}

Indexes_CreateOrUpdateVersion_MinimumSet

Sample request

PATCH {endpoint}/indexes/dpfjghwaowffzhoyuwrnmws/versions/priaizsqiwxrwnhhyk?api-version=v1

{
  "type": "Index"
}

Sample response

{
  "type": "Index",
  "name": "wwikvkcdcobt",
  "version": "swnonkxmjl"
}
{
  "type": "Index",
  "name": "wwikvkcdcobt",
  "version": "swnonkxmjl"
}

Definitions

Name Description
Azure.Core.Foundations.Error

The error object.

Azure.Core.Foundations.ErrorResponse

A response containing error details.

Azure.Core.Foundations.InnerError

An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.

AzureAISearchIndex

Azure AI Search Index Definition

CosmosDBIndex

CosmosDB Vector Store Index Definition

EmbeddingConfiguration

Embedding configuration class

FieldMapping

Field mapping configuration class

IndexType
ManagedAzureAISearchIndex

Managed Azure AI Search Index Definition

Azure.Core.Foundations.Error

The error object.

Name Type Description
code

string

One of a server-defined set of error codes.

details

Azure.Core.Foundations.Error[]

An array of details about specific errors that led to this reported error.

innererror

Azure.Core.Foundations.InnerError

An object containing more specific information than the current object about the error.

message

string

A human-readable representation of the error.

target

string

The target of the error.

Azure.Core.Foundations.ErrorResponse

A response containing error details.

Name Type Description
error

Azure.Core.Foundations.Error

The error object.

Azure.Core.Foundations.InnerError

An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.

Name Type Description
code

string

One of a server-defined set of error codes.

innererror

Azure.Core.Foundations.InnerError

Inner error.

AzureAISearchIndex

Azure AI Search Index Definition

Name Type Description
connectionName

string

Name of connection to Azure AI Search

description

string

The asset description text.

fieldMapping

FieldMapping

Field mapping configuration

id

string

Asset ID, a unique identifier for the asset

indexName

string

Name of index in Azure AI Search resource to attach

name

string

The name of the resource

tags

object

Tag dictionary. Tags can be added, removed, and updated.

type string:

AzureSearch

Type of index

version

string

The version of the resource

CosmosDBIndex

CosmosDB Vector Store Index Definition

Name Type Description
connectionName

string

Name of connection to CosmosDB

containerName

string

Name of CosmosDB Container

databaseName

string

Name of the CosmosDB Database

description

string

The asset description text.

embeddingConfiguration

EmbeddingConfiguration

Embedding model configuration

fieldMapping

FieldMapping

Field mapping configuration

id

string

Asset ID, a unique identifier for the asset

name

string

The name of the resource

tags

object

Tag dictionary. Tags can be added, removed, and updated.

type string:

CosmosDBNoSqlVectorStore

Type of index

version

string

The version of the resource

EmbeddingConfiguration

Embedding configuration class

Name Type Description
embeddingField

string

Embedding field

modelDeploymentName

string

Deployment name of embedding model. It can point to a model deployment either in the parent AIServices or a connection.

FieldMapping

Field mapping configuration class

Name Type Description
contentFields

string[]

List of fields with text content

filepathField

string

Path of file to be used as a source of text content

metadataFields

string[]

List of fields with metadata content

titleField

string

Field containing the title of the document

urlField

string

Field containing the url of the document

vectorFields

string[]

List of fields with vector content

IndexType

Value Description
AzureSearch

Azure search

CosmosDBNoSqlVectorStore

CosmosDB

ManagedAzureSearch

Managed Azure Search

ManagedAzureAISearchIndex

Managed Azure AI Search Index Definition

Name Type Description
description

string

The asset description text.

id

string

Asset ID, a unique identifier for the asset

name

string

The name of the resource

tags

object

Tag dictionary. Tags can be added, removed, and updated.

type string:

ManagedAzureSearch

Type of index

vectorStoreId

string

Vector store id of managed index

version

string

The version of the resource