Results
No results found.
This function will get the secret value by a key. If the key does not exist, SDK will return the default_value
// Get a secret value by secret key.
// If they Key does not exist, SDK will return the defaultValue
var secretValue = service.GetSecret(
name: "REDIS_CONNECTION",
defaultValue: "Default Value"
)
Console.WriteLine(secretValue);
// Get a secret value by secret key and specific environment name.
// If the Key does not exist, SDK will return the defaultValue
secretValue = service.GetSecret(
name: "REDIS_CONNECTION",
environmentName: "staging",
defaultValue: "Default Value"
)
Console.WriteLine(secretValue);
// Get a secret value by secret key.
// If they Key does not exist, SDK will throw exception
var options = new SecretRetrieveOptions();
var requestOptions = new RequestOptions();
var secretValue = service.Get(
name: "REDIS_CONNECTION",
retrieveOptions: options,
requestOptions:requestOptions
)
Console.WriteLine(secretValue);
// Get a secret value by secret key and specific environment name.
// If the Key does not exist, SDK will throw exception
var options = new SecretRetrieveOptions();
var requestOptions = new RequestOptions();
var secretValue = service.Get(
name: "REDIS_CONNECTION",
environmentName: "staging",
retrieveOptions: options,
requestOptions:requestOptions
)
Console.WriteLine(secretValue);