Search code examples
azureazure-web-app-serviceazure-web-app-for-containers

Deploy Web App Linux starts in Container even publishing model is code


I deployed .net core 6 project in Web App(Linux, which is up and running and when I see the log stream, I can see below logs

Log Stream Logs

when I created the Web App(f1) used following Properties

  1. Publishing model- "Code"
  2. Runtime Stack = "Dotnetcore - 6.0"
  3. Operating System = "Linux"

Even as I selected "Code" instead of Container, why Web App running in container ? What's the difference between selection "Code" and "Container" as Publishing model.

And Kudo also showing "This site can’t be reached ERR_TIMED_OUT",


Solution

  • Azure App Service for Linux by default uses Linux container to host the web apps, hence those container logs can be seen in Log stream. It won't be same with windows web apps.

    Windows:

    enter image description here

    What's the difference between selection "Code" and "Container" as Publishing model.

    1. Publish mode: Code

    • When you choose "Code" as publish mode, App service will expect you to deploy your code.
    • Hence, it provides runtime stack (such as Node.js, .NET, Python, etc.) to choose as per our requirement, and it will execute the code within that particular runtime environment.
    • It takes complete control of managing the infrastructure to run the code, so we just have to deploy our code.

    2. Publish mode: Container

    • When you choose "Container" as the publish mode, we have to deploy pre-built Docker image of our application (with the complete code, packages and the configuration) to the web app.
    • It gives flexibility and control over the runtime environment.
    • This mode can be used when we want to deploy a pre-configured containerized application and need specific runtime stacks.

    When you deploy web app choosing code as publish mode, you can see deployment logs and status in deployment center=>logs:

    enter image description here

    enter image description here

    When you select Container as publish mode, the logs will be as shown below:

    enter image description here

    As it can be seen in your logs, it couldn't find the manifest file.

    enter image description here

    To resolve this,

    • Re-Deploy your web app and try to run again.
    • Add port setting before running the web app, Go to App Aervice=>Settings =>Configuration=> Add Application settings=> Name=WEBSITES_PORT & value=8080.