Azure DevOps tasks for Microsoft Dynamics 365 for Finance and Operations – Part 1

Azure DevOps Pipelines is a cloud service that you can use to automatically build, test and deploy your code to (m)any environments. Since Apr 2019 you can use new Azure DevOps tasks for Microsoft Dynamics 365 to upload and deploy your application deployable package to LCS environments. This blog describes how to set up Azure DevOps to build and deploy code for Microsoft Dynamics 365 to LCS environment.

Prerequisites

There are a few things that must be in place before you can start.

  1. Configure your LCS project to link with Azure DevOps (Visual Studio Team Services)

https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/lifecycle-services/support-experience

  1. Install the Dynamics 365 Unified Operations Tools into your Azure DevOps from Visual Studio Marketplace

https://marketplace.visualstudio.com/items?itemName=Dyn365FinOps.dynamics365-finops-tools

  1. Have access to Azure AAD administration for your organization with enough permissions to register a new application

https://docs.microsoft.com/en-us/azure/active-directory/develop/quickstart-register-app

  1. Have a user account with username and password and enough permissions in your LCS project. It won’t work with a user that has the multi-factor authentication enabled.

Enable the build system

To enable the build system, you will need a dedicated build agent and a build agent pool for your LCS project. Detailed info how to set up build and test environment can be found here https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/perf-test/continuous-build-test-automation

Build Agent Pool Setup

An agent pool organizes your build agents into a logical collection. The agent pool can be assigned to one or more Azure DevOps Pipelines across your organization. For our purpose, we consider having at minimum one agent pool for LCS project. Find more about agent pools here https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/pools-queues?view=azure-devops

To create a new Agent Pool, go to Organization Settings in your Azure DevOps and select Agent pools from Pipelines group. Click on “New agent pool…” button and give it a name

AgentPool

Build Agent Setup

As part of the LCS deployment to Microsoft-hosted environment, you can configure a Build Agent properties. This link describes how to deploy a cloud development environment https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/dev-tools/access-instances

As a part of the deployment process, you can configure your build agent name and name of the agent pool that will be this agent owner. The agent pool must exist prior to deployment or the deployment will fail. By default, the “Default” agent pool is used.

DeploymentSettings

After successful deployment, a new agent will be added to the selected agent pool.

NewBuildAgent

Build Pipeline

Now you can navigate to your Azure DevOps project linked with your LCS project and configure the build pipeline.  First, you will find there a single pipeline named “Unified Operations platform – Build Main”. I would recommend keeping this pipeline as a template and create your customized pipelines by cloning it.

Setup Build Pipeline

Select your pipeline and click “Edit”. Default build pipeline will consist of many steps. I will just walk through the most important. As a first step, you give your pipeline a proper name and select the agent pool you created in the previous step.

BuildPipeline

Then, you can map source code folders you want to include in the build and cloak the ones you want to exclude. Optionally select Clean options and whether you want to apply Label in your selected Azure repository branch. To distinguish between Labels, you can leverage various built-in variables or create your own. I will talk about variables later.

GetSources

These were the basic steps and now you can test your build pipeline. If needed, you can adjust build parameters and finally queue a new build.

QueueNewBuild

As a result of a successful build, build artifacts are published in your pipeline. Build artifacts are the files produced by your build, e.g. application deployable package. You can download artifacts produced by your build from an instance of the successfully completed build.

ArftifactsExplorer

Thank you for your time to read this. In part 2, I will discuss how to deploy a build artifact to selected LCS environment.

Ein Kommentar zu „Azure DevOps tasks for Microsoft Dynamics 365 for Finance and Operations – Part 1

Gib deinen ab

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden /  Ändern )

Google Foto

Du kommentierst mit Deinem Google-Konto. Abmelden /  Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden /  Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden /  Ändern )

Verbinde mit %s

Bloggen auf WordPress.com.

Nach oben ↑

%d Bloggern gefällt das: