appveyor / ci

AppVeyor community support repository
https://www.appveyor.com
344 stars 65 forks source link

Could not connect to the remote computer ("website-name-here.scm.azurewebsites.net") #3853

Closed sahgilbert closed 1 year ago

sahgilbert commented 1 year ago
Screenshot 2022-11-08 at 13 00 38

The Linux server is deployed and running... How do I fix this error?

Here is my appveyor.yml file:

#---------------------------------#
#      general configuration      #
#---------------------------------#

version: 1.0.{build}-{branch}

branches:
  only:
   - master

#---------------------------------#
#    environment configuration    #
#---------------------------------#

clone_depth: 1

image: Visual Studio 2022

cache:
  - '%LocalAppData%\NuGet\Cache'    # NuGet < v3
  - '%LocalAppData%\NuGet\v3-cache' # NuGet v3

init:
  - cmd: git config --global core.autocrlf true

#---------------------------------#
#       build configuration       #
#---------------------------------#

platform: Any CPU

configuration: Release

before_build:
  - cmd: dotnet --version
  - cmd: dotnet restore ./HousePlatform/HousePlatform.csproj --verbosity m
build_script:
  - cmd: dotnet publish ./HousePlatform/HousePlatform.csproj

#---------------------------------#
#       test configuration       #
#---------------------------------#
test_script:
  - cmd: dotnet build ./UnitTests/UnitTests.csproj --verbosity m
  - cmd: dotnet test

#---------------------------------#
#      artifacts configuration    #
#---------------------------------#

artifacts:
 - path: '.\HousePlatform\bin\Any CPU\Release\net6.0\publish'
   name: WebsiteSourceCode
   type: WebDeployPackage

#---------------------------------#
#     deployment configuration    #
#---------------------------------#

deploy:
- provider: WebDeploy
  server: https://house-platform-dev.scm.azurewebsites.net/msdeploy.axd?site=house-platform-dev
  website: house-platform-dev
  username: $house-platform-dev
  password:
    secure: Tn4uvnR63Vzm4045D+xUnABHny9FWO4LAJnB0aLqVrDjnNHvjedQsaYO2rwHBXErbbCOFUN4LvLn0zLl1R1BLg==
  artifact: WebsiteSourceCode
  aspnet_core: true
  app_offline: true
  do_not_use_checksum: true
  aspnet_core_force_restart: true

Thank you

FeodorFitsner commented 1 year ago

I've never tried deploying to a Linux server with WebDeploy and I'm not even sure if it's supported as WebDeploy is strictly Windows technology. Try using Zip Push deployment instead: https://www.appveyor.com/docs/deployment/azure-app-service-zip-push-deploy/

sahgilbert commented 1 year ago

I've built a demo Asp.Net MVC Core 7.0 project here.

Here is the AppVeyor log output:

Screenshot 2022-11-20 at 19 16 30

Here is the Azure App Service:

Screenshot 2022-11-20 at 19 17 28

Here is the AppVeyor YAML file:

#---------------------------------#
#      general configuration      #
#---------------------------------#

version: 1.0.{build}-{branch}

branches:
  only:
   - master

#---------------------------------#
#    environment configuration    #
#---------------------------------#

clone_depth: 1

image: Visual Studio 2022

cache:
  - '%LocalAppData%\NuGet\Cache'    # NuGet < v3
  - '%LocalAppData%\NuGet\v3-cache' # NuGet v3

init:
  - cmd: git config --global core.autocrlf true

#---------------------------------#
#       build configuration       #
#---------------------------------#

platform: Any CPU

configuration: Release

before_build:
  - cmd: dotnet --version
  - cmd: dotnet restore ./AppVeyorLinuxDeploymentTest/AppVeyorLinuxDeploymentTest.csproj --verbosity m
build:
  publish_wap_xcopy: true
  parallel: true
  verbosity: detailed
build_script:
  - cmd: dotnet publish ./AppVeyorLinuxDeploymentTest/AppVeyorLinuxDeploymentTest.csproj

#---------------------------------#
#       test configuration       #
#---------------------------------#
test_script:
  - cmd: dotnet build ./UnitTests/UnitTests.csproj --verbosity m
  - cmd: dotnet test

#---------------------------------#
#      artifacts configuration    #
#---------------------------------#

artifacts:
 - path: '.\AppVeyorLinuxDeploymentTest\bin\Any CPU\Release\net7.0\publish'
   name: WebsiteSourceCode
   type: Zip

#---------------------------------#
#     deployment configuration    #
#---------------------------------#

deploy:
- provider: AzureAppServiceZipDeploy
  server: https://house-platform-dev.scm.azurewebsites.net:443/msdeploy.axd?site=house-platform-dev
  website: house-platform-dev
  username: $house-platform-dev
  password:
    secure: Tn4uvnR63Vzm4045D+xUnABHny9FWO4LAJnB0aLqVrDjnNHvjedQsaYO2rwHBXErbbCOFUN4LvLn0zLl1R1BLg==
  artifact: WebsiteSourceCode
  aspnet_core: true
  app_offline: true
  do_not_use_checksum: true
  aspnet_core_force_restart: true

@FeodorFitsner What have I not configured correctly in the YAML file? Thanks

FeodorFitsner commented 1 year ago

It won't work if you just replace provider name. AzureAppServiceZipDeploy deployment provider has its own unique settings: https://www.appveyor.com/docs/deployment/azure-app-service-zip-push-deploy/#provider-settings

sahgilbert commented 1 year ago

Yes, and the YAML I posted above contains the various settings for using AzureAppServiceZipDeploy.

I rebooted the server and the application has deployed successfully.

FeodorFitsner commented 1 year ago

OK, thank you for the update!