gpt4 book ai didi

azure - 从 Azure DevOps 发布到 Azure 应用服务 : "You do not have permission to view this directory or page"

转载 作者:行者123 更新时间:2023-12-03 03:56:47 38 4
gpt4 key购买 nike

我看到很多关于这个问题的帖子。我想创建从 Azure DevOps 到 Azure 应用服务的管道。

在 DevOps 中,我创建了如下管道:

pool:
name: Azure Pipelines
steps:
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: restore
projects: |
**/PowerBIDashboard.csproj
**/PowerBIDashboard.Tests.csproj

- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: test

- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
projects: '**/*.csproj'
arguments: '-o publish_output'

- task: ArchiveFiles@2
displayName: 'Archive Files'
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)/publish_output'
includeRootFolder: false
archiveFile: '$(System.DefaultWorkingDirectory)/$(Build.BuildId).zip'

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(System.DefaultWorkingDirectory)/$(Build.BuildId).zip'
condition: succeededOrFailed()

enter image description here

发布中,我将工件部署到应用服务。在应用服务的 Kudu 中,我可以看到所有文件。

enter image description here

我删除了应用服务并重新部署,结果相同。然后我尝试直接从 Visual Studio 进行部署,但出现另一个错误。

enter image description here

然后,我检查 Kudu 中的日志,并在 eventlog.xml 中发现了这些错误:

<Events>
<Event>
<System>
<Provider Name="ZipFS"/>
<EventID>0</EventID>
<Level>1</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2020-10-10T16:24:34Z"/>
<EventRecordID>-1126954890</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C97A29</Computer>
<Security/>
</System>
<EventData>
<Data>Failed to open siteversion.txt. ZipFS setup failed. Error: 0x80070003</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="ZipFS"/>
<EventID>0</EventID>
<Level>1</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2020-10-10T16:24:34Z"/>
<EventRecordID>-1126954875</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C97A29</Computer>
<Security/>
</System>
<EventData>
<Data>Failed to copy zip from remote source.</Data>
</EventData>
</Event>
</Events>

我哪里做错了?

最佳答案

DevOps 的部署很可能使用名为“从包运行”的功能,该功能从 zip 文件运行应用程序,并将 D:/home/site/wwwroot 目录置于只读模式。 DevOps 将根据应用程序类型尝试选择最佳部署方法。建议从包运行以避免文件锁定问题并确保文件正在运行。

如果您希望 DevOps 使用其他方法,您需要使用 ZipDeploy,而不使用 Run From Package 或 Msdeploy。我没有在 DevOps 中广泛使用 YAML,但我认为您会想要在输入下执行类似的操作,具体取决于您选择 zipDeploy 还是 msDeploy。

部署方法:zipDeploy/msDeploy

https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-rm-web-app-deployment?view=azure-devops#prerequisites-for-the-task

Run from package reference

Dev Ops deployment type Reference

关于azure - 从 Azure DevOps 发布到 Azure 应用服务 : "You do not have permission to view this directory or page",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64295928/

38 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com