question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Retrieving key vault secret takes 1m 40s with default credentials

See original GitHub issue
  • Package Name: @azure/keyvault-secrrets
  • Package Version: 4.5.1
  • Azure CLI Version: 2.34.0
  • Azure PowerShell Version: 7.2.1
  • Operating system: Windows 10
  • nodejs
    • version: 16.14.0
  • browser
    • name/version: n/a
  • typescript
    • version: 4.8.2
  • Is the bug related to documentation in

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior: Repository where I’ve reproduced the problem: https://github.com/rudfoss/keyvault-secret-test

Expected behavior I’m seeing some strange behavior when retrieving key vault secrets using @azure/keyvault-secrets. Currently it takes about 1m40s to request a single secret using DefaultAzureCredential. I’m signed in to the Azure CLI and Azure PowerShell. My resources are deployed to Norway East. Full repo that reproduces the problem here: https://github.com/rudfoss/keyvault-secret-test

Here is essentially what I’m trying to do:

const cred = new DefaultAzureCredential()
const secretClient = new SecretClient(process.env["KEYVAULT_URI"]!, cred)

console.time("getSecret")
const secret = await secretClient.getSecret("test-secret")
console.timeEnd("getSecret")
console.log({ secret: secret.value })

The strange thing is that it’s not slow when using the same credentials to retrieve an App Configuration setting like this:

const cred = new DefaultAzureCredential()
const configClient = new AppConfigurationClient(process.env["APPCONFIG_URI"]!, cred)

console.time("getConfig")
const configSetting = await configClient.getConfigurationSetting({ key: "test-value" })
console.timeEnd("getConfig")
console.log({ configSetting: configSetting.value })

Would love some pointers on why this is slow and if there is something I can do to fix it.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:22 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
xirzeccommented, Sep 21, 2022

I should mention that 3.0.0 of @azure/identity is out now with the identity-side fixes too!

2reactions
aulonmcommented, Sep 21, 2022

We had the same problem as rudfoss. Version 4.6.0 made it faster than 4.5.0, so we are happy and can update our dependency again from 4.4.0.

Thanks for the fix!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Set and retrieve a secret from Key Vault using Azure portal ...
You can securely store keys, passwords, certificates, and other secrets. Azure key vaults may be created and managed through the Azure portal.
Read more >
Securing Web Application Secrets Through Azure Key Vault
Azure Key Vault is a service for storing securely certificates, credentials, connection strings, and more. In this article, Rishit Mishra walks ...
Read more >
Check for Azure Key Vault Secrets Expiration Date
Ensure that your Azure Key Vault secrets are renewed prior to their expiration ... and identify the number of days (default is 30)...
Read more >
Accessing Azure Key Vault from Azure Function
This article show how to store a SQL Server connection string to Azure Key Vault secret and use it in Azure Functions.
Read more >
Sony tv flickering
I show you how to reset picture back to factory defaults should you have issues with ... the hidden secret service menu in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found