问题描述
我们有一个Azure DevOps管道,将我们的应用程序作为ZIP包运行
此外,您可以通过删除门户中的 WEBSITE_RUN_FROM_ZIP
或 WEBSITE_RUN_FROM_PACKAGE
应用程序设置将其关闭.
请注意,这将清除您的Web应用程序,直到您下次发布为止.
希望这会有所帮助.
We have an Azure DevOps Pipeline that runs our application as ZIP package https://docs.microsoft.com/en-us/azure/app-service/deploy-run-packageas opposed to ZIP Deploy. So we are not able to SFTP into our Web App and change something. Why does the Pipeline runs our application as ZIP package and how can we change this?This is the Pipeline:
trigger: none
pool:
vmImage: 'windows-latest'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: 'Solution1.sln'
- task: VSBuild@1
inputs:
solution: '$(agent.builddirectory)\s\Folder\Project.csproj'
msbuildArgs: '/p:OutputPath="$(build.binariesDirectory)\Folder\bin" /p:DeployOnBuild=true /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:SkipInvalidConfigurations=true /p:publishUrl="$(build.artifactStagingDirectory)\ProjectTempFolder"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: CopyFiles@2
inputs:
SourceFolder: '$(build.artifactStagingDirectory)\ProjectTempFolder'
Contents: |
**
TargetFolder: '$(build.ArtifactStagingDirectory)\ProjectArtifacts'
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(build.ArtifactStagingDirectory)\ProjectArtifacts'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(build.ArtifactStagingDirectory)\Project.zip'
replaceExistingArchive: true
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(build.ArtifactStagingDirectory)\Project.zip'
- task: AzureRmWebAppDeployment@4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: 'Subscription1'
appType: 'webApp'
WebAppName: 'CoolWebApp777'
packageForLinux: '$(build.ArtifactStagingDirectory)\Project.zip'
It seems you want to disable to run your Web App from a package, AFAIK, the default version in the release pipeline is now set to Version 4
. This version has the "Select deployment method
" checkbox disabled, which in turn, allows the "Run as Package
" feature by default as well. To change this value, go into the "Deploy Azure App Service
" task for each environment and expand Additional Deployment Options. You’ll probably want to change it most often to Web Deploy
:
Besides, you can turn that off by deleting the WEBSITE_RUN_FROM_ZIP
or WEBSITE_RUN_FROM_PACKAGE
application setting in the portal.
Note this will clear your web app until the next time you publish.
Hope this helps.
这篇关于Azure DevOps不会从ZIP部署发布Web应用程序,而是将其作为只读ZIP程序包运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!