Created a NuGet pipeline in azure devops - azure-devops

I have created a NuGet pipeline as my build pipeline in my Azure devops. AM getting some error while building the pipeline

Install-Package EnterpriseLibrary.ExceptionHandling.Logging -Version 5.0.505

You can try checking the Restore NuGet Packages option in the build tasks. Sometimes the retore nuget option need to be check in VSBuild task too.

Related

How to Create Artifacts feed in Azure DevOps only with dll

I have found that we can create private Artifact feed in Azure DevOps pipeline by build, Pack and Push task in YAML Pipeline when we have source code.
But now I have access to one third party dll (but not source code) which will be referred by all other .Net solutions.
Can some one help me how can we create Artifact feed only with the dll and with no source code access.
In this scenario, you could create Universal Package instead of Nuget with the dll file.
Both Azure CLI and Azure Pipeline task are supported to publish and download Universal Package.
Azure CLI: https://learn.microsoft.com/en-us/azure/devops/artifacts/quickstarts/universal-packages?view=azure-devops
Universal Package task in Azure Pipeline: https://learn.microsoft.com/en-us/azure/devops/pipelines/artifacts/universal-packages?toc=%2Fazure%2Fdevops%2Fartifacts%2Ftoc.json&bc=%2Fazure%2Fdevops%2Fartifacts%2Fbreadcrumb%2Ftoc.json&view=azure-devops&tabs=classic
Choose the dll file as "Path to file(s) to publish"

Error while deploying release pipeline in Azure Devops

I am trying to deploy an existing .Net Core application using Azure Devops by creating Build and release pipelines. The build pipeline worked fine, but I get the below error when running the release pipeline (under Deploy Azure App Service).
Error: No package found with specified pattern: D:\a\r1\a***.zipCheck 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.
What should be done to fix this?
This error is because the build task is not configured. You can try to put the below YAML code at the last to make it work.
- task: PublishBuildArtifacts#1

How to Deploy Nuget in Prerelease View With Release Pipeline

I am setting up a DevOps release pipeline that is triggered off a build pipeline.
The build pipeline uses the Nuget Pack to create a nupkg file and publishes it as an Artifact.
The release pipeline is triggered and Nuget Push is used to deploy to the DevOps feed.
I have found the “Promote package to Release View” task, but how do I get the Package Version to provide in the step?
I should note that, in the build pipeline, the Nuget pack step uses the build number for the version.
According to your description, the build pipeline uses Nuget pack with the build number for the version. So, you just need to enable the CD (Continuous deployment trigger) for your release pipeline. Then use the predefined variable Build.BuildNumber in the “Promote package to Release View” task.
Select the package that you want to promote. Multiple packages may be supplied separated with a comma or semicolon. Note you may use either the name of the package or its GUID.

Use Azure Pipline with UiPath to create and deploy nuget packages

How to use azure pipleline for creating nugetpackes and deploying to orchestrator?
The generation of the package is running with the following package: https://marketplace.visualstudio.com/items?itemName=uipath.vsts-uipath-package
In the case this is the right way what's the solution to upload them to orchestrator?
Possibility 1: Create nuget feed in azure (one feed for TEST and one
for PROD)
Possibility 2: Deploy packages to orchestrator directly
Though I am not one of the developer for UiPath, as I know, this extension hasn't integrated with our Azure Devops feed. So, your first possibility solution should not suitable in VSTS.
To achieve what you want, I suggest you pack and deploy the packages by using the UiPath Package task directly.
Create the package in build pipeline:
Create a build pipeline, add and configure the UiPath Package task by following the description here. For create the package, please choose Pack as Package action value:
Note: Please keep the default value of Output folder as $(Build.ArtifactStagingDirectory). It is the path which used to store the artifact, then got by the release pipeline.
Deploy the package to orchestrator in Release pipeline:
Create a Release pipeline, choose the build you executed previously as the source.
Add the same task into the stage, but here please choose Deploy as Package action value:
Then configure your Orchestrator info and the identity Authentication details.

Azure Pipelines Hosted Agent Can't Access DevOps project Feed

I have an Azure DevOps project (just one).
I have a Build Pipeline set to run in the "Hosted VS2017" Agent Pool. This Agent Pool appears to be in the [MyProject]\Build Administrators, Contributors, Project Administrators, and Release Administrators roles.
I also have an Artifacts nuget feed in the DevOps project. It has [MyProject]\Project Valid Users set as "Reader" role. It appears that Project Valid Users has all of the Agent Pool's roles mentioned above as members.
I have an azure-pipelines.yml script that adds that adds the artifacts feed as a nuget source right at the beginning:
# Add nuget source
- powershell: Invoke-RestMethod "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" -OutFile "$env:UserProfile/nuget.exe"
- script: '%UserProfile%\nuget.exe sources Add -Name "devops" -Source "https://pkgs.dev.azure.com/MyProject/_packaging/feed/nuget/v3/index.json"'
The build yml then dot a dotnet build but fails inside NuGet.targets with:
Unable to load the service index for source https://pkgs.dev.azure.com/MyProject/_packaging/feed/nuget/v3/index.json.
Response status code does not indicate success: 401 (Unauthorized).
how can I make this work? My build needs packages from other builds that are on that artifacts feed...
There is a better alternative imo. You can continue using your script to dotnet restore.
Simply add a task just before that with NuGetAuthenticate#0
steps:
- task: NuGetAuthenticate#0
- script: dotnet restore --no-cache --force
this task will authenticate the pipeline with the nuget feeds that require so and are found at the NuGet.config file.
More info here
Notice that when the nuGet feed is within Azure DevOps there is nothing else required. If the feed is external you can configure at your Azure DevOps a nuGet Service Connections (at the link there is further info).
Use the built-in tasks for installing and running NuGet and you won't have authentication problems.
Use the dotnet task's restore command. If you're using a single Azure Artifacts feed, just select it from the dropdown in the task (instead of the PowerShell you mentioned). If multiple feeds (doesn't look like it from your question, but just in case), you'll need to check in a NuGet.config that references all of those feeds, then point the task to that config.
You may also need to pass the '--no-restore' flag to your 'dotnet build' command.
If you still encounter issues, ensure the correct build identity has access to your feed.