Example #1
0
        public override async Task RunAsync()
        {
            var functionApp = await AzureHelper.GetFunctionApp(FunctionAppName, AccessToken);

            if (functionApp != null)
            {
                ColoredConsole.WriteLine(TitleColor("App Settings:"));
                foreach (var pair in functionApp.AzureAppSettings)
                {
                    ColoredConsole.WriteLine($"Loading {pair.Key} = *****");
                    _secretsManager.SetSecret(pair.Key, pair.Value);
                }

                ColoredConsole.WriteLine();

                ColoredConsole.WriteLine(TitleColor("Connection Strings:"));
                foreach (var connectionString in functionApp.ConnectionStrings)
                {
                    ColoredConsole.WriteLine($"Loading {connectionString.Key} = *****");
                    _secretsManager.SetConnectionString(connectionString.Key, connectionString.Value.value);
                }
            }
            else
            {
                ColoredConsole.Error.WriteLine(ErrorColor($"Can't find function app by name {FunctionAppName}"));
            }
        }
Example #2
0
 public override Task RunAsync()
 {
     if (string.IsNullOrEmpty(Value))
     {
         ColoredConsole.Write("Please enter the value: ");
         Value = SecurityHelpers.ReadPassword();
     }
     if (IsConnectionString)
     {
         _secretsManager.SetConnectionString(Name, Value);
     }
     else
     {
         _secretsManager.SetSecret(Name, Value);
     }
     return(Task.CompletedTask);
 }