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?
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
In Log Stream ,check the Start up logs
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.
My deployed files
Zip push Deploy
option in Tools and also check your files.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
YAML
pipeline, where you can check out all the files correctly and publish it as an artifact while deployment.Webjob
and Blazor app
.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.