The VaultHelper function helps you fetch the KeyVault details for an application. The IVaultHelper instance returned when GetVaultHelper() is called fetches KeyVault values using the following method:
var vaultHelper = GetVaultHelper();
var logHelper = GetLogHelper();
var vault = await vaultHelper.GetValue("MyApp");
logHelper.LogDebug(vault["AppKey"]);
logHelper.LogDebug(vault["AppSecrets"]);
CODE
Console Output
"Your_Key"
"Your_Secrets"
CODE
To set and update value in vault
Using the Vault API, you can set and update value in vault, which is stored in encrypted format. You cannot retrieve vault value using any API. You can retrieve vault values only using the VaultHelper function.
Create: POST: /pricing/api/admin/Vault
It creates an application with the specified key value name and application name.
You can create multiple applications and store multiple secrets as KeyValue in a single application using the POST API and retrieve those secrete values using the VaultHelper function by passing AppName.
Update: PUT /pricing/api/admin/Vault/{appName}
It updates an existing application vault information with a new value.