First of all I'm building a proof of concept demonstrating a build and deploy (CI/CD0 in Azure Devops. It is and ASP.NET 4.8 WebApp.
Using the tasks like Download Build Artifacts and Publish Build Artifacts and Deploy Azure Webapp I have no problems. But I read that the aforementioned tasks are being deprecated, but as soon as I use the new Publish PipeLine Artifact Download Pipeline Artifact and then deploy Azure Web App it doesn't work. It publishes and downloads the artifact but at the deploy azure web app stage it says it can't find the artifact. Truth is I have no idea what to fill out there. Googling everything I could find. The azure deploy task gives me this error: #[error]Error:
No package found with specified pattern: D:\a\1\drop*.*
Check i
I see the artifact actually downloads in the Download Pipelineartifact :
Download artifact to: D:\a\1
The actual question would be, what do I fill out the AzureWebApp@1 task with the package: '$(Pipeline.Workspace)/drop/.' (This is wrong but how do I make this right ?)
Very much appreciated
john
Here is my YAML file code:
trigger:
- none
stages:
- stage: Build
pool:
vmImage: 'windows-latest'
jobs:
- job: Build
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@1
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Pipeline.Workspace)'
artifact: 'drop'
publishLocation: 'pipeline'
- stage: Deploy
pool:
vmImage: 'windows-latest'
jobs:
- job: Deploy
steps:
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'drop'
targetPath: '$(Pipeline.Workspace)'
- task: AzureWebApp@1
inputs:
azureSubscription: 'tofreewebapp'
appType: 'webApp'
appName: 'freewebappdave'
package: '$(Pipeline.Workspace)/drop/*.*'
deploymentMethod: 'auto'
$(Pipeline.Workspace)
, not$(Pipeline.Workspace)/drop
. You can add ascript
step and do a PowerShellgci -rec
or similar to enumerate all of the files and their paths. – Daniel Mann