-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
37 lines (33 loc) · 1.24 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using Azure.Identity;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
namespace aspnet_webapp
{
public class Program
{
public static void Main(string[] args)
{
var builder = CreateHostBuilder(args);
builder.Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration(config =>
{
config.AddAzureKeyVault(
new Uri(Environment.GetEnvironmentVariable("KEY_VAULT_URL")),
new DefaultAzureCredential() // Try different strategies to acquire credentials
);
})
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.ConfigureKestrel(k=>{
k.Limits.MaxRequestBodySize=2_000_000_000;// 1Gi
k.Limits.MaxResponseBufferSize=5_000_000; // 5MI
});
webBuilder.UseStartup<Startup>();
});
}
}