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?

  • I have tried configuring the DevOps pipeline to use alternate methods (WebApp, Zip Package etc). The wwwroot folder contains all the files as expected in each scenario.
  • I have downloaded the Kudu dump. There are lots of files or folders. I'm not sure what I'm looking at. Nonetheless I cannot find any obvious errors, though neither can I find "startup.log" or similar

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

1

There are 1 best solutions below

2
Harshitha On BEST ANSWER

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

  • Another way is to check under Development Tools =>Advanced Tools => Kudu => Go , then download Diagnostic dump from the Tools.

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

enter image description here

My deployed files

  • You can check the deployment logs in Zip push Deploy option in Tools and also check your 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

  • An alternative is to Build and Deploy your Azure Web app with YAML pipeline, where you can check out all the files correctly and publish it as an artifact while deployment.
  • This way you can check if all the files are deployed and published correctly including your Webjob and Blazor app.
  • I used the build from my yaml pipeline and used it as an artifact in the release pipeline.

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