You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have been using this library for a while now and got the request from my boss to implement unit tests into our exisiting azure functions projects. When I ran the CI pipeline (after adding set unit test projects) all files in the /cs folder were gone in the published artifacts. However the build output would be inconsistent and every 5 or so builds on the same branch I would get the correct output and go on with building the project.
Additional context
I got around this issue by adding a copy files task which copies all files from the bin folder to the root folder of the artifact.
Look at published artifact and see missing files (empty folders with missing files)
Expected behavior
When building the artifact the build output should be consistent and the same each and every time.
Screenshots
Left side what current artifact looks like, right side is what the artifact should look like. All files do exist on the left side but in the /bin folder which does not work when deploying the Azure Function to Azure using the AzureFunctionApp@1 step.
Environment (please complete the following information, if applicable):
OS: Ubuntu latest pipeline
.NET6 LTS
Function V4
Current pipeline (with fix)
name : ci-pipeline.ymltrigger:
branches:
include:
- mainpool:
vmImage: 'ubuntu-latest'variables:
buildConfiguration: 'Release'stages:
- stage: BuilddisplayName: Build solutionjobs:
- job: BuilddisplayName: Build and publish solutionworkspace:
clean: allsteps:
- task: UseDotNet@2displayName: Use Dot Net Core 6.0.xinputs:
packageType: 'sdk'version: '6.0.x'
- task: DotNetCoreCLI@2displayName: 'Restore NuGet packages'inputs:
command: restoreprojects: "**/*.csproj"
- task: DotNetCoreCLI@2 displayName: 'Build API'inputs:
command: buildarguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2 displayName: Run XUnit testsinputs:
command: test projects: '**/*.Tests.csproj'arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2displayName: 'Create API Artifact'inputs:
command: publisharguments: '--output $(Build.ArtifactStagingDirectory)'configuration: $(BuildConfiguration)publishWebProjects: falsezipAfterPublish: false
- task: DeleteFiles@1displayName: 'Remove runtimes folder'inputs:
SourceFolder: $(Build.ArtifactStagingDirectory)/runtimesContents: '*'RemoveSourceFolder: true# This is the current fix I came up with
- task: CopyFiles@2inputs:
sourceFolder: $(Build.ArtifactStagingDirectory)/bincontents: '**'targetFolder: $(Build.ArtifactStagingDirectory)# Fix ends here
- task: ArchiveFiles@2displayName: 'Zip API Artifact'inputs:
rootFolderOrFile: '$(Build.ArtifactStagingDirectory)'includeRootFolder: falsearchiveType: 'zip'archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'replaceExistingArchive: true
- task: PublishPipelineArtifact@1displayName: 'Publish API Artifact'inputs:
targetPath: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId).zip'artifactName: 'ArtifactNameHere'
The text was updated successfully, but these errors were encountered:
Joeghanoe
changed the title
Missing files in all bin folders in CI pipeline when adding a test project
inconsistencies in build output when adding a test project
Apr 14, 2022
Joeghanoe
changed the title
inconsistencies in build output when adding a test project
Inconsistencies in build output when adding a test project
Apr 14, 2022
Uh oh!
There was an error while loading. Please reload this page.
Describe the issue
Hi, I have been using this library for a while now and got the request from my boss to implement unit tests into our exisiting azure functions projects. When I ran the CI pipeline (after adding set unit test projects) all files in the /cs folder were gone in the published artifacts. However the build output would be inconsistent and every 5 or so builds on the same branch I would get the correct output and go on with building the project.
Additional context
I got around this issue by adding a copy files task which copies all files from the bin folder to the root folder of the artifact.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
When building the artifact the build output should be consistent and the same each and every time.
Screenshots
Left side what current artifact looks like, right side is what the artifact should look like. All files do exist on the left side but in the /bin folder which does not work when deploying the Azure Function to Azure using the

AzureFunctionApp@1
step.Environment (please complete the following information, if applicable):
Current pipeline (with fix)
The text was updated successfully, but these errors were encountered: