1
votes

I saw a lot of posts about this issue. I want to create my pipeline from Azure DevOps to Azure App Service.

In DevOps I created my pipeline like:

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

In the Release I deploy the artifact to the App Service. In Kudu of the App Service, I can see all files.

enter image description here

I deleted the App Service and re-deploy with the same result. Then I try to deploy directly from Visual Studio but I have another error.

enter image description here

Then, I check the logs in Kudu and I found in the eventlog.xml those errors:

<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>

Where am I doing something wrong?

2
Hi @Enrico. s there any update about this ticket? Feel free to let me know if the answers could give you some help. Just a remind of this.Kevin Lu-MSFT

2 Answers

0
votes

The deployment from DevOps is most likely using a feature called Run From Package which runs the app from the zip file and puts the D:/home/site/wwwroot directory in read only mode. Based on the application type DevOps will attempt to pick the best deployment method. Run from package is recommended to avoid issues with locked file and to ensure the files that are running.

If you want DevOps to use another method you'll want to use ZipDeploy without Run From Package or Msdeploy. I haven't worked extensively with YAML in DevOps but I think you'll want to do something like this under the input depending on whether you choose zipDeploy or msDeploy.

deploymentMethod: zipDeploy/msDeploy

https://docs.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

0
votes

For Azure App Service: “You do not have permission to view this directory or page”

From the screenshot, the files have been upload to the site/wwwroot path successfully.

You need to check the Path mappings of your Application Settings. Then in the Virtual applications and directories section, You need to change your Physical path to site/wwwroot/appname.

You could get more detailed steps in the Blog.

If above doesnot work out. You can do below steps to show more error messages and troubleshoot the issue.

  • Go to Your Web App in Azure> App Service logs >turn on Detailed Error Messages.
  • In the Web Config file add <customErrors mode="Off" /> under <system.web> tag, add <httpErrors errorMode="Detailed"></httpErrors> under <system.webServer> tag. And update the web.config file to your azure web app.

Check out this thread for details.

For the error in Visual Studio

You could refer to this ticket

Delete the App Setting "WEBSITE_RUN_FROM_PACKAGE" and it will let you redeploy.