/// <summary> /// Gets a secret /// </summary> /// <param name="secretId"> The secret ID </param> /// <returns> The created or the updated secret </returns> private static SecretBundle GetSecret(string secretId) { SecretBundle secret; string secretVersion = inputValidator.GetSecretVersion(); if (secretVersion != string.Empty) { var vaultAddress = inputValidator.GetVaultAddress(); string secretName = inputValidator.GetSecretName(true); secret = keyVaultClient.GetSecretAsync(vaultAddress, secretName, secretVersion).GetAwaiter().GetResult(); } else { secretId = secretId ?? inputValidator.GetSecretId(); secret = keyVaultClient.GetSecretAsync(secretId).GetAwaiter().GetResult(); } Console.Out.WriteLine("Retrieved secret:---------------"); PrintoutSecret(secret); return(secret); }