how can we change the name of files of build artifacts in azure devops below is the picture. i want to change the name of files in drop, want to add build number with the names. eg WebApplication1_(buildNumber)
i use the sample project from visual studio, asp.core.webapp
also tell me from which file artifact files take the name of the file "WebApplication1". i am using azure devops.
CodePudding user response:
You can just rename your files through PowerShell before publish them:
$projectName = 'WebApplication1'
$projectNewName = 'WebApplication1_$(Build.BuildNumber)'
Get-ChildItem -File -Recurse -Path $(build.artifactstagingdirectory) "$projectName.*" | Rename-Item -NewName { $_.Name -replace "$projectName","$projectNewName" }
The example:
The result: