My Azure Keys Vaults Secrets contains my connection string. My app only connects to my Azure Vault during the app Startup.cs
and then saves the connection string in a static class for use elsewhere.
I noticed a few days ago that Key Vaults Metrics was showing 2.45k hits during a 6 minute interval.
Here is the Starup.cs
code:
public class Startup
{
var SecretUri = config["SecretUri"];
var TenantId = config["TenantId"];
var ClientSecret = config["ClientSecret"];
var ClientId = config["ClientId"];
var secretclient = new SecretClient(new Uri(SecretUri), new ClientSecretCredential(TenantId, ClientId, ClientSecret));
KeyVaultSecret keyv = secretclient.GetSecret("{myconnection_secretname}");
SecretServices.ConnectionString = keyv.Value;
}
From this point I use the SecretServices.ConnectionString
anywhere else in the app where I need the connection string.
My question is there any way my app can hit the vault 2000 times in a few minutes or is something else happening?
Here is the graph from Azure Vaults Metrics Total API Hits:
This graph shows the sudden jump in the number of hits to the API Service.