Repository navigation
fix(extract): resolve {{displayName}} named value references to resource names - #319
Merged
Alexander Zaslonov (azaslonov) merged 2 commits intoOct 9, 2026
Conversation
…rce names
Policies reference named values by displayName ({{displayName}}), but the
ARM GET endpoint is keyed by resource name. When the two differ, transitive
extraction issued GET namedValues/<displayName>, got a silent 404, counted
an error and never wrote the artifact.
extractTransitiveDependencies now builds a per-context displayName -> name
index (one LIST per context, shared across concurrent tasks) and resolves
each named value reference through it before the GET. References that do
not match any displayName still fall back to the reference as the resource
name, so existing behaviour is unchanged for name == displayName. A
reference that resolves to an already-extracted resource is skipped instead
of being re-extracted or counted as an error, and a 404 on a transitive
dependency now logs a warning instead of failing silently.
Verified on a live APIM instance: a named value with name != displayName
referenced from an API policy was previously reported as "1 errors" with
no artifact; it is now extracted under its resource name with 0 errors.
Closes Azure#291
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Raw reference keys can incorrectly suppress extraction of a different resolved named-value resource.
1 open finding
What changed in this PR
Resolves transitive named-value references by mapping policy display names to ARM resource names.
Changes:
- Adds cached per-context named-value lookup and fallback behavior.
- Adds missing-dependency warnings and duplicate extraction avoidance.
- Adds unit coverage for resolution, fallback, workspaces, and failures.
| File | Description |
|---|---|
src/services/transitive-extractor.ts |
Resolves named-value display names before extraction. |
tests/unit/services/transitive-extractor.test.ts |
Tests the new resolution behavior. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Tuan Nguyen (atuannguyen1101)
approved these changes
Oct 9, 2026
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.

Summary
Policies reference named values by
displayName({{displayName}}), but the ARM GET endpoint is keyed by resourcename. When the two differ, transitive extraction issuedGET namedValues/<displayName>, got a silent 404, counted an error and never wrote the artifact.Changes
extractTransitiveDependenciesnow builds a per-contextdisplayName → nameindex (one LIST per context, shared across concurrent tasks via a cached promise) and resolves each named value reference through it before the GET.displayNamefall back to the reference as the resource name, so behaviour is unchanged for the commonname == displayNamecase and for refs the LIST cannot see.tests/unit/services/transitive-extractor.test.tscover resolution, fallback, single LIST per context, already-extracted skip, LIST failure fallback, workspace-scoped resolution and missing-dependency error accounting.Verification
Verified against a live APIM instance: a named value with
name ≠ displayNamereferenced from an API policy (plus a control named value withname == displayName) went from3 resources extracted, 1 errorswith no artifact to4 resources extracted, 0 errors, with the artifact written under its resource name.Not in scope (follow-up)
publish-service.tskeys artifacts bynameand would miss the same mismatch when deciding what to include.transitive-resolver.tsis intentionally untouched to avoid conflicting with fix(extract): ignore Liquid expressions in named value discovery #290.Related Issue(s)
Closes #291