Search code examples
azureazure-devopsazure-web-app-service

Azure web app get deployed but wrong content in wwwroot folder


I have a dotnet 6 solution which I deploy with azure-devops in Azure Webapp.

this is part of my yml:

            - task: AzureRmWebAppDeployment@4
              displayName: 'Deploy WebApp'
              inputs:
                ConnectionType: 'AzureRM'
                azureSubscription: 'xxx'
                appType: 'webApp'
                WebAppName: 'default-customer'
                deployToSlotOrASE: true
                ResourceGroupName: 'xxx'
                SlotName: 'production'
                enableCustomDeployment: true
                DeploymentType: 'webDeploy'
                packageForLinux: '$(pipeline.workspace)/drop/WebApp.zip'
                JSONFiles: '**/appsettings.json'

it worked for a while but now suddenly when I deploy it didn't work anymore. Actually it should copy the builded solution into the wwwroot folder. but now when I deploy it show me that is was successful, but, in wwwroot is a archive.xml file and a content folder and there in 'D_C'-> 'a' -> '1'-> 's' -> 'myProjectRoot'-> 'obj'->release -> net6.0 -> ... is my project . and in my log in deploy web app I see that instead of extracting the webapp.zip it call the archive button:

Starting: Deploy WebApp ============================================================================== Task : Azure App Service deploy Description : Deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby Version : 4.231.1 Author
: Microsoft Corporation Help : https://aka.ms/azureappservicetroubleshooting ============================================================================== Got service connection details for Azure App Service:'default-customer' /usr/bin/unzip /home/vsts/work/1/drop/WebApp.zip -d /home/vsts/work/_temp/temp_web_package_9100078503110456 Archive: /home/vsts/work/1/drop/WebApp.zip

do you have any suggestion, why it happen?


Solution

  • I found the problem. The problem was that I have a Web app with windows as operating system but the virtual machine that I referenced in my Yml file was Linux.

    vmImage: 'windows-latest'