DevOps pipeline for Azure functions

This article talks about building and creating pipelines on Azure DevOps for Azure functions .NET core/.NET 6

The steps to build a build and release pipelines are follows:

  1. Select your Repo
  2. Configure a pipeline template ex. ASP.NET, ASP.NET core, Starter
  3. Under a starter pipeline – There are 3 steps to create a starter pipeline.
    1. Build a script for compiling and building the code
    2. A script to archive code files in a zip folder
    3. Publish the artifact

The first step is to create a build pipeline.

In Azure DevOps -> create a new pipeline -> Select Azure Repos Git -> Select the Repository -> Select a starter pipeline

In Review your pipeline step, remove the default steps from the script. We will use the assistant to build the scripts. From the assistant on the right side, select .NET core task and add the command, path to project, and arguments, and click on the Add button

The Arguments are: –output $(Build.BinariesDirectory)/publish_output –configuration Release

You can also make a variable for the argument value and use the variable.

Let’s add the code to archive this project into a zip file.

Select Archive files from the Task assistant. Archive the files under publish_output folder and uncheck the prepend option

This is going to create an archive under the staging directory.

Let’s go ahead and publish this artifact. Select “publish build artifacts” from the Task assistant

Click “Save and Run”

You can see the published artifact in the build job
The published folder will look this:

Azure DevOps Pipeline for CRM – Solution Packager

The first step in implementing the Azure DevOps pipeline process for Dynamics 365 is to extract/decompose the CRM solution into its individual components. This is done through the solution packager provided by Microsoft. You can download and install the solution packager from this link

After you install the the solution packager on your disk, you will see the following list

You can find the SolutionPackager.exe file in the CoreTools

Open windows powershell command prompt and navigate to the SolutionPackager.exe folder – D:\NuGetTools\Tools\CoreTools

Before we go to the next step, in the CRM instance, create a new empty solution and export the solution, this solution file is a zip file containing the customizations and solutions xml

We will try to extract this solution using the solution packager and see what it looks like. Go back to the powershell command, and type the following

.\SolutionPackager.exe /action:Extract /zipfile:”SolutionfolderPath/” /folder “OutputFolder”

Below, I specified where my solution is and the output folder where I want the extract the zip folder contents.

.\SolutionPackager.exe /action:Extract /zipfile:”D:\Other\DevOps\” /folder “D:\Other\DevOps\devopsfiles”

Let’s see what the output folder looks like:

Because, our solution was empty, we did not find the Enities, Plugins, Webresources folders. Let’s add few components to our Dynamics CRM solution

Export this solution, and run the SolutionPackager.exe from the powershell again, you’ll notice extraction of the different components

After you navigate to the output folder, you’ll see the different folders

Navigating inside the Entities folder, you’ll notice that the entities are split into their own folders and files containing the forms, views, charts etc.

Now, you can upload the root folder to the Git/GitHub/TFS, or any other repo, and take the next step in the integration of Azure Dev Ops pipeline for CRM.