using strategy does not work for AzureRmWebAppDeployment#4 - azure-devops

I started using the strategy runonce yaml schema so i can add environment tag to my relase and add approval steps. https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema
BUT doing so AzureRmWebAppDeployment#4 step deploy whol file in the format below
/site/wwwroot/mywebApi/Content/D_C/a/1/s/src/mywebApi/obj/Release/Package/PackageTmp/
instead of unziping the package to /site/wwwroot/mywebApi/
this used to work when i did not use strategy
this used to work
jobs:
- job: Deploy
variables:
vmImage: 'windows-latest'
pool:
vmImage: $(vmImage)
displayName: 'Deploy ${{ parameters.project }} ${{ parameters.envName }}'
continueOnError: "false"
steps:
- task: DownloadBuildArtifacts#0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: '${{ parameters.project }}${{ parameters.envName }}'
downloadPath: '$(build.artifactStagingDirectory)'
- task: AzureRmWebAppDeployment#4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: '****Azure'
appType: 'webApp'
WebAppName: '${{ parameters.webAppName }}'
deployToSlotOrASE: true
ResourceGroupName: '****'
SlotName: '${{ parameters.slotName }}'
VirtualApplication: '${{ parameters.virtualApplication }}'
packageForLinux: '$(build.artifactStagingDirectory)/**/*.zip'
this does not work but this is what i want for tagging release with environment
jobs:
# track deployments on the environment
- deployment: DeployWeb
displayName: deploy paystub Web App
environment: ${{ parameters.envName }}
variables:
vmImage: 'windows-latest'
pool:
vmImage: $(vmImage)
continueOnError: "false"
strategy:
runOnce:
deploy:
steps:
- task: DownloadBuildArtifacts#0
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: '${{ parameters.project }}${{ parameters.envName }}'
downloadPath: '$(build.artifactStagingDirectory)'
- task: AzureRmWebAppDeployment#4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: '***Azure'
appType: 'webApp'
WebAppName: '${{ parameters.webAppName }}'
deployToSlotOrASE: true
ResourceGroupName: '*****'
SlotName: '${{ parameters.slotName }}'
VirtualApplication: '${{ parameters.virtualApplication }}'
packageForLinux: '$(build.artifactStagingDirectory)/**/*.zip'
I would expect the new step to also deploy the code in
this folder
package to /site/wwwroot/mywebApi/
instead of doing some kudu copy to
/site/wwwroot/mywebApi/Content/D_C/a/1/s/src/mywebApi/obj/Release/Package/PackageTmp/

I was able to reproduce the same scenario. Unfortunately I didnot find a way to fix it by configure task AzureRmWebAppDeployment. The task seems automatically use kudu to copy the files to Azure App service, while msdeploy is used to deploy the files in non-strategy pipeline. You can report this issue here.
I found a work around by changing the msbuild arguments of vsbuild task, and adding a zip archive task. Check below:
Use /t: publish to publish the builds to $(build.artifactstagingdirectory)\publish folder to be zipped in ArchiveFiles task.
- task: VSBuild#1
displayName: 'Build solution **\*.sln'
inputs:
msbuildArgs: '/t:publish /p:outputpath="$(build.artifactstagingdirectory)\\"'
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
clean: true
restoreNugetPackages: true
Use archiveFiles task to zip all the files in \publish folder from above step.
- task: ArchiveFiles#2
inputs:
rootFolderOrFile: '$(Build.ArtifactStagingDirectory)\\publish\\*'
includeRootFolder: true
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/package/$(Build.BuildId).zip'
replaceExistingArchive: true
Use PublishBuildArtifacts task to publish the zip file created by above step
- task: PublishBuildArtifacts#1
displayName: 'Publish Artifact: drop'
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)\\package\\'
artifactName: 'strategy'
By above steps the zip file that downloaded in Deploy stage will only include the deployed code.
Hope above step be helpful to you.

Related

Azure DevOps CI/CD pipeline No package found error

