1
votes

I'm using Azure Dev Ops to run my build and release pipelines. I've got a build script that publishes my web code to an artifact folder (using .NET SDK projects), and I just need to push this code into my Azure app service. I've tried the "Azure app service deploy" and "Deploy code to app service" tasks in the release pipeline, giving it the publish settings file from my Azure instance and pointing to the folder with my code (since it says it takes zip or folder). On the console at this step, however, I get an error message of "No such deploying method exists."

I was able to get things pushed through FTP but I'd like to understand why the app service publish didn't work, as there are options (like deployment slots) that might be needed in the future. Is this a scenario where using the Azure resource manager connection would work better? Or does my build artifact need to be zipped after all? If it has to be zipped as a web deploy, is there a step to do this after a solution build, because I have to copy files into the artifact folder for transforms first, so I can't just do a comprehensive web build/zip.

1
How about the issue? Does the answer below resolved your question? If you have any concern, feel free to share it here.Walter
@KenMcAndrew Can you consider voting up my answer if it was helpful for you?Krzysztof Madej

1 Answers

1
votes

I don't see details of your pipeline so I would share mine. I'm deploying zip package:

enter image description here

In Package or folder dialog I have:

enter image description here

I use YAML in my pipelines but it is easy to understand and follow if you want to have similar in classic pipelines:

trigger: none
pr: none

pool:
  vmImage: 'windows-latest'

variables:
  buildConfiguration: 'Release'
  projectDirectory: 'app-service-deployment-to-slot-with-preview\hadar'

steps:
- script: dotnet build --configuration $(buildConfiguration)
  displayName: 'dotnet build $(buildConfiguration)'
  workingDirectory: $(projectDirectory)

- task: DotNetCoreCLI@2
  displayName: Publish
  inputs:
    command: publish
    publishWebProjects: false
    projects: '$(projectDirectory)\hadar.csproj'
    arguments: '--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)'
    zipAfterPublish: true

- task: CopyFiles@2
  displayName: 'Copy configuration settings checks'
  inputs:
    contents: app-service-deployment-to-slot-with-preview\scripts\**
    targetFolder: '$(Build.ArtifactStagingDirectory)\scripts'
    flattenFolders: true

- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifacts'