forked from Azure/azure-functions-dotnet-worker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
42 lines (39 loc) · 1.34 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
38
39
40
41
42
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System.Threading.Tasks;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace FunctionApp
{
class Program
{
static async Task Main(string[] args)
{
// #if DEBUG
// Debugger.Launch();
// #endif
//<docsnippet_startup>
var host = new HostBuilder()
//<docsnippet_configure_defaults>
.ConfigureFunctionsWorkerDefaults(builder =>
{
builder
.AddApplicationInsights()
.AddApplicationInsightsLogger();
})
//</docsnippet_configure_defaults>
//<docsnippet_dependency_injection>
.ConfigureServices(s =>
{
s.AddSingleton<IHttpResponderService, DefaultHttpResponderService>();
})
//</docsnippet_dependency_injection>
.Build();
//</docsnippet_startup>
//<docsnippet_host_run>
await host.RunAsync();
//</docsnippet_host_run>
}
}
}