microsoft/semantic-kernel · error · VectorStoreOperationException

{field.type_} not supported in Azure AI Search.

Error message

{field.type_} not supported in Azure AI Search.

What it means

Raised in _definition_to_azure_ai_search_index when a DATA (non-key, non-vector) field has a type_ that is not a key in TYPE_MAP_DATA and does not begin with 'dict' or match 'list...dict'. Azure AI Search only maps a fixed set of Python types (str, int, float, bool, and collections thereof, plus dict/complex). Any other type string means the index schema cannot be generated, so collection creation is aborted with a VectorStoreOperationException.

Source

Thrown at python/semantic_kernel/connectors/azure_ai_search.py:230

    definition: VectorStoreCollectionDefinition,
    encryption_key: SearchResourceEncryptionKey | None = None,
) -> SearchIndex:
    """Convert a VectorStoreRecordDefinition to an Azure AI Search index."""
    fields = []
    search_profiles = []
    search_algos = []

    for field in definition.fields:
        if field.field_type == FieldTypes.DATA:
            if not field.type_:
                logger.debug(f"Field {field.name} has not specified type, defaulting to Edm.String.")
            if field.type_ and field.type_ not in TYPE_MAP_DATA:
                if field.type_.startswith("dict"):
                    type_ = TYPE_MAP_DATA["dict"]
                elif field.type_.startswith("list") and "dict" in field.type_:
                    type_ = TYPE_MAP_DATA["list[dict]"]
                else:
                    raise VectorStoreOperationException(f"{field.type_} not supported in Azure AI Search.")
            else:
                type_ = TYPE_MAP_DATA[field.type_ or "default"]
            fields.append(
                SearchField(
                    name=field.storage_name or field.name,
                    type=type_,
                    filterable=field.is_indexed or field.is_full_text_indexed,
                    # searchable is set first on the value of is_full_text_searchable,
                    # if it is None it checks the field type, if text then it is searchable
                    searchable=type_ in ("Edm.String", "Collection(Edm.String)")
                    if field.is_full_text_indexed is None
                    else field.is_full_text_indexed,
                    sortable=not type_.startswith("Collection") or type_ == "Edm.ComplexType",
                    hidden=False,
                )
            )
        elif field.field_type == FieldTypes.KEY:
            fields.append(

View on GitHub (pinned to c028a0c7dc)

Solutions

  1. Re-type the offending field to a supported primitive: 'str', 'int', 'float', 'bool', or a supported 'list[...]' / 'dict'.
  2. For datetime/Decimal values, store them as 'str' (ISO 8601) and convert in your serialize/deserialize overrides.
  3. For nested objects, model the field as 'dict' (maps to Edm.ComplexType) and ensure the contents are JSON-serializable.
  4. Inspect TYPE_MAP_DATA in azure_ai_search.py to confirm the exact supported type strings before redefining the model.

Example fix

// before
field(type_='datetime', name='created_at')

// after
field(type_='str', name='created_at')  # store ISO-8601 string
Defensive patterns

Strategy: validation

Validate before calling

from semantic_kernel.connectors.azure_ai_search import TYPE_MAP_DATA
SUPPORTED = set(TYPE_MAP_DATA) | {"dict"}

def validate_data_field_types(definition) -> list[str]:
    bad = []
    for f in definition.fields:
        if f.field_type.value == "data" and f.type_:
            t = f.type_
            if t not in SUPPORTED and not t.startswith("dict") and not (t.startswith("list") and "dict" in t):
                bad.append(f"{f.name}: {t}")
    return bad

bad = validate_data_field_types(definition)
assert not bad, f"Unsupported types: {bad}"

Try / catch

from semantic_kernel.exceptions import VectorStoreOperationException
try:
    await collection.ensure_collection_exists()
except VectorStoreOperationException as e:
    if "not supported in Azure AI Search" in str(e):
        # fix the offending field type in the definition
        ...
    raise

Prevention

When it happens

Trigger: Calling ensure_collection_exists() on a collection whose record definition annotates a data field with an unmapped type such as 'datetime', 'tuple', 'set', 'bytes', a custom class name, or a generic like 'list[tuple]'. The error surfaces when the index is built from the definition, not when the collection object is constructed.

Common situations: Defining a VectorStoreRecordDefinition with a field typed as datetime.datetime or Decimal and expecting the connector to handle it; using type annotations the connector cannot introspect into a supported Edm type; upgrading a model that previously used 'dict' but was changed to a dataclass type name.

Related errors


AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13). Data as JSON: /api/errors/64344adfb040ec1b. Report an issue: GitHub.