Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy to web app does not working for .NET 8 and Linux based deployment - azure/webapps-deploy@v3 #155

Open
nikunjbanker opened this issue Feb 3, 2024 · 1 comment

Comments

@nikunjbanker
Copy link

We are using GitHub Action for deploying to Azure Web App verison 3 - azure/webapps-deploy@v3. Detail about our WebApp:

Dotnet SDK version: .NET 8 - dotnet-version: 8.x
Platform: Linux

Below steps in our workflow not working:

- uses: azure/webapps-deploy@v3
      id: deploy-to-webapp
      with:
        app-name: ${{ vars.PP_NAME }}
        package: ${{ steps.download-artifact.outputs.download-path }}
        clean: false
        restart: false

Using azure/webapps-deploy@v3 - Github action getting below error:

##[debug]Initiated deployment via kudu service for webapp package : /home/runner/work/_temp/temp_web_package_7365615165970218.zip
Package deployment using OneDeploy initiated.
##[debug]setting affinity cookie ["ARRAffinity=*******;Path=/;HttpOnly;Secure;Domain=******.scm.azurewebsites.net","ARRAffinitySameSite=*****;Path=/;HttpOnly;SameSite=None;Secure;Domain=******.scm.azurewebsites.net"]
##[debug][POST] https://*******.scm.azurewebsites.net/api/publish?async=true&deployer=GITHUB_ONE_DEPLOY&type=zip&clean=false&restart=false&message=_______slotName%22%3A%22production%22%2C%22commitMessage_____
##[debug]encountered request timedout issue in Kudu. Retrying again
******
Error: Failed to deploy web package to App Service.
Error: Deployment Failed, Error: Failed to deploy web package using OneDeploy to App Service.
Conflict (CODE: 409)

As a workaround, we have tried by directly executing PowerShell command, but its also not working - by creating zip and provided zip file to deploy using Publish-AzWebApp PS command:

   - name: Create Zip
      shell: pwsh
      run: Compress-Archive -Path ${{ steps.download-artifact.outputs.download-path }} -Destinationpath ./myWebApp.zip

    - name: Run Azure PowerShell inline script
      uses: azure/powershell@v1
      with:
        inlineScript: |
          Publish-AzWebApp -ResourceGroupName ${{ vars.RG_NAME }} -Name ${{ vars.WEBAPP_NAME }} -ArchivePath ./myWebApp.zip -Timeout 1000000 -Confirm:$false -Force
        azPSVersion: "latest"

Using PowerShell command, its giving below error:

/usr/bin/pwsh -NoLogo -NoProfile -NonInteractive -Command $env:PSModulePath
/usr/share:/home/runner/.local/share/powershell/Modules:/usr/local/share/powershell/Modules:/opt/microsoft/powershell/7/Modules
Initializing Az Module Complete
Running Az PowerShell Script
/usr/bin/pwsh -NoLogo -NoProfile -NonInteractive -Command /home/runner/work/_temp/*****.ps1
Publish-AzWebApp: /home/runner/work/_temp/*****.ps1:2
Line |
   2 |  Publish-AzWebApp -ResourceGroupName rg-test -Name a …
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Deployment failed with status code GatewayTimeout
Error: Error: The process '/usr/bin/pwsh' failed with exit code 1

It seems, there is an issue while deploying .NET 8 - ASP.NET Core Web application to Linux based App Service. Any workaround or solution will be helpful.

Checked /wwwroot directory using bash shell as well but it also empty.

@MonkeyNinja
Copy link

We are getting something similar when we try to use github actions

##[debug]Loading env
Run Azure/functions-action@v1
Successfully parsed SCM credential from publish-profile format.
::add-mask::***
::add-mask::***
##[debug]Finding files matching input: .
Using SCM credential for authentication, GitHub Action will not perform resource validation.
##[debug][GET] ***ed-content-to-brightsites-dev.scm.azurewebsites.net/api/settings
(node:1739) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use node --trace-deprecation ... to show where the warning was created)
##[debug]getAppSettings. Data: {"statusCode":401,"statusMessage":"Unauthorized","headers":{"content-length":"0","connection":"close","date":"Wed, 15 May 2024 16:15:07 GMT","www-authenticate":"Basic realm="site""},"body":""}
Error: Execution Exception (state: ValidateAzureResource) (step: Invocation)
Error: When request Azure resource at ValidateAzureResource, Get Function App Settings : Failed to acquire app settings from https:///api/settings with publish-profile
Error: Failed to fetch Kudu App Settings.
Unauthorized (CODE: 401)
Error: Error: Failed to fetch Kudu App Settings.
Unauthorized (CODE: 401)
at Kudu. (/home/runner/work/_actions/Azure/functions-action/v1/lib/appservice-rest/Kudu/azure-app-kudu-service.js:69:23)
at Generator.next ()
at fulfilled (/home/runner/work/_actions/Azure/functions-action/v1/lib/appservice-rest/Kudu/azure-app-kudu-service.js:5:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Deployment Failed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants