Skip to main content

Administration tool for Azure AI Search indexes

Project description

ai-search-adm

⚠️ PRERELEASE SOFTWARE: This is beta software. Features may change and bugs may exist. Use with caution in production environments.

Administration tool for Azure AI Search indexes.

Features

  • duplicate: Duplicate an index definition (schema only, no documents)
  • clear: Clear all documents from an index (preserves schema)
  • list: List all indexes in a search service
  • stats: Show index statistics (document count, storage usage)
  • Uses DefaultAzureCredential for authentication (or API key as fallback)
  • Pretty terminal output with Rich
  • Cross-service index duplication support

Installation

Note: This is currently in beta. To install the beta version, you may need to use --pre flag with pip or specify the exact version.

Using uvx (Recommended)

Run directly without installation:

uvx ai-search-adm --help
uvx ai-search-adm list --endpoint https://myservice.search.windows.net

Or install globally:

uvx install ai-search-adm
ai-search-adm --help

Using uv

Install as a tool:

uv tool install ai-search-adm
ai-search-adm --help

Run without installation:

uv tool run ai-search-adm --help
uv tool run ai-search-adm list --endpoint https://myservice.search.windows.net

Using pip (Traditional)

# For beta versions, use --pre flag
pip install --pre ai-search-adm

# Or specify exact version
pip install ai-search-adm==0.9.0b1

ai-search-adm --help

Using pipx

pipx install ai-search-adm
ai-search-adm --help

Note: All methods work identically. uvx and uv tool run are fastest and avoid dependency conflicts by running in isolated environments.

Usage

List indexes

List all indexes in a search service:

ai-search-adm list --endpoint https://your-service.search.windows.net

Clear an index

Remove all documents from an index while preserving its structure:

ai-search-adm clear \
  --endpoint https://your-service.search.windows.net \
  --index index-name

⚠️ WARNING: This is a destructive operation that cannot be undone. You will be prompted to type "DELETE" to confirm.

Get index statistics

Display document count and storage usage for an index:

ai-search-adm stats \
  --endpoint https://your-service.search.windows.net \
  --index index-name

Duplicate an index

Duplicate an index within the same search service:

ai-search-adm duplicate \
  --endpoint https://your-service.search.windows.net \
  --source source-index-name \
  --target new-index-name

Duplicate an index across different search services:

ai-search-adm duplicate \
  --endpoint https://target-service.search.windows.net \
  --from-endpoint https://source-service.search.windows.net \
  --source source-index-name \
  --target new-index-name

Authentication

By default, the tool uses DefaultAzureCredential which supports:

  • Environment variables (service principal)
  • Managed Identity
  • Azure CLI authentication
  • Visual Studio Code authentication
  • And more...

You can also use API keys:

ai-search-adm duplicate \
  --endpoint https://your-service.search.windows.net \
  --api-key your-admin-api-key \
  --source source-index \
  --target target-index

Options

  • --overwrite: Delete target index if it exists (DANGEROUS)
  • --api-key: Use API key authentication instead of DefaultAzureCredential
  • --source-api-key: Use different API key for source service in cross-service scenarios

Requirements

  • Python 3.11+
  • Azure AI Search service
  • Appropriate permissions (Search Service Contributor role or API keys)

Development

This project uses modern Python packaging with pyproject.toml and supports Python 3.11+.

# Install in development mode
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black src/ tests/

# Lint code  
ruff check src/ tests/

# Type check
mypy src/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ai_search_adm-0.9.0b2.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ai_search_adm-0.9.0b2-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file ai_search_adm-0.9.0b2.tar.gz.

File metadata

  • Download URL: ai_search_adm-0.9.0b2.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for ai_search_adm-0.9.0b2.tar.gz
Algorithm Hash digest
SHA256 e855054070661488a76fb17111405c253845b56a783b985203546e383890cebc
MD5 51d293a88bad2e0d26890dcaf41ad739
BLAKE2b-256 fa11509d012f10dcd35b74cf4e7299d77e23854b61aaa164285551b9ef00aaf1

See more details on using hashes here.

File details

Details for the file ai_search_adm-0.9.0b2-py3-none-any.whl.

File metadata

File hashes

Hashes for ai_search_adm-0.9.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 0ffe2d11846631d7426395c4204ee01b0482f728626ddea623b86eb4403ac8af
MD5 ffc30a3cc3deb57e029c872df66db943
BLAKE2b-256 2c99eb7309f1c1a4b15566d761bc1ea876c5acdd731f7f95c48b0265a170f052

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page