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
- README.md
- source code documentation
- SDK API docs on https://docs.microsoft.com
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:
- Created a year ago
- Reactions:1
- Comments:22 (11 by maintainers)
I should mention that
3.0.0
of@azure/identity
is out now with the identity-side fixes too!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!