0
votes

I've been deployed my app with FTP several times and always worked until now. I'm not using docker, so I suppose azure is dockerizing my app after I upload the files. I'm getting two errors, I'm not sure if are related with the port, my lunchsettings.json, my startup project... I'm using net core 3.1 and angular 6.

I've tried adding PORT, ASPNETCORE_URLS...and other variables to Azure application settings...

Here the error:

Logs from Azure: Diagnose and solve problems: Application Logs

2020-05-29T05:34:18.801Z INFO - Starting container for site 2020-05-29T05:34:18.802Z INFO - docker run -d -p 6115:8080 --name upisite_0_99ae64d5 -e WEBSITE_SITE_NAME=Upisite -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=upisite.azurewebsites.net -e WEBSITE_INSTANCE_ID=cdbb42914fa53f4972f5e7c6469f3e4ef2f3e5cb1017cfc16cde43debbb77243 appsvc/dotnetcore:3.1-latest_20200101.1

2020-05-29T05:34:18.805Z INFO - Logging is not enabled for this container. Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here. 2020-05-29T05:37:18.731Z INFO - Waiting for response to warmup request for container upisite_0_99ae64d5. Elapsed time = 178.6585207 sec 2020-05-29T05:37:33.866Z INFO - Waiting for response to warmup request for container upisite_0_99ae64d5. Elapsed time = 193.7941907 sec 2020-05-29T05:37:51.054Z INFO - Waiting for response to warmup request for container upisite_0_99ae64d5. Elapsed time = 210.9819339 sec 2020-05-29T05:38:06.216Z INFO - Waiting for response to warmup request for container upisite_0_99ae64d5. Elapsed time = 226.14369 sec 2020-05-29T05:38:15.145Z ERROR - Container upisite_0_99ae64d5 for site upisite did not start within expected time limit. Elapsed time = 235.0733223 sec **2020-05-29T05:38:15.154Z ERROR - Container upisite_0_99ae64d5 didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging. 2020-05-29T05:38:15.175Z INFO - Stopping site upisite because it failed during startup.**

Logs from Azure: Diagnose and solve problems: Container Crash

2020-06-01T16:54:06.752807040Z [40m[1m[33mwarn[39m[22m[49m: Microsoft.AspNetCore.Server.Kestrel[0] 2020-06-01T16:54:06.752872042Z Unable to bind to http://localhost:5000 on the IPv6 loopback interface: 'Cannot assign requested address'. 2020-06-01T16:54:06.806104175Z 2020-06-01 16:54:06.7760|WARN|Microsoft.AspNetCore.Server.Kestrel|Unable to bind to http://localhost:5000 on the IPv6 loopback interface: 'Cannot assign requested address'. 2020-06-01T16:54:06.998607188Z 2020-06-01 16:54:06.9983|INFO|Microsoft.Hosting.Lifetime|Now listening on: http://localhost:5000

Mi Program class

public static void Main(string[] args)
        {
            // ASP.NET Core 3.0+:
            // The UseServiceProviderFactory call attaches the
            // Autofac provider to the generic hosting mechanism.
            var host = Host.CreateDefaultBuilder(args)
                .ConfigureLogging(logging =>
                {
                    logging.ClearProviders();
                    logging.AddConsole();
                })
                .UseServiceProviderFactory(new AutofacServiceProviderFactory())
                .ConfigureWebHostDefaults(webHostBuilder => {
                    webHostBuilder
              .UseContentRoot(Directory.GetCurrentDirectory())
              .UseIISIntegration()
              .UseStartup<Startup>();
                })
                .Build();
            host.Run();
        }

* Mi Startup class *

 public Startup(IWebHostEnvironment env)
        {
            var builder = new ConfigurationBuilder()
        .SetBasePath(env.ContentRootPath)
        .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
        .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
        .AddEnvironmentVariables();
            this.Configuration = builder.Build();
        }

* Mi lunchsettings.json *

{
  "iisSettings": {
    "windowsAuthentication": false,
    "anonymousAuthentication": true,
    "iisExpress": {
      "applicationUrl": "http://localhost:5000",
      "sslPort": 0
    }
  },
  "$schema": "http://json.schemastore.org/launchsettings.json",
  "profiles": {
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}
1
Has your problem been resolved? Did you find a solution?Jason Pan
@Jason I've added more details.Felipe Rojo Amadeo

1 Answers

0
votes

Azure web app only support port 80 and 443. For more details, you can see post1 and post2.

I can see the error which contains port 8080. I guess this might be the cause of the error, you can check it.

If u need use port 8080, you can use Cloud Services or Virtual Machines.