kestrel

Increasing the maximum upload size limit for a Dockerized ASP.NET Core site running on Azure?

隐身守侯 提交于 2019-12-07 12:08:43
问题 Here is the architecture of the application: Web API written in ASP.NET Core. Dockerfile builds the Web application using microsoft/dotnet:2.1-sdk and executes the API using microsoft/dotnet:aspnetcore-rumtime . The app is compiled and placed into /app . The command executed to start the API is: ENTRYPOINT ["dotnet", "/app/WebAPI.dll"] This API is deployed to an Azure Container Registry (Docker registry). An Azure App Service is used to host the API. The App Service is configured to pull the

Access environment name in Program.Main in ASP.NET Core

懵懂的女人 提交于 2019-12-04 23:37:05
Using ASP.NET Mvc Core I needed to set my development environment to use https, so I added the below to the Main method in Program.cs: var host = new WebHostBuilder() .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseStartup<Startup>() .UseKestrel(cfg => cfg.UseHttps("ssl-dev.pfx", "Password")) .UseUrls("https://localhost:5000") .UseApplicationInsights() .Build(); host.Run(); How can I access the hosting environment here so that I can conditionally set the protocol/port number/certificate? Ideally, I would just use the CLI to manipulate my hosting environment like so:

How can I know when Kestrel has started listening?

China☆狼群 提交于 2019-12-04 08:27:12
I need to notify systemd that my service has started up successfully, and a task it needs to run after startup requires that the server is already listening on the target Unix domain socket. I am using IWebHost::Run to start the server, and that is a blocking call. Additionally, I am unable to find any obvious way to set a delegate or callback event for successful initialization. Anyone? On .Net Core 1.x it is safe to just run IWebHost.Start() and assume that the server is initialized afterwards (instead of Run() that blocks the thread). Check the source . var host = new WebHostBuilder()

Service Fabric https endpoint with kestrel and reverse proxy

↘锁芯ラ 提交于 2019-12-03 17:02:29
I've been trying to setup Https on a stateless API endpoint following the instructions on the microsoft documentations and diverse post/blogs I could find. It works fine locally, but I'm struggling to make it work after deploying it on my dev server getting Browser : HTTP ERROR 504 Vm event viewer : HandlerAsyncOperation EndProcessReverseProxyRequest failed with FABRIC_E_TIMEOUT SF event table : Error while processing request: request url = https://mydomain:19081/appname/servicename/api/healthcheck/ping, verb = GET, remote (client) address = xxx, request processing start time = 2018-03-13T14

Using appsettings.json to configure Kestrel listen port Dotnet core 2 preview 2

强颜欢笑 提交于 2019-11-30 11:24:34
问题 From what I understand the correct way of setting listen ports for ASP Dotnet Core 2 preview 1/2 is by creating a Kestrel section in the appsettings.json in the following format: "Kestrel": { "EndPoints": { //Could also be Endpoints, it's a bit unclear "Http": { "Address": "127.0.0.1", "Port": 9001 //the port you want Kestrel to run on }, I have tried to set up the sample webapp on a Debian machine, but when I start the app, it writes out that the app is listing on port 5000, the default port

Using appsettings.json to configure Kestrel listen port Dotnet core 2 preview 2

旧巷老猫 提交于 2019-11-30 00:11:06
From what I understand the correct way of setting listen ports for ASP Dotnet Core 2 preview 1/2 is by creating a Kestrel section in the appsettings.json in the following format: "Kestrel": { "EndPoints": { //Could also be Endpoints, it's a bit unclear "Http": { "Address": "127.0.0.1", "Port": 9001 //the port you want Kestrel to run on }, I have tried to set up the sample webapp on a Debian machine, but when I start the app, it writes out that the app is listing on port 5000, the default port.. I know that the appsettings.json is read, because when I change the logging level to Trace, I get

Asp.Net Core Web API app: how to change listening address?

我的梦境 提交于 2019-11-27 21:53:03
问题 I write simple Asp.Net Core WebAPI 2.0 application, it works on my local machine. But i want to deploy it to server. So, i do it. My system: Ubuntu 16.04. Asp.Net WebAPI 2.0 (and dotnet version 2.1.105) But, when app starts it writes: Now listening on:http://localhost:53115 When i try to get values from it: http://id_address:53115/api/values And i can not get response. In Postman: Could not get any response There was an error connecting to http://id_address:53115/api/values. Why this might