In this post a want to describe how we integrate NuGet packages from Azure DevOps Artifacts into the Microsoft Dynamics 365 for Finance and Operations application lifecycle management process. As you may know from my previous posts I´m working for an ISV and we´re doing implementation projects based on our ISV solutions. Of course we´re also using ISV solutions from other partners, but this is not relevant for this post. The focus of this post is how we integrate our ISV solution into our implementation projects, also containing project/customer specific extensions.
Publish NuGet packages during release creation for our ISV solutions
When we´re build our ISV solutions in Azure DevOps, we´re creating/packing/pushing the binaries at the end of our build pipeline as a NuGet package to a feed in the Azure DevOps Artifacts. When we´re then creating a release out of these builds, the release pipeline promotes the version to the release view of the feed and also tags the version with the corresponding number in our Git repository. This process creates the basis for referencing/using our ISV solutions in our implementation projects.
Integrate NuGet packages into the build process
The first part of the story is the integration into the build process. For this integration we´re using a csproj-file to manage the referenced packages including the referenced version. During build we´re restoring the referenced packages directly from our (ISV) Azure DevOps account using the concept of service connections. A service connections is a mechanism to store connection and authentication details in Azure DevOps. For a service connection to a feed in the Azure DevOps Artifacts of a different account, you only have to specify the URL of the feed and a personal access token. The restore it self happens after checkout of the customer implementation project specific source code and before the actual build. After restoring the referenced packages, we´re copying over the binaries to the build directory, to use them during build and also including them into package creation. Overall the process is similar to what is used for hosted build automation.
Integrate NuGet packages into development VMs
Another part of the integration is the usage of the binaries, from the referenced packages, in a development VM. For this integration we´ve add a nuget.config and a PowerShell script to our setup. The nuget.config contains the URL of the feed to restore packages from and the personal access token for authentication. The PowerShell script executes similar steps, as we use in the build process. First we restore the NuGet packages to a temporary directory, to copy them from there to the AOS directory. After executing the PowerShell script, the restored packages are available in Visual Studio as “binaries only”.
Now I´m interested in your thoughts and questions on this integration process.