azure-web-app-serviceazure-pipelines-release-pipelinekudu

How do I interpret Kudu logs to understand why my azure website is not starting correctly from DevOps release pipeline


I have a hosted blazor webapp and webjob. It deploys as expected when publishing from visual studio. However, when deploying from an DevOps release pipeline, although the task is apparently successful, the site is not left in a workable state, meaning: Static files are available (ie the blazor wasm) but calls to the API fail with 405 (or similar). It appears that the WebApp part of the site is not starting.

So my question is.... "Where can I find a log file that describes any startup errors?"

What have I tried?

After downloading a Kudo dump, where can I find the log file that describes any errors during startup?


Solution

  • Where can I find a log file that describes any startup errors?

    You can find startup errors in the Log Stream section of your Web app.

    Enable Application logging

    enter image description here

    In Log Stream ,check the Start up logs

    enter image description here

    Open the Dump and visit => Log Files => Http => Raw logs and check the logs.

    enter image description here

    My deployed files

    enter image description here

    enter image description here

    I created one Blazor app with webjob and then deployed it to Azure app service via Release and YAML pipeline.

    In your release pipeline you can find the logs here

    enter image description here

    My YAML pipeline script:-

    trigger:
      branches:
        include:
          - main
    
    jobs:
    - job: Build
      displayName: 'Build and Publish'
      pool:
        vmImage: 'ubuntu-latest'
      steps:
      - task: UseDotNet@2
        displayName: 'Install .NET Core SDK'
        inputs:
          version: '6.x'
    
      - task: DotNetCoreCLI@2
        displayName: 'Restore Dependencies'
        inputs:
          command: 'restore'
          projects: '**/*.csproj'
    
      - task: DotNetCoreCLI@2
        displayName: 'Build Project'
        inputs:
          command: 'build'
          projects: '**/*.csproj'
          arguments: '--configuration Release'
    
      - task: DotNetCoreCLI@2
        displayName: 'Publish Project'
        inputs:
          command: 'publish'
          projects: '**/*.csproj'
          publishWebProjects: true
          arguments: '--configuration Release --output $(Build.ArtifactStagingDirectory)'
          zipAfterPublish: true
    
      - task: PublishPipelineArtifact@1
        displayName: 'Publish Artifact'
        inputs:
          targetPath: '$(Build.ArtifactStagingDirectory)'
          artifactName: 'publishedApp'
          publishLocation: 'pipeline'
    
    - job: Deploy
      displayName: 'Deploy to Azure Web App'
      dependsOn: Build
      pool:
        vmImage: 'ubuntu-latest'
      steps:
      - download: current
        artifact: 'publishedApp'
    
      - task: UseDotNet@2
        displayName: 'Install .NET Core SDK'
        inputs:
          version: '6.x'
    
      - task: AzureWebApp@1
        displayName: 'Azure Web App Deploy'
        inputs:
          azureSubscription: 'subscription'
          appType: 'webApp'
          appName: 'valleywebapp09'
          package: '$(Agent.BuildDirectory)/**/*.zip'
          deploymentMethod: 'auto'
    
    

    While running the above pipeline checkmark enable diagnostic logging and run.

    enter image description here

    enter image description here