Skip to content

Secret loading is sequential and missing pre-emptive authentication #191

Closed
@ronfor

Description

@ronfor

Summary

While using the library to load App Configuration, I’ve observed slow performance due to two key issues:

  • Secrets are fetched from Key Vault sequentially
  • No pre-emptive authentication is performed

Investigation

This behaviour was identified using Application Insights, with traces collected via OpenTelemetry on a Node.js process.

Below is an example trace showing a single configuration lookup referencing 14 secrets (which are stored in 4 x separate vaults):
Image

The loadConfig trace wraps the point we call the load function:

export async function load(

Each secret fetch initially results in a 401 (unauthenticated), followed by a successful retry after authentication. This happens for every unique Key Vault endpoint used.

Despite the environment running within Azure, the full configuration load takes approximately 2 seconds, introducing noticeable latency.

Expected behaviour

Performance could be improved significantly if:

  • Secrets were fetched in parallel
  • Authentication was performed proactively, avoiding repeated 401/retry cycles

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions