I’m deploying to an Azure Web App using an Azure DevOps pipeline.
My pipeline includes the steps:
- task: DotNetCoreCLI@2
displayName: 'Prepare bundle'
inputs:
command: 'publish'
arguments: '--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)/drop'
projects: '**/*.csproj'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Build.ArtifactStagingDirectory)/drop'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/app.zip'
- task: AzureRmWebAppDeployment@4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: '$(azureSubscription)'
WebAppName: '$(appName)'
packageForLinux: '$(Build.ArtifactStagingDirectory)/app.zip'
appType: 'webAppLinux'
DeploymentType: 'runFromZip'
displayName: 'Deploy to Azure Web App'
My deploy succeeds and the appropriate files seem to be in the appropriate places. However, my app is not served and the logs show these errors:
2024-06-08T17:51:10.456139654Z: [INFO] DotNet Runtime 8.0WARNING: Unable to find the startup DLL name. Could not find any files with extension '.runtimeconfig.json'
2024-06-08T17:51:10.477669204Z: [INFO] Writing output script to '/opt/startup/startup.sh'
2024-06-08T17:51:10.622328989Z: [INFO] Trying to find the startup DLL name...
2024-06-08T17:51:10.624377013Z: [INFO] Running the default app using command: dotnet "/defaulthome/hostingstart/hostingstart.dll"
2024-06-08T17:51:13.009364109Z: [INFO] Hosting environment: Staging
2024-06-08T17:51:13.009405709Z: [INFO] Content root path: /defaulthome/hostingstart/
If I unzip the archive in the wwwroot folder, my application is served, which tells me the contents and structure of the folder are fine. But I understand I should be able to serve the application directly from the zip file without extracting it. I’ve also made sure WEBSITE_RUN_FROM_PACKAGE is set to ‘1’ but I believe that var is only for Windows anyway.
Blair Harper is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.