How to setup hosted build automation for MsDyn365FO

Since my last post about hosted build automation for Microsoft Dynamics 365 for Finance and Operation, more than 5 months have passed. Now that hosted build automation has reached the PEAP stage, I´m able to provide more details on the setup and how to use.

In the next few days the content behind the following link will light up: https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/dev-tools/hosted-build-automation

The link guides you to the documentation, written by the PM of the feature Joris de Gruyter.

In this post I want to give some additional guides on how to setup the hosted build automation especially on how to upload the NuGet packages to your Azure DevOps account. The setup, of the rest of the process, you will find under the mentioned link on docs.microsoft.com.

First you need to download the three NuGet packages from the (PEAP) LCS project to your laptop or development VM. After this step you should have the following files (The version reflects 10.0.11 PEAP):

  • microsoft.dynamics.ax.platform.devalm.buildxpp.7.0.5644.16778.nupkg
  • microsoft.dynamics.ax.application.devalm.buildxpp.10.0.464.13.nupkg
  • microsoft.dynamics.ax.platform.compilerpackage.7.0.5644.16778.nupkg

To upload those packages you first have to create a package feed in your Azure DevOps account. To do this, navigate to Artifacts and create a new feed. In the “Create new feed” dialog specify a name e. g. D365BuildHostedAgent and click Create. Now you got the target feed where you can push the NuGet packages to.

To push the previously downloaded packages to the new feed you have to click on “Connect to feed”, select nuget.exe and copy the settings for your nuget.config. The next step is to download the latest version of the Nuget command line tool and put it e.g. into the folder C:\Temp\Nuget. To handle the authentication of the Nuget command line tool, you should download the Azure Artifacts Credential Provider and put it into the folder %UserProfile%/.nuget/plugins. Now you can use the following commands to publish the downloaded packages to the created feed:

  • nuget.exe sources Add -Name “<NameOfYourFeed>” -Source “<SourceStringFromNugetConfig>”
  • nuget.exe push -Source “<NameOfYourFeed>” -ApiKey AzureDevOps microsoft.dynamics.ax.platform.devalm.buildxpp.7.0.5644.16778.nupkg
  • nuget.exe push -Source “<NameOfYourFeed>” -ApiKey AzureDevOps microsoft.dynamics.ax.application.devalm.buildxpp.10.0.464.13.nupkg
  • nuget.exe push -Source “<NameOfYourFeed>” -ApiKey AzureDevOps microsoft.dynamics.ax.platform.compilerpackage.7.0.5644.16778.nupkg

Now your feed should look like the one, you can find in the banner of this post and you can go on with configuration of you pipeline as described on docs.micrsosoft.com, using the examples you can find here: https://github.com/microsoft/Dynamics365-Xpp-Samples-Tools/tree/master/CI-CD/Pipeline-Samples

Known issues

  • If you´re running into the error “Response status 503 – service unavailable” when pushing to Azure DevOps artifacts please check the post from Johan Persson for a solution.
  • If you´re getting the following error during compile of reports: “System.IO.FileNotFoundException: Business Logic assembly not found at location …\NuGets\Microsoft.Dynamics.AX.Platform.CompilerPackage\Microsoft.Dynamics.ApplicationSuite.Reporting.BusinessLogic.dll” you can add the following PowerShell to your build definition after the install/restore of the NuGet packages.
    • Copy-Item “$(Pipeline.Workspace)\NuGets\Microsoft.Dynamics.AX.Application.DevALM.BuildXpp\ref\net40\ApplicationSuite\bin\Microsoft.Dynamics.ApplicationSuite.Reporting.BusinessLogic.dll” “$(Pipeline.Workspace)\NuGets\Microsoft.Dynamics.AX.Platform.CompilerPackage\”

One thought on “How to setup hosted build automation for MsDyn365FO

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s