Exemplo n.º 1
0
        private static async Task <ApiResult> SaveSecretToKeyValutAsync(string keyvaultName, string name, string value)
        {
            KeyVaultManager keyVaultManager = new KeyVaultManager();

            try
            {
                var secret = await keyVaultManager.SaveSecretStringAsync(keyvaultName, name, value);

                return(ApiResult.CreateSuccess(JToken.FromObject(secret)));
            }
            catch (Exception ex)
            {
                return(ApiResult.CreateError(ex.Message));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// GetSecretsAndDeleteSecretsFromKeyVaultAsync
        /// </summary>
        /// <param name="keyvaultName">keyvaultName</param>
        /// <param name="flowId">flowId</param>
        /// <returns>ApiResult which contains error or successful result as the case may be</returns>
        private static async Task <ApiResult> GetSecretsAndDeleteSecretsFromKeyVaultAsync(string keyvaultName, string flowId)
        {
            KeyVaultManager keyManager = new KeyVaultManager();

            try
            {
                var response = await keyManager.GetAndDeleteSecretsAsync(keyvaultName, flowId);

                return(ApiResult.CreateSuccess(JToken.FromObject(response)));
            }
            catch (Exception ex)
            {
                return(ApiResult.CreateError(ex.Message));
            }
        }