I have a Azure DevOps CI/CD pipeline:
trigger:
- master
pool:
vmImage: ubuntu-latest
variables:
buildConfiguration: 'Release'
stages:
- stage: Build
jobs:
- job: Build
displayName: 'Build'
steps:
- task: DotNetCoreCLI#2
inputs:
command: 'build'
configuration: 'Release'
projects: |
$(System.DefaultWorkingDirectory)/src/*.csproj
arguments: --output $(System.DefaultWorkingDirectory)/publish_output --configuration $(buildConfiguration)
- task: ArchiveFiles#2
displayName: 'Archive files'
inputs:
rootFolderOrFile: '$(System.DefaultWorkingDirectory)/publish_output'
includeRootFolder: false
archiveType: zip
archiveFile: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
replaceExistingArchive: true
- publish: $(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip
artifact: drop
- stage: Test
dependsOn: Build
condition: succeeded()
jobs:
- job: Deploy
displayName: 'Deploy to Test'
steps:
- task: AzureRmWebAppDeployment#4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: 'xxx'
appType: 'webApp'
WebAppName: 'xxx'
package: '$(Pipeline.Workspace)/drop/$(Build.BuildId).zip'
When I run it I get
Error: No package found with specified pattern: /home/vsts/work/1/drop/13325.zip<br/>Check if the package mentioned in the task is published as an artifact in the build or a previous stage and downloaded in the current job.
The build stage produces an artifact, and it is in the 'drop' directory, so I can not wrap my mind around it why publish task can not find it?
As #Daniel indicated you will also need a download artifacts task inside your Test stage as the different stages keep separate working directories.
- stage: Test
dependsOn: Build
condition: succeeded()
jobs:
- job: Deploy
displayName: 'Deploy to Test'
steps:
- task: DownloadBuildArtifacts#1
inputs:
buildType: 'current'
downloadType: 'single'
artifactName: 'drop'
downloadPath: '$(System.ArtifactsDirectory)'
- task: AzureRmWebAppDeployment#4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: 'xxx'
appType: 'webApp'
WebAppName: 'xxx'
package: '$(Pipeline.Workspace)/drop/$(Build.BuildId).zip'

Azure DevOps Pipeline not update correct the website

i build a pipeline, that should run on changes on master-branch. at the moment, it runs right, but the code is not changed. If i delete and recreate the pipeline, the update is correct installed. Where is my Error? The server is actually a F1 Plan from Azure (a linux maschine).
parameters:
- name: artifactName
type: string
default: drop
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller#1
displayName: 'Use NuGet 5.11.0'
inputs:
versionSpec: 5.11.0
checkLatest: true
- task: NuGetCommand#2
displayName: 'NuGet restore'
inputs:
restoreSolution: '$(Parameters.solution)'
- task: DotNetCoreCLI#2
displayName: 'dotnet publish'
inputs:
command: publish
publishWebProjects: false
projects: '**/*.csproj'
arguments: '-r linux-x64 --output $(build.artifactstagingdirectory)'
- task: PublishBuildArtifacts#1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: '$(Parameters.ArtifactName)'
condition: succeededOrFailed()
- task: AzureRmWebAppDeployment#4
inputs:
ConnectionType: 'AzureRM'
azureSubscription: '...nameOfSubscription'
appType: 'webAppLinux'
WebAppName: '...nameOfWebApp'
packageForLinux: '$(build.artifactstagingdirectory)/*.zip'
RuntimeStack: 'DOTNETCORE|5.0'
You simply didn't deploy application to Azure. What you did is create a package for deployment.
- task: PublishBuildArtifacts#1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: '$(Parameters.ArtifactName)'
condition: succeededOrFailed()
It publishes artifact, but it doesn't publish your app to Azure.
Please take a look on documentation here
If you want to do this in the same job it would be like:
- task: AzureWebApp#1
inputs:
azureSubscription: '<Azure service connection>'
appType: 'webAppLinux'
appName: '<Name of web app>'
package: '$(build.artifactstagingdirectory)/*.zip'
Please remeber to provide all needed details.

Azure DevOps Pipeline forever stuck in Pending

