本文介绍了Azure DevOps 不会从 ZIP 部署发布 Web 应用程序,而是将其作为只读 ZIP 包运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个 Azure DevOps 管道,它以 ZIP 包的形式运行我们的应用程序

此外,您可以通过删除门户中的 WEBSITE_RUN_FROM_ZIPWEBSITE_RUN_FROM_PACKAGE 应用程序设置来关闭它.

请注意,这将清除您的网络应用程序,直到您下次发布为止.

希望这会有所帮助.

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)sFolderProject.csproj'
    msbuildArgs: '/p:OutputPath="$(build.binariesDirectory)Folderin" /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 包运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 20:19