feat(search): migrate Azure AI Search to the 2026-04-01 API and profile-based vector schema - #2604
Conversation
… vector schema SynapseML pinned `2023-07-01-Preview`, the only preview data-plane version Microsoft explicitly tags "(deprecated)" — deprecated 2024-04-08 and out of support since 2024-07-08. This moves the default to the current stable version, `2026-04-01`. `2023-11-01` introduced a breaking change to the vector index schema that SynapseML never adopted, so a naive version bump would break every vector index: legacy (<= 2023-10-01-preview) modern (>= 2023-11-01) vectorSearch.algorithmConfigurations -> vectorSearch.algorithms + .profiles field.vectorSearchConfiguration -> field.vectorSearchProfile searchable not allowed on a vector -> searchable: true is required Rather than a hard cutover, `VectorSchema.align` translates a parsed index definition in both directions to whatever shape the requested api-version expects, and runs before validation so what is validated is exactly what is sent. Users who pass legacy `indexJson`, and users who pin an older `apiVersion`, both keep working. When upgrading legacy JSON each algorithm config is mirrored as a same-named profile, so pre-existing `vectorSearchConfiguration: "vectorConfig"` field references resolve unchanged. `getVectorColConf` reads back either spelling. Also fixes a pre-existing inconsistency where `AddDocuments` hard-coded the default api-version in its document endpoint, so an explicit `apiVersion` option applied to index creation but silently not to document upload. Public class names are deliberately unchanged; renaming `AzureSearch` / `AzureSearchWriter` / `AddDocuments` would be a breaking API change. Adds VectorSchemaMigrationSuite: 10 credential-free tests covering the version gate, both translation directions, idempotency, round-tripping, dual parsing and nested fields. Verified with cognitive/Test/compile, scalastyle, Test/scalastyle (0 errors) and 65/65 passing search tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 06ab581d-5e25-497c-a1b5-95f94ed63b21
…fresh api-versions The service was renamed to Azure AI Search; SynapseML docs still called it Azure Cognitive Search. Sample `apiVersion` values were also stale (`2019-05-06` and the deprecated `2023-07-01-Preview`) and are now `2026-04-01`, matching the new default. Only prose and sample values change — the `AzureSearchWriter` / `AzureSearch` API names are untouched. `website/versioned_docs/**` is intentionally left alone since those are frozen release snapshots. All edited notebooks re-validated as parseable. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 06ab581d-5e25-497c-a1b5-95f94ed63b21
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Hey @ranadeepsingh 👋! We use semantic commit messages to streamline the release process. Examples of commit messages with semantic prefixes:
To test your commit locally, please follow our guild on building from source. |
There was a problem hiding this comment.
Pull request overview
Updates SynapseML’s Azure AI Search integration to default to the 2026-04-01 data-plane API while preserving compatibility across the legacy (pre-2023-11-01) and modern vector index schema shapes by translating index definitions to the schema required by the selected api-version.
Changes:
- Switch default Azure AI Search API version to
2026-04-01and add anapi-versiongate for profile-based vector schemas. - Introduce vector schema alignment (legacy ⇄ modern), including dual parsing and a unified
vectorReferenceaccessor. - Update writer behavior so document upload uses the same resolved
api-versionas index operations; refresh docs/notebooks to “Azure AI Search” and current sample API versions.
Show a summary per file
| File | Description |
|---|---|
| docs/Quick Examples/transformers/cognitive/_AzureSearch.md | Renames service heading to Azure AI Search. |
| docs/Explore Algorithms/OpenAI/Quickstart - Understand and Search Forms.ipynb | Updates narrative + sample REST api-version to 2026-04-01. |
| docs/Explore Algorithms/AI Services/Quickstart - Document Question and Answering with PDFs.ipynb | Updates naming + vector-store REST api-version to 2026-04-01. |
| docs/Explore Algorithms/AI Services/Quickstart - Create a Visual Search Engine.ipynb | Updates naming + sample REST api-version to 2026-04-01. |
| docs/Explore Algorithms/AI Services/Overview.ipynb | Updates Azure AI Search naming in overview and comments. |
| cognitive/src/test/scala/com/microsoft/azure/synapse/ml/services/search/VectorSchemaMigrationSuite.scala | Adds secret-free tests validating schema migration + version gate behavior. |
| cognitive/src/test/scala/com/microsoft/azure/synapse/ml/services/search/split2/SearchWriterSuitePart2.scala | Uses version-agnostic vectorReference assertion for vectors. |
| cognitive/src/test/scala/com/microsoft/azure/synapse/ml/services/search/split1/SearchWriterSuitePart1.scala | Uses version-agnostic vectorReference assertions for vectors. |
| cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/search/AzureSearchSchemas.scala | Adds modern vector schema types (profiles/algorithms), vectorReference, and VectorSchema.align. |
| cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/search/AzureSearchAuth.scala | Updates user-facing auth error strings to “Azure AI Search”. |
| cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/search/AzureSearchAPI.scala | Defaults api-version to 2026-04-01; aligns schema pre-validation; updates vector validation to use vectorReference. |
| cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/search/AzureSearch.scala | Emits modern vector schema by default; pins AddDocuments endpoint to the selected api-version; switches vector detection to isVectorField. |
Review details
Suppressed comments (1)
cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/search/AzureSearchAPI.scala:160
validateIndexInfoaligns vector schemas but still allows vector fields to be sent without anyvectorSearch.algorithms/ legacyvectorSearch.algorithmConfigurationsbeing defined (e.g., if a user supplies dimensions + vectorSearchProfile/config on fields but omits the vectorSearch section). That will pass current validation and fail later at request time with a less actionable service error. Consider rejecting this early with an explicit validation check after alignment.
private def validateIndexInfo(indexJson: String, apiVersion: String): Try[IndexInfo] = {
// Align first so the definition that is validated is exactly the one that gets sent.
val schema = VectorSchema.align(parseIndexJson(indexJson), apiVersion)
for {
_ <- validName(schema.name.get)
_ <- validIndexFields(schema.fields)
} yield schema
}
- Files reviewed: 12/12 changed files
- Comments generated: 0
- Review effort level: Lite
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2604 +/- ##
==========================================
+ Coverage 84.03% 84.67% +0.63%
==========================================
Files 335 335
Lines 17882 17933 +51
Branches 1639 1644 +5
==========================================
+ Hits 15028 15185 +157
+ Misses 2854 2748 -106 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Related Issues/PRs
What changes are proposed in this pull request?
SynapseML pinned the Azure AI Search data-plane API to
2023-07-01-Preview. That is the one preview version Microsoft explicitly flags as deprecated — deprecated 2024-04-08, no longer supported since 2024-07-08 — and the migration guide says outright: "2023-07-01-previewwas the first REST API for vector support. Do not use this API version."This moves the default to
2026-04-01, the current stable data-plane version.The reason this wasn't just a one-line version bump:
2023-11-01introduced a breaking change to the vector index schema that SynapseML never adopted, so bumping the version alone would break every vector index.2023-10-01-preview)2023-11-01)vectorSearch.algorithmConfigurationsvectorSearch.algorithms+vectorSearch.profilesvectorSearchConfigurationvectorSearchProfilesearchablenot permitted on a vector fieldsearchable: truerequired on vector fieldsRather than a hard cutover, this adds
VectorSchema.align, which translates a parsed index definition in both directions into whichever shape the requestedapi-versionexpects, and runs before validation so what gets validated is exactly what gets sent. Consequences:indexJsonkeep working — it's upgraded on the way out.apiVersionkeep working — modern definitions are downgraded to match.vectorSearchConfiguration: "vectorConfig"resolve unchanged asvectorSearchProfile: "vectorConfig".getVectorColConfreads back either spelling when inspecting an existing index.Also fixed here, because the version change made it user-visible:
AddDocumentshard-coded the default api-version into its document endpoint, so an explicitapiVersionoption applied to index creation but silently not to document upload. Both now use the resolved version.Public class names (
AzureSearch,AzureSearchWriter,AddDocuments) are deliberately unchanged — renaming them would be a breaking API change. Only prose, comments, and error messages adopt the current service name.Docs
The service was renamed Azure Cognitive Search → Azure AI Search; the docs still used the old name and shipped stale sample api-versions (
2019-05-06,2023-07-01-Preview). Updated across 4 notebooks and_AzureSearch.md.website/versioned_docs/**is intentionally untouched, since those are frozen release snapshots.How is this patch tested?
VectorSchemaMigrationSuite(10 tests): default-version sanity, the api-version gate, legacy→modern upgrade, modern→legacy downgrade, idempotency, round-trip stability, dual parsing of both shapes, non-vector no-op, serialized-key assertions, and nested-field translation.SearchWriterSuitePart1/Part2assertions updated to the version-agnosticvectorReferencehelper. Their legacyindexJsonfixtures were deliberately kept as-is, so they now double as backward-compatibility coverage.cognitive/Test/compilecognitive/scalastyleandcognitive/Test/scalastyle— 0 errorscognitive/testOnly ...search.VectorSchemaMigrationSuite ...AzureSearchAuthSuite ...AzureSearchGenericParamPersistenceSuite ...AddDocumentsHeaderPersistenceSuite— 65 tests, all passingThe live-service suites remain behind the repo's existing credential gates and were not run locally.
Note for reviewers
One thing worth a maintainer's eye: indexes already created under
2023-07-01-Previewmay need a genuine service-side migration, since Microsoft's guidance prescribes a manual Get Index → modify → Create-or-Update. Accepting both field spellings on read mitigates this, but I couldn't confirm without a live service whether the service auto-translates old vector indexes when read at a newer api-version.Does this PR change any dependencies?
Does this PR add a new feature? If so, have you added samples on website?