Linux Wordpress App Service - View log output from Startup.sh/Startup command

spurro 60 Reputation points
2025-05-31T22:29:51.6433333+00:00

Stack: Wordpress/PHP 8.3

container: mcr.microsoft.com/appsvc/wordpress-debian-php:8.3

How am I able to output to either the devops console or the SCM log stream from startup.sh or the Startup command?

I simply have an 'echo "TEST STARTUP"' in my startup.sh and Startup command, but I cannot see the text output anywhere - SCM, Log Stream in the Azure Portal, Devops. This includes both when I restart the app service and when deploying to the app service from devops.

I know the commands are running because when I set either of them to

echo "TEST STARTUP">>/home/LogFiles/StartupLog.txt

I see the StartupLog.txt file appear and "TEST STARTUP" as the content

Ideally I would like to be able to output log entries to either one of the SCM log files, or somehow get it to appear in the Devops console during deployments

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,937 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jerald Felix 1,630 Reputation points
    2025-06-01T16:29:34.0533333+00:00

    Hi there,

    On Linux App Service, only whatever the main container process writes to stdout or stderr is captured by Log stream (az webapp log tail) and the SCM Docker logs. Anything your startup.sh echoes before that main process is launched never reaches the pipeline—so you won’t see echo "TEST STARTUP" in Log stream or your Azure DevOps console.

    How to surface your startup.sh output

    Turn on log streaming (once per app)

    Portal ▸ Monitoring ▸ App Service logs
    ─ Application logging (Filesystem) → On
    

    Or:

    az webapp log config -g <rg> -n <app> --application-logging filesystem
    

    Redirect everything in startup.sh to stdout / stderr

    # startup.sh
    exec 1>/dev/stdout 2>/dev/stderr     # route subsequent output
    echo "==== WordPress container initialising ===="
    

    or, for a single line

    echo "TEST STARTUP" >&2   # write explicitly to stderr
    

    Tail the stream

    az webapp log tail -g <rg> -n <app>
    

    (or open Monitoring ▶ Log stream in the portal).

    If you still need early-startup diagnostics

    Writing to a file under /home/LogFiles/ (e.g., echo … >> /home/LogFiles/StartupLog.txt) is fine for debugging; you can open the file via Kudu/SSH. But for day-to-day visibility, redirecting to stdout/stderr is the cleanest approach.

    Why nothing shows in the Azure DevOps release logs DevOps captures the build/deploy pipeline only—it doesn’t stream what happens inside the running container. Use Log stream or Azure Monitor for runtime output.

    Hope that clears things up!

    Best Regards,

    Jerald Felix


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.