Closed mdmoura closed 5 years ago
I believe the artifacts are downloaded (when you use DownloadPipelineArtifacts task) under a sub-folder called "drop".
In the AzureRmWebAppDeployment task, can you change the Package input as below and tell us if that works? Package: '$(build.artifactstagingdirectory)/*/MyAppName.zip'
@mdmoura can you please see if AzureRmWebAppDeployment task input "package" set to "'$(Pipeline.Workspace)/*/.zip'" helps you. ( Package: '$(Pipeline.Workspace)/*/.zip' ).
For you reference please see below sample YAML which builds and deploys the dot net web app to azure
trigger:
- master
variables:
BuildConfiguration: 'release'
BuildPlatform: 'any cpu'
Solution: '**\*.sln'
AzureEndPointConnection: '<Your End point connection name>'
AzureResourceGroupName: '<Resource Group Details>'
AzureWebAppName: '<Web App Name>'
stages:
- stage: 'Build'
displayName: "Build DotNet App"
jobs:
- job: 'BuildJob'
pool:
name: Hosted VS2017
demands:
- msbuild
- visualstudio
steps:
- task: NuGetInstaller@0
displayName: 'NuGet restore'
inputs:
solution: '$(Solution)'
- task: VSBuild@1
displayName: 'Build solution'
inputs:
solution: '$(Solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactstagingdirectory)\\"'
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
- task: PublishSymbols@1
displayName: 'Publish symbols path'
inputs:
SearchPattern: '**\bin\**\*.pdb'
continueOnError: true
- task: CopyFiles@2
displayName: 'Copy ARM templates'
inputs:
SourceFolder: ArmTemplates
TargetFolder: '$(build.artifactstagingdirectory)'
- upload: $(build.artifactstagingdirectory)
- stage: Deployment
displayName: "Deploy Dot Net App"
dependsOn: Build
jobs:
- deployment: 'DeploymentJob'
environment: ProdEnvironment-DotNetApp
pool:
name: Hosted VS2017
strategy:
runOnce:
deploy:
steps:
- task: AzureResourceGroupDeployment@2
displayName: 'Azure Deployment:Create Azure App Service'
inputs:
azureSubscription: $(AzureEndPointConnection)
resourceGroupName: '$(AzureResourceGroupName)'
location: 'South Central US'
csmFile: '$(Pipeline.Workspace)/**/windows-webapp-template.json'
overrideParameters: '-webAppName "$(AzureWebAppName)" -hostingPlanName "$(AzureWebAppName)-plan" -appInsightsLocation "South Central US" -sku "S1 Standard"'
steps:
- task: AzureRmWebAppDeployment@4
displayName: 'Deploy Azure App Service'
inputs:
azureSubscription: $(AzureEndPointConnection)
WebAppName: '$(AzureWebAppName)'
Package: '$(Pipeline.Workspace)/**/*.zip'
WebAppUri: webAppUrl
TakeAppOfflineFlag: true
UseWebDeploy: true
RenameFilesFlag: true
@mdmoura - I hope the above suggestions worked for you. let us know if you need any further assistance.
@kmkumaran Thank you for the help ... Out of nothing it my code started working.
I used a tool to compare the code I posted here and the code that was working and the only differences were a few spaces or tabs ... Maybe it was a problem with YML format. Not sure ...
Thank you for the suggestions. Closing this issue.
I have the following Azure-Pipelines.yml to build, test and deploy an ASP.NET Core Application.
The Setup job runs without a problem and at the end the artefacts are created.
I can see from the dropdown that I have a folder
drop
that contains file MyAppName.zip.However when Deploy job runs, after Setup job, I get the error:
Even the DownloadPipelineArtifact@1 runs fine. Only AzureRmWebAppDeployment@4 fails.
I am able to deploy it If I simply move the AzureRmWebAppDeployment@4 to the end of the first job:
Is it possible to make this work with 2 jobs?
Am I missing something or is this a bug?