We've got an Azure DevOps Pipeline running on a self-hosted against without parallelism that is not running it's Deployment Job or Step.
The version I'm posting below will have two stages, but note that I have tried this by removing the second stage and converting the entire stage to a job, and still the same result. I should also note that I've got multiple pipelines with multiple jobs that run just fine, it seems to be an issue with the specific deployment job.
The second stage is forever stuck in Pending ("Job is Pending"). It will never proceed to start running.
The stage can also not be cancelled, and per the image above, it's been stuck for 2 months.
I should also note that I have submitted this to the Azure Developer Community at developercommunity.visualstudio.com, but I think they've abandoned my ticket.
I'm sure that there are many successful CI/CD deployments in Azure DevOps, I just can't tell what I'm doing wrong here. I am utilizing a working method in our separate Release Pipelines that we are running manually.
Below is the affected pipeline, any guidance would be greatly appreciated.
trigger: none
variables:
ArtifactPackageName: 'app.zip'
DeploySite.IISDeploymentType: 'IISWebsite'
DeploySite.ActionIISWebsite: 'CreateOrUpdateWebsite'
DeploySite.WebsiteName: 'REDACTED'
DeploySite.WebsitePhysicalPath: '%SystemDrive%\inetpub\wwwroot\REDACTED'
DeploySite.AddBinding: false
DeploySite.VirtualPathForApplication: '/REDACTED'
DeploySite.AppPoolName: 'REDACTED'
DeploySite.VirtualApplication: 'REDACTED'
DeploySite.Package: $(Pipeline.Workspace)/drop/$(ArtifactPackageName)
DeploySite.RemoveAdditionalFilesFlag: true
DeploySite.TakeAppOfflineFlag: true
DeploySite.XmlTransformation: false
DeploySite.XmlVariableSubstitution: true
DeploySite.SetParametersFile: $(Pipeline.Workspace)/drop/REDACTED.SetParameters.xml
DeploySite.JSONSettingsFiles: '**/appsettings.json'
stages:
- stage: 'Build'
displayName: 'Build'
jobs:
- job: 'Build'
displayName: 'Build'
pool:
name: REDACTED
variables:
Solution: '**/*.sln'
BuildPlatform: 'Any CPU'
BuildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller#1
displayName: 'Install NuGet Tools'
- task: NuGetCommand#2
displayName: 'Restore NuGet Packages'
inputs:
restoreSolution: '$(Solution)'
- task: VSBuild#1
displayName: 'MSBuild'
inputs:
solution: '$(Solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=false /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(Build.ArtifactStagingDirectory)\$(ArtifactPackageName)"'
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
- task: PublishBuildArtifacts#1
displayName: 'Publish Build Artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: drop
publishLocation: 'Container'
- stage: 'Deploy'
displayName: 'Deploy'
dependsOn: 'Build'
jobs:
- deployment: 'Deploy'
displayName: 'Deploy'
continueOnError: false
timeoutInMinutes: 10
workspace:
clean: all
pool:
name: REDACTED
environment:
name: SERVER-DEV
resourceType: VirtualMachine
strategy:
runOnce:
deploy:
steps:
- download: current
displayName: 'Download Artifact'
artifact: drop
- task: IISWebAppManagementOnMachineGroup#0
displayName: 'Stop IIS App Pool'
continueOnError: false
inputs:
IISDeploymentType: IISApplicationPool
ActionIISApplicationPool: StopAppPool
StartStopRecycleAppPoolName: '$(Parameters.WebsiteName)'
- task: IISWebAppDeploymentOnMachineGroup#0
displayName: 'IIS Web App Deploy'
continueOnError: false
inputs:
WebSiteName: '$(DeploySite.WebsiteName)'
VirtualApplication: '$(DeploySite.VirtualApplication)'
Package: '$(DeploySite.Package)'
RemoveAdditionalFilesFlag: $(DeploySite.RemoveAdditionalFilesFlag)
SetParametersFile: $(DeploySite.SetParametersFile)
TakeAppOfflineFlag: $(DeploySite.TakeAppOfflineFlag)
XmlTransformation: $(DeploySite.XmlTransformation)
XmlVariableSubstitution: $(DeploySite.XmlVariableSubstitution)
JSONFiles: $(DeploySite.JSONSettingsFiles)
- task: IISWebAppManagementOnMachineGroup#0
displayName: 'Start IIS App Pool'
continueOnError: true
inputs:
IISDeploymentType: IISApplicationPool
ActionIISApplicationPool: StartAppPool
StartStopRecycleAppPoolName: '$(Parameters.WebsiteName)'
I had the same error.
I renamed - deployment: Deploy to - deployment: Deployment
...and it started to work.
Changed
from - deployment: Deploy To - deployment: Deployment
I was facing the same error on a stage with only a Deployment job.
A successful workaround is to replace the Deployment job with a regular Job. However, this approach won't keep your deployment history or allow a deployment strategy.
In your case, the Deploy would be:
- stage: 'Deploy'
displayName: 'Deploy'
dependsOn: 'Build'
jobs:
- job: 'Deploy'
displayName: 'Deploy'
continueOnError: false
timeoutInMinutes: 10
workspace:
clean: all
pool:
name: REDACTED
steps:
- download: current
displayName: 'Download Artifact'
artifact: drop
- task: IISWebAppManagementOnMachineGroup#0
displayName: 'Stop IIS App Pool'
continueOnError: false
inputs:
IISDeploymentType: IISApplicationPool
ActionIISApplicationPool: StopAppPool
StartStopRecycleAppPoolName: '$(Parameters.WebsiteName)'
- task: IISWebAppDeploymentOnMachineGroup#0
displayName: 'IIS Web App Deploy'
continueOnError: false
inputs:
WebSiteName: '$(DeploySite.WebsiteName)'
VirtualApplication: '$(DeploySite.VirtualApplication)'
Package: '$(DeploySite.Package)'
RemoveAdditionalFilesFlag: $(DeploySite.RemoveAdditionalFilesFlag)
SetParametersFile: $(DeploySite.SetParametersFile)
TakeAppOfflineFlag: $(DeploySite.TakeAppOfflineFlag)
XmlTransformation: $(DeploySite.XmlTransformation)
XmlVariableSubstitution: $(DeploySite.XmlVariableSubstitution)
JSONFiles: $(DeploySite.JSONSettingsFiles)
- task: IISWebAppManagementOnMachineGroup#0
displayName: 'Start IIS App Pool'
continueOnError: true
inputs:
IISDeploymentType: IISApplicationPool
ActionIISApplicationPool: StartAppPool
StartStopRecycleAppPoolName: '$(Parameters.WebsiteName)'

