devopsseeker
devopsseeker

Reputation: 29

Deploying to Azure linux webapp shows container error on port 8080

I'm trying to deploy a simple .netcore webapp on azure linux app service and I'm getting the below error: ERROR - Container for site has exited, failing site start ERROR - Container didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.

This is a v5.0 .net and deploying the app through azure devops yaml pipeline.

resource "azurerm_linux_web_app" "webapp" {
  name                       = "appname"
  resource_group_name        = data.azurerm_resource_group.rg.name
  location                   = data.azurerm_resource_group.rg.location
  service_plan_id            = data.azurerm_service_plan.appserviceplan.id
  https_only                 = true

  identity {
    type = "SystemAssigned"
  }
 site_config {
    always_on          = true
    
    #container_registry_use_managed_identity = true

    application_stack {
      dotnet_version   = "5.0"
    }
  
    use_32_bit_worker       = false
    vnet_route_all_enabled  = true 
    tags                    = local.all_tags
    app_settings = {
     "APPINSIGHTS_INSTRUMENTATIONKEY"   = azurerm_application_insights.appinsights.instrumentation_key
    
 }
}

Upvotes: 0

Views: 1922

Answers (1)

Venkatesan
Venkatesan

Reputation: 10455

  • I was able to deploy the Azure Linux Web App without any issues

ERROR - Container for site has exited, failing site start ERROR - Container didn't respond to HTTP pings on port: 8080,failing site start

Thank you @Jayendran for the comment,

  • The ports supported by Azure Web App service are 80 and 443 , if we want to run on any other port we need to add the WEBSITES_PORT in Application Settings in Configuration Section

  • Add the value of the port number as whatever your application is listening. As per the error you need to add 8080

Even the same is suggested by @SnehaAgrawal-MSFT

  • Also we can set/change the port in server.js file
const myport= process.env.port || 8080;

Upvotes: 0

Related Questions