Azure App Service Linux startup.sh not found after SKU upgrade to PremiumV3 despite successful Azure DevOps deployment

Jorge Ortiz Flores 0 Reputation points Microsoft Employee
2026-07-17T18:47:21.73+00:00

After upgrading our Azure App Service SKU to PremiumV3/P0v3, the app began failing during startup.

The Azure DevOps deployment completes successfully, but the App Service log stream shows:

Site's appCommandLine: sh startup.shsh: 0: cannot open startup.sh: No such file

The startup.sh file exists in the repository root, and there were no relevant code or YAML changes before this started happening.

Current setup:

App Service: Linux
Runtime: PYTHON|3.11
Deployment: Azure DevOps, AzureWebApp@1
Startup command: sh startup.sh
Deployment method: runFromPackage
SCM_DO_BUILD_DURING_DEPLOYMENT: 0

This started after the SKU upgrade/restart, so I’m trying to understand whether the runtime package mount, startup working directory, or startup command behavior changed.

Main question:

Why would App Service fail to find startup.sh after a successful deployment and SKU upgrade, even though the file exists in the repo?

Azure App Configuration
Azure App Configuration

An Azure service that provides hosted, universal storage for Azure app configurations.


1 answer

Sort by: Most helpful
  1. AI answer

    2026-07-17T18:47:59.1466667+00:00

    The most likely cause is that App Service is starting with sh startup.sh, but the file is not present in the deployed runtime content that the app actually starts from, even though it exists in the source repository.

    Supported reasons from the documented behavior:

    1. Startup commands must resolve relative to the project root
      For Linux Python apps, all commands in a custom startup command or startup command file must use paths relative to the project root folder. If App Service cannot resolve startup.sh from the deployed app root, startup fails with the exact kind of error shown.
    2. A successful deployment pipeline does not guarantee the startup file is in the runtime content
      App Service documentation explicitly says that if the expected startup behavior does not occur, verify that the startup command file is deployed to App Service along with the app code. This matches the symptom: deployment succeeded, but the runtime container cannot open startup.sh.
    3. For Python on Linux, App Service falls back to framework detection if the custom startup command fails
      App Service ignores errors while processing a custom startup command or file and then continues looking for Django or Flask apps. That means the deployment can appear successful while startup still fails because the custom file is missing or invalid.
    4. The deployed content, not the repo, determines startup
      The Python troubleshooting guidance says to use SSH and verify files under site/wwwroot. If the files are not there, the issue is with what was deployed or mounted, not with the repository contents.

    Given the current configuration, the practical explanation is:

    • startup.sh exists in source control.
    • The package mounted or extracted for the running app does not contain startup.sh at the app root that App Service is using.
    • After the SKU upgrade/restart, the app restarted against the actual deployed package, exposing that mismatch.

    Checks to run:

    1. Verify the file in the running app
      Open an SSH session to the app and check whether site/wwwroot/startup.sh exists. The guidance for Python App Service specifically recommends verifying files under site/wwwroot.
    2. Confirm the deployment artifact layout
      Ensure the deployment package places startup.sh in the package root, not inside a subfolder. App Service expects the startup command path relative to the project root.
    3. Review deployment logs
      In Azure portal: Deployment Center > Logs > latest Commit ID > Show Logs next to Running oryx build. These logs can reveal whether expected files were included or whether the dependency/build layout differs from what App Service expects.
    4. Check whether the app is showing the default app or startup failure symptoms
      If needed, use Diagnose and solve problems and review Application Logs, Container Crash, and Container Issues.
    5. If the file is missing from site/wwwroot, correct the deployment package
      The Kudu publish behavior for startup artifacts shows that startup scripts on Linux are expected under home/site/wwwroot/startup.sh by default when deployed as a startup artifact. If the package or deployment task is not placing the file there, App Service will not find it.

    What this means for the root cause:

    • The SKU upgrade itself is not documented as changing startup command semantics.
    • The documented failure mode is consistent with the startup script not being present at the deployed app root or not being referenced with the correct relative path.
    • Since SCM_DO_BUILD_DURING_DEPLOYMENT is 0, there is no build step correcting package layout during deployment, so App Service starts only from what was packaged and deployed.

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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