I am trying to configure a periodic refresh of Key Vault values. My original code generated by Visual Studio looks like this
var keyvaultEndpoint = new Uri($"https://{vaultName}.vault.azure.net/");
config.AddAzureKeyVault(
keyVaultEndpoint,
new DefaultAzureCredential()
);
I found one of the extension methods accepts an object of type AzureKeyVaultConfigurationOptions
which has a TimeSpan property named ReloadInterval
. It turns out this extension method was a part of Microsoft's older SDK that has been replaced as discussed in this SO post. In case the post disappears, the OP encountered this error, which talks about the package "Microsoft.Azure.KeyVault" being replaced with "Azure.Security.KeyVault" and they recommend moving to the latest code. Since AzureKeyVaultConfigurationOptions
is an SDK v3 object it is no longer recommended.
So if AzureKeyVaultConfigurationOptions
is not included in the new SDK, what is the recommended way to set a reload interval?