##[error]Build Failed : Error: Ensure the path to the application artifact or to the folder that contains artifacts for upload is valid - azure-devops

Local Azure DevOps server integration with Veracode Error:
##[error]Build Failed : Error: Ensure the path to the application artifact or to the folder that contains artifacts for upload is valid.

I'm using azure DevOps local server integrating with veracode scan artifact tool,
Got this ERR while calling files under this path:
C:\agent\_work\1\a
However this path is temporary path, The Issue sloved when putting my data in another DIR.
Kindly find the Veracode config below:
veracode yaml config

Related

Azure Devops Build pipeline failed

Azure Devops pipeline failed with below error:
Couldn't load file or assembly 'AjaxControlToolkit' or one of its dependencies. The system can not find the file specified.enter image description here
Azure Devops Build pipeline failed
To resolve this issue, you should make sure if the AjaxControlToolkit.dll in the bin directory after you build the project.
You could get AjaxControlToolkit.dll and add AjaxControlToolkit.dll to your Reference folder(Right Click on Reference Folder > Add Reference > browse AjaxControlToolkit.dll)
Then set Copy Local to True and build & publish you project.

Download lost file from DevOps pipeline Library

I lost a file which is still available in the library inside the DevOps Library.
Is there a way to save a local copy somehow?
It's still possible to use in a pipeline, but I have no idea to get it to my local computer.
You can use the Download Secure File task to download the file in the pipeline and then use Publish Build Artifacts task to publish the file as build artifacts.
See below when downloading using Download Secure File:
Once downloaded, use the name value that is set on the task (or "Reference name" in the classic editor) to reference the path to the secure file on the agent machine. For example, if the task is given the name mySecureFile, its path can be referenced in the pipeline as $(mySecureFile.secureFilePath)
So in the Publish Build Artifacts task set the Path to publish to $(mySecureFile.secureFilePath)
Then you can download the file from the build summary page by clicking the related artifacts. See below:

azure devops: copy file to artifact folder to access in release pipeline

I am creating a build for ios using azure and I want to copy a certificate file to artifact folder created to use in the release pipeline.
I am using a copy task and after the task is done its job, I am not able to find a copied file at the desired artifact folder. there are answers for copy task but not working for my scenario.
or is there any way to access files from the source folder of build pipeline to from release pipeline?
You were using download secure files task to download the cert files. As below described: see here for more information.
Once downloaded, use the name value that is set on the task (or "Reference name" in the classic editor) to reference the path to the secure file on the agent machine. For example, if the task is given the name mySecureFile, its path can be referenced in the pipeline as $(mySecureFile.secureFilePath). Alternatively, downloaded secure files can be found in the directory given by $(Agent.TempDirectory)
The secure files are downloaded to directory $(Agent.TempDirectory) and its path can be referenced by $(mySecureFile.secureFilePath) if you set the reference name to mySecureFile
So that the copy files task of yours need to be configured as below: Set the Source Folder to $(Agent.TempDirectory) and Contents to the name of the secure files. See below example:
You can also set the Contents to $(certFile.secureFilePath) $(provisionFile.secureFilePath) if you set the Reference name of above download secure file tasks to certFile and provisionFile
More conveniently you can use download secure files task directly in release pipeline to download the cert files.
Then the secure files will be available in release pipeline, and can be referenced just like in the build pipeline.

How to configure TFS2018 build vb.net with Nuget dependencies in Artifactory