No package found with specified pattern in AzureRmWebAppDeployment#4

I have the following Azure Pipelines jobs:
- job: Publish
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: UseDotNet#2
displayName: Setup
inputs:
packageType: sdk
version: 3.1.x
- task: DotNetCoreCLI#2
displayName: Publish
inputs:
command: publish
publishWebProjects: false
projects: 'src/**/*.csproj'
arguments: '--configuration staging --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: true
- task: PublishPipelineArtifact#1
displayName: Export
inputs:
artifact: 'Staging'
targetPath: '$(Build.ArtifactStagingDirectory)'
- deployment: Deploy
dependsOn: Publish
pool:
vmImage: Ubuntu-16.04
environment: staging
strategy:
runOnce:
deploy:
steps:
- task: DownloadPipelineArtifact#2
displayName: Import
inputs:
artifact: 'Staging'
- task: AzureRmWebAppDeployment#4
displayName: Api
inputs:
connectedServiceName: '$(azure.subscription)'
webAppKind: 'webApp'
webAppName: 'bityond-demo-api'
package: '$(Build.ArtifactStagingDirectory)/Api.zip'
removeAdditionalFilesFlag: true
When I run the pipeline the following tasks are successful:
Setup
Publish
Export
Import
Then on the last task, "Api" - AzureRmWebAppDeployment#4, I get the error:
##[error]Error: No package found with specified pattern: /home/vsts/work/1/a/Api.zip<br/>Check if the package mentioned in the task is published as an artifact in the build or a previous stage and downloaded in the current job.
I checked and the artifacts are available and I am able to download them.
And the Import task is successful so what I am missing?
Try to specify destination directory for the imported artifact:
- task: DownloadPipelineArtifact#2
inputs:
artifact: 'Staging'
targetPath: '$(Build.ArtifactStagingDirectory)'
If not specified, artifacts by defaults are downloaded into $(Pipeline.Workspace) directory that is equal to /home/vsts/work/1. And for the AzureRmWebAppDeployment#4 task you are looking for artifacts at $(Build.ArtifactStagingDirectory) directory (equal to /home/vsts/work/1/a)

Can't get Azure DevOps Release Pipelines to when I include Code Coverage

So I'm trying to set up a YAML for the new unified build and release pipelines, but running to problems when I publish code coverage results to the build...
The error I get, when I include code coverage reporting, is:
Job Job1: Step Download_Code Coverage Report_870 has an invalid name. Valid names may only contain alphanumeric characters and '_' and may not start with a number.
When I set it up like this, it works, but I don't get code coverage results:
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
variables:
buildConfiguration: 'Release'
system.debug: true
stages:
- stage: BuildAndDeploy
displayName: Test
jobs:
- job: Quality
displayName: Get Test Coverage and Code Quality
pool:
vmImage: 'ubuntu-latest'
steps:
# Install the latest version of the dotnet sdk
- task: DotNetCoreInstaller#0
displayName: 'Use .NET Core sdk 2.2.103'
inputs:
version: 2.2.103
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
- script: dotnet test --configuration $(buildConfiguration) --logger trx --no-build
displayName: 'dotnet test --configuration $(buildConfiguration) --logger trx --no-build'
- task: PublishTestResults#2
inputs:
testRunner: VSTest
testResultsFiles: 'test/**/*.trx'
- task: DotNetCoreCLI#2
displayName: Package Artifact
inputs:
command: 'publish'
arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: True
publishWebProjects: true
feedsToUse: 'select'
versioningScheme: 'off'
- task: PublishPipelineArtifact#0
inputs:
artifactName: 'FakeApiServer'
targetPath: '$(Build.ArtifactStagingDirectory)/FakeApi.Server.AspNetCore.zip'
- stage: DeployTest
dependsOn: BuildAndDeploy
condition: and(succeeded(), not(eq(variables['Build.SourceBranch'], 'refs/heads/master')))
displayName: Deploy To Test
jobs:
- deployment: DeployToTest
environment: Testing
pool:
vmImage: 'ubuntu-latest'
strategy:
runOnce:
deploy:
steps:
- task: DownloadPipelineArtifact#1
inputs:
buildType: 'current'
artifactName: 'FakeApiServer'
targetPath: '$(System.ArtifactsDirectory)'
- task: AzureRmWebAppDeployment#4
displayName: Deploy to https://fake-api-test.azurewebsites.com
inputs:
ConnectionType: 'AzureRM'
azureSubscription: 'Fake API Personal Azure Subscription'
appType: 'webApp'
WebAppName: 'fake-api-test'
Package: $(System.ArtifactsDirectory)/*.zip
enableCustomDeployment: true
DeploymentType: 'zipDeploy'
- stage: DeployProd
dependsOn: BuildAndDeploy
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: Deploy To Prod
jobs:
- deployment: DeployToProd
environment: Production
pool:
vmImage: 'ubuntu-latest'
strategy:
runOnce:
deploy:
steps:
- task: DownloadPipelineArtifact#1
inputs:
buildType: 'current'
artifactName: 'FakeApiServer'
targetPath: '$(System.ArtifactsDirectory)'
- task: AzureRmWebAppDeployment#4
displayName: Deploy to https://fake-api.azurewebsites.com
inputs:
ConnectionType: 'AzureRM'
azureSubscription: 'Fake API Personal Azure Subscription'
appType: 'webApp'
WebAppName: 'fake-api'
Package: $(System.ArtifactsDirectory)/*.zip
enableCustomDeployment: true
DeploymentType: 'zipDeploy'
But when I include running and reporting code coverage, the deploy stage fails:
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
variables:
buildConfiguration: 'Release'
system.debug: true
stages:
- stage: BuildAndDeploy
displayName: Test
jobs:
- job: Quality
displayName: Get Test Coverage and Code Quality
pool:
vmImage: 'ubuntu-latest'
steps:
# Install the latest version of the dotnet sdk
- task: DotNetCoreInstaller#0
displayName: 'Use .NET Core sdk 2.2.103'
inputs:
version: 2.2.103
- script: dotnet tool install --global coverlet.console
displayName: 'Install coverlet'
- script: dotnet tool install -g dotnet-reportgenerator-globaltool
displayName: 'install reportgenerator'
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
- script: dotnet test --configuration $(buildConfiguration) /p:Exclude="[xunit*]*" /p:CollectCoverage=true /p:CoverletOutputFormat=\"opencover,cobertura\" --logger trx --no-build
displayName: 'dotnet test --configuration $(buildConfiguration) /p:Exclude="[xunit*]*" /p:CollectCoverage=true /p:CoverletOutputFormat="opencover,cobertura" --logger trx --no-build'
- script: reportgenerator -reports:test/**/coverage.cobertura.xml -targetdir:coveragereport -reporttypes:"HtmlInline_AzurePipelines;Cobertura"
displayName: 'reportgenerator -reports:test/**/coverage.cobertura.xml -targetdir:coveragereport -reporttypes:"HtmlInline_AzurePipelines;Cobertura"'
- task: PublishTestResults#2
inputs:
testRunner: VSTest
testResultsFiles: 'test/**/*.trx'
- task: PublishCodeCoverageResults#1
displayName: 'Publish code coverage'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.SourcesDirectory)/coveragereport/Cobertura.xml'
- task: DotNetCoreCLI#2
displayName: Package Artifact
inputs:
command: 'publish'
arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: True
publishWebProjects: true
feedsToUse: 'select'
versioningScheme: 'off'
- task: PublishPipelineArtifact#0
inputs:
artifactName: 'FakeApiServer'
targetPath: '$(Build.ArtifactStagingDirectory)/FakeApi.Server.AspNetCore.zip'
- stage: DeployTest
dependsOn: BuildAndDeploy
condition: and(succeeded(), not(eq(variables['Build.SourceBranch'], 'refs/heads/master')))
displayName: Deploy To Test
jobs:
- deployment: DeployToTest
environment: Testing
pool:
vmImage: 'ubuntu-latest'
strategy:
runOnce:
deploy:
steps:
- task: DownloadPipelineArtifact#1
inputs:
buildType: 'current'
artifactName: 'FakeApiServer'
targetPath: '$(System.ArtifactsDirectory)'
- task: AzureRmWebAppDeployment#4
displayName: Deploy to https://fake-api-test.azurewebsites.com
inputs:
ConnectionType: 'AzureRM'
azureSubscription: 'Fake API Personal Azure Subscription'
appType: 'webApp'
WebAppName: 'fake-api-test'
Package: $(System.ArtifactsDirectory)/*.zip
enableCustomDeployment: true
DeploymentType: 'zipDeploy'
- stage: DeployProd
dependsOn: BuildAndDeploy
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: Deploy To Prod
jobs:
- deployment: DeployToProd
environment: Production
pool:
vmImage: 'ubuntu-latest'
strategy:
runOnce:
deploy:
steps:
- task: DownloadPipelineArtifact#1
inputs:
buildType: 'current'
artifactName: 'FakeApiServer'
targetPath: '$(System.ArtifactsDirectory)'
- task: AzureRmWebAppDeployment#4
displayName: Deploy to https://fake-api.azurewebsites.com
inputs:
ConnectionType: 'AzureRM'
azureSubscription: 'Fake API Personal Azure Subscription'
appType: 'webApp'
WebAppName: 'fake-api'
Package: $(System.ArtifactsDirectory)/*.zip
enableCustomDeployment: true
DeploymentType: 'zipDeploy'
Again, the error I'm getting is:
Job Job1: Step Download_Code Coverage Report_870 has an invalid name. Valid names may only contain alphanumeric characters and '_' and may not start with a number.
I was at Build 2019 and talked to the Azure DevOps folks at their booth, and they seemed to think it was likely an error in the system, but I still haven't heard back from them, so I figured I would see if anyone here had any ideas.
The really weird part is I'm never telling it to download the code coverage report artifact... it's just deciding to download it all on it's own, and failing before it ever gets to the download pipeline artifact step I defined.
You could try out the ReportGenerator extension: https://marketplace.visualstudio.com/items?itemName=Palmmedia.reportgenerator (at least is saves some build time as you do not need to install it during build)
Also I have encountered several build issues today and seems to be tied to the usage of vmImage set to 'ubuntu-latest'.
What I see happening is that on some builds the filesystem wil look like this:
/home/vsts/agents/2.150.3/d:\a/1/s/
Whereas it should be:
/home/vsts/work/1/s/
After switching to 'Ubuntu 16.04' it seems to be back to normal.
i have the same issue , but i think its related to deployment job , when i use standard job with the same steps - issue didn't appear. Also i have noticed that my deployment job run on Server agent even if pool: vmImage: ubuntu-latest is configured