.NET 7 Azure Web App on Linux not taking startup command

Paul 1 Reputation point
2022-12-13T16:48:46.787+00:00

I have upgrade a .NET 6 web app to .NET 7, but now it is not taking the startup command anymore. I tried providing it in the App Service General settings and in the Azure DevOps build pipeline, but both are not taking. The log does not mention my startup command at all. When logging in via SSH I can see the environment variable PORT2 is not set. I have tried recreating the App Service, but that did not resolve the issue.

root@203286ac5aa2:/opt/startup# env | grep PORT
PORT=8080
SSH_PORT=2222

App Service General settings:

Stack settings:
Stack: .NET
Major version: .NET 7 (STS)
Minor version .NET 7 (STS)
Startup Command: dotnet Service.dll

Build pipeline task:

        - task: AzureWebApp@1  
          inputs:  
            azureSubscription: "Pay-As-You-Go (86726306-bc9b-4332-adef-fc0ef60007e4)"  
            appType: "webAppLinux"  
            appName: ${<!-- -->{ parameters.appName }}  
            package: "extracted/api" af a  
            runtimeStack: "DOTNETCORE|7.0"  
            startUpCommand: "dotnet Service.dll"  

Log:

2022-12-13T15:52:28.263709727Z: [INFO] DotNet Runtime 7.0WARNING: Expected to find only one file with extension '.runtimeconfig.json' but found 3
2022-12-13T15:52:28.263715126Z: [INFO] WARNING: Found files: 'Extensions.Tests.runtimeconfig.json, Service.runtimeconfig.json, Test.runtimeconfig.json'
2022-12-13T15:52:28.263720126Z: [INFO] WARNING: To fix this issue you can set the startup command to point to a particular startup file

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

1 answer

Sort by: Most helpful
  1. ajkuma 28,036 Reputation points Microsoft Employee Moderator
    2022-12-16T09:43:00.933+00:00

    @Paul , Following-up on this,

    Our product team has identified the issue (on .Net 7 webapp not honoring custom startup command specified), and are working on the fix.

    You may try adding App Setting and see if it helps.

    HTTP20_ONLY_PORT=8585

    We apologize for any inconvenience. Thanks for your patience!

    0 comments No comments

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.