Repository navigation
Add Foundry vector search options to ARM template - #6098
Draft
Brendan Kowitz (brendankowitz) wants to merge 4 commits into
Draft
Brendan Kowitz (brendankowitz) wants to merge 4 commits into
Brendan Kowitz (brendankowitz) wants to merge 4 commits into
Conversation
…narrative sample - default-azuredeploy-docker.json: optional new/existing Azure Foundry account for SQL semantic search. A new account is Entra-only and, by default, accepts traffic only from the web app's outbound IPs. Assigns Cognitive Services OpenAI User to the web app's managed identity and sets the VectorSearch app settings. - samples/search-parameters/composition-narrative-semantic.json: sample semantic SearchParameter over Composition and section narrative text. - docs: deployment and narrative example sections in SemanticSearch.md. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6098 +/- ##
==========================================
+ Coverage 81.51% 82.13% +0.61%
==========================================
Files 1036 1036
Lines 40497 40500 +3
Branches 6611 6611
==========================================
+ Hits 33013 33265 +252
+ Misses 5916 5665 -251
- Partials 1568 1570 +2 🚀 New features to boost your workflow:
|
- Infer the default embedding model version for ada-002 versus embedding-3. - Document existing deployment version pinning, private networking, R5 processingMode, and strict semantic-search verification. - Make the existing-account firewall example fail on lookup or rule errors. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Clarify that changing an in-use embedding model is not a supported migration and a plain $reindex does not rebuild enabled SearchParameters. - Show the async reindex request and Content-Location polling before strict search. - Make IP list parsing reject empty entries without a failing subshell pipeline. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
- Explain that model identity settings refresh only with deployment and that in-use changes can mix vectors or leave old resources unsearchable. - Reject malformed multiline and trailing-comma App Service IP output. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Image-only narratives normalize to an empty string that fails StringSearchValue’s whitespace guard, causing Composition saves or reindexing to fail instead of skipping the block.
1 open issue
What changed in this PR
Adds Azure Foundry deployment options to the sample ARM template for SQL semantic search, plus a Composition narrative SearchParameter and setup guidance. Changes are limited to deployment samples and documentation.
Changes:
- Supports new or existing Foundry accounts, managed-identity access, embedding configuration, and network restrictions for new accounts.
- Adds a semantic SearchParameter for Composition and nested-section narratives.
- Documents deployment, network access, reindexing, and FHIR-version requirements.
| File | Description |
|---|---|
samples/templates/default-azuredeploy-docker.json |
Adds optional Foundry provisioning and vector-search app settings. |
samples/search-parameters/composition-narrative-semantic.json |
Adds per-narrative semantic indexing for Compositions. |
docs/SemanticSearch.md |
Explains Foundry setup and the Composition search example. |
docs/DefaultDeployment.md |
Links to semantic-search deployment guidance. |
Review effort: Balanced
| "Composition" | ||
| ], | ||
| "type": "special", | ||
| "expression": "(Composition.text.`div` | Composition.repeat(section).text.`div`).select(toString().replaceMatches('<[^>]*>', ' ').replace('<', '<').replace('>', '>').replace('&', '&').replaceMatches('\\\\s+', ' ').trim())", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Follow-up to the merged SQL semantic (vector) search feature. Makes it deployable from the sample ARM template with a new or existing Azure Foundry account, and adds a sample SearchParameter for Composition narrative text.
samples/templates/default-azuredeploy-docker.jsonvectorSearchFoundryNewOrExistingparameter:none(default, no change to existing deployments) |new|existing, plus account location/name, network, and embedding model/deployment parameters.new: creates anAIServices(S0) account with local auth disabled (Entra ID only) and an embedding deployment withNoAutoUpgrade(model version is stored with every vector). By default the account firewall denies all traffic except the web app'spossibleOutboundIpAddressesplus optionalfoundryAdditionalAllowedIpAddresses;foundryRestrictNetworkAccess=falseopens it to public networks.existing: does not modify the account (an ARM PUT would overwrite its configuration); only assigns the role and reads endpoint/model from the existing deployment.FhirServer__CoreFeatures__VectorSearch__*app settings (endpoint, deployment, model name/version,SendDimensionsParameteronly fortext-embedding-3-large). Foundry can be in another resource group/subscription via a nested deployment.FhirServerSqlServer; ignored for Cosmos DB. When disabled,reference()calls are insideif()and never evaluated.samples/search-parameters/composition-narrative-semantic.json— semantic SearchParameter (narrative-semantic) overComposition.textand all nestedsection.textnarratives, stripping XHTML tags and decoding basic entities, withperValueRowso each narrative block is embedded separately.divis a FHIRPath keyword and must be written astext.`div`(as in the FHIRdom-6invariant). Firely tolerates the unescaped form; Ignixa correctly rejects it, and the indexer logs a warning and indexes nothing. Documented inSemanticSearch.md.Docs —
docs/SemanticSearch.md: "Deploying with the sample template" and "Example: Composition narrative" sections; pointer fromdocs/DefaultDeployment.md.Affected layers: deployment samples and docs only. No code, schema, or FHIR-version-specific changes.
Related issues
Addresses [issue #].
Testing
vectorSearchFoundryNewOrExistingdefaultnone; Foundry resources and settings conditional//comments); a script checked everyparameters()/variables()reference resolves in its scope (outer and nested inner) and brackets balance — passed. PR ARM validation (build/pr-arm.yml,-serviceNameonly) — pending CI.networkAclswithipRulescopy frompossibleOutboundIpAddressesexistingVectorSearch__Embedding__*app settingsAzureFoundryEmbeddingClient(AzureOpenAIClient+DefaultAzureCredential). Not deployed.composition-narrative-semantic.jsondotnet test --project src\Microsoft.Health.Fhir.R4.Core.UnitTests\... --filter-class SpikeNarrativeTests— passed: Firely and Ignixa both returned the same 3 decoded narrative strings; vector config parsed asperValueRow/8000/cosine.Not verified: an actual Azure deployment for
new/existing, cross-subscription Foundry, or end-to-end$reindex+ semantic query.az bicep decompilefails on this template both before and after the change, so it was not usable as a validator.FHIR Team Checklist
Semver Change (docs)
Skip