I am trying to configure a VB.Net project that has a reference to NuGet package that is stored in our Artifactory repository. I am trying to configure a build in TFS 2018 and I think that there maybe several ways to configure the build in TFS.
I used the .net desktop app template and then modified it. I have it configured as
Use NuGet 4.4.1
NuGet restore
Build Solution
Publish Symbols
Copy Files to ….
Publish Artifact: drop
It’s failing at the NuGet restore:
The nuget command failed with exit code(1) and error(Errors in packages.config projects
Processed: ##vso[task.issue type=error;]The nuget command failed with exit code(1) and error(Errors in packages.config projects%0D%0A Unable to find version '1.0.8' of package 'WPSArchiver-AnyCPU'.%0D%0A C:\Users\TFSBuild1_SVCACCT.nuget\packages: Package 'WPSArchiver-AnyCPU.1.0.8' is not found on source 'C:\Users\TFSBuild1_SVCACCT.nuget\packages\'.%0D%0A https://api.nuget.org/v3/index.json: Package 'WPSArchiver-AnyCPU.1.0.8' is not found on source 'https://api.nuget.org/v3/index.json'.%0D%0A https://xxxxxxxxx.yyyy.com:8443/artifactory/api/nuget/wps-csat-nuget-local: The V2 feed at 'https:// xxxxxxxxx.yyyy.com:8443/artifactory/api/nuget/wps-csat-nuget-local/Packages(Id='WPSArchiver-AnyCPU',Version='1.0.8')' returned an unexpected status code '401 Unauthorized'.)
task result: Failed
Packages failed to restore
So it looks like it does try to access our local instance of Artifactory, but it is getting a '401 Unauthorized'
As you can see in the image above I created a “Credentials for feeds…” For this I created a Nuget authentication
Should I use different build steps? How can I troubleshoot the authentication request. I know that the account that I am using is valid.
It looks like the Feed URL in above service connection for local Artifactory server is not complete. The source URL pointing to Artifactory should be like this http://severname:8081/artifactory/api/nuget/<repository key>.
In your case you can try changing the Feed URL in above screen to https://xxxxxxxxx.yyyy.com:8443/artifactory/api/nuget/wps-csat-nuget-local
The Feed URL should be the same with the packageSources you defined in nuget.config file.
You can modify the setting for Credentials for feeds in the Service connection section of in project settings.
Project settings--> Service connections under Pipelines-->Select your connection(CSAT Artifactory)--> Update the Feed URL.
If it is still not able to authenticate, you can try using the API Key for the Password field of the artifactory connection.
Hope above help!

TFS: Setup CI deployments for DEV server

Goal
Publish successful web app CI builds to IIS dev server.
Current Setup
The associated build definition first copies the \bin folder content to the Build.ArtifactStagingDirectory, then publishes the artifacts of the same path. The name value is drop and the type is Server.
The release definition contains only a Windows Machine File Copy step. It's Source property points to the aforementioned drop folder, and its destination is a UNC address.
Its Artifacts tab is linked to the build definition and Continuous Deployment is enabled for the same source.
Symptom
Deployment status is Rejected. The error returned is The item drop in container 10039 could not be found. See log below:
2016-12-02T01:46:47.1273383Z Cleaning artifacts directory: C:\agent_work\9ee18c2ab…
2016-12-02T01:46:47.1612721Z Cleaned artifacts directory: C:\agent_work\9ee18c2ab
2016-12-02T01:46:47.1692742Z Number of linked artifacts to download: 1
2016-12-02T01:46:47.1722775Z Starting artifacts download...
2016-12-02T01:46:47.2203037Z Downloading linked artifact: VehicleTracking.DevCI...
2016-12-02T01:46:47.2222969Z Downloading artifact of type: Build
2016-12-02T01:46:47.2252925Z Created artifact folder C:\agent_work\9ee18c2ab\VehicleTracking.DevCI
2016-12-02T01:46:47.2712805Z Preparing to get the list of available artifacts from build.
2016-12-02T01:46:47.4233327Z Preparing to download artifact: drop
2016-12-02T01:46:47.4593025Z Artifact Type: ServerDrop
2016-12-02T01:46:47.4613413Z The artifact is of older version: False
2016-12-02T01:46:47.8273312Z Caching items under 'drop' in the file container...
2016-12-02T01:46:48.3123751Z 0 placed file(s): 0 downloaded, 0 empty and new, 0 preserved.
2016-12-02T01:46:48.3273435Z An error occurred during download: System.AggregateException: One or more errors occurred. ---> Microsoft.VisualStudio.Services.FileContainer.ContainerItemNotFoundException: The item drop in container 10039 could not be found.
Questions
Why is the drop not found? Is there something wrong with the build or something wrong with the release?
Either the drop-folder from your build (Web App CI build) is not available anymore or your IIS server can't access the drop folder(lack of permission).
You could verify ( after queuing a new build) that if the drop-folder is there and that there are files in the drop-folder. You could verify this by opening the build and going to the artifacts section and exploring the drop-folder, as show over here.
You could also double check if you are using the right arguments, the similar issue for your reference: The item MY_ARTIFACT_NAME in container XXX could not be found