I tried to deploy Azure Web app with YAML and Release pipeline and it was successful:-
I have referred MS Document1 and MS Document2 for the pipeline code below:-
My Build Pipeline:-
trigger:
- master
pool:
vmImage: windows-latest
steps:
- task: UseDotNet@2
inputs:
version: '6.x'
- task: UseDotNet@2
displayName: 'Install .NET Core SDK'
inputs:
version: 6.x
performMultiLevelLookup: true
includePreviewVersions: true # Required for preview versions
- task: DotNetCoreCLI@2
displayName: Build
inputs:
command: build
projects: '**/*.csproj'
arguments: '--configuration $(buildConfiguration)' # Update this to match your need
- task: DotNetCoreCLI@2
inputs:
command: publish
publishWebProjects: True
arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: True
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: 'myWebsiteName'
- task: AzureWebApp@1
inputs:
azureSubscription: '<subscription>'
appType: 'webApp'
appName: 'siliconwebapp32'
package: '$(Build.ArtifactStagingDirectory)/**/*.zip'
deploymentMethod: 'auto'
After the build was successful, The app was deployed. But I used the same build Artifact in my release pipeline to deploy it in another web app and it was successful, Refer below:-
My Release pipeline:-





In order to resolve your error:-
Make sure the Default document is present in your Web app, If not make sure to redeploy your app with proper path to the zipped source code:-

Validate and add the path mapping correctly like below:-

Check if there's any IP restrictions like here-

Check if the Files are correctly deployed by visiting > Advanced Tools > Go > Kudu > Debug console > CMD > site > Check whether all Files are present like below:-

Another way to upload your file and validate is via Zip push Deploy option in Kudu > Tools > Zip push Deploy, Refer below:-


If this does not work, enable App Service Logs like below:-

You can save the logs in your azure storage account and view them.
Check the Log stream and load your web app page for the logs to load and get insights:-

Additionally, Make sure you're using the correct zip file with codes and packages while deployment.