Beispiel #1
0
        public override void Configure(IFunctionsHostBuilder builder)
        {
            builder.Services.AddOptions <PingPongOptions>()
            .Configure <IConfiguration>((settings, configuration) =>
            {
                var section = configuration.GetSection("PingPongOptions");
                Options     = section.Get <PingPongOptions>();
                section.Bind(settings);
            });

            builder.Services.AddHttpClient <PingPongFunction>()
            .SetHandlerLifetime(TimeSpan.FromMinutes(5))
            .AddPolicyHandler(GetRetryPolicy());
        }
Beispiel #2
0
 public PingPongFunction(HttpClient httpClient, IOptions <PingPongOptions> options, ILogger <PingPongFunction> logger)
 {
     _logger     = logger;
     _httpClient = httpClient;
     _settings   = options.Value;
 }