Dynamics 365 Customer Engagement Build Automation Using Power DevOps Tools

Microsoft Dynamics 365 Customer Engagement Build Automation Using Power DevOps Tools

Blog Highlights:

  1. Azure DevOps
  2. Power DevOps Tools
  3. Build Automation for Customer Engagement using continuous deployment

Steps Summary:

  1. Install Power DevOps Tools
  2. Create new project
  3. Create Pipeline
  4. Create Job
  5. Add Power DevOps tool installer extension
  6. Add Export Solution extension
  7. Add Import Solution extension
  8. Run and schedule

Introduction:

In this article you will get knowledge about Azure DevOps and hands on experience of automating build solution deployment of customer engagement using Power DevOps Tools.

Azure DevOps:

Azure DevOps is a Software as a service (SaaS) platform from Microsoft that provides an end-to-end DevOps toolchain for developing and deploying software.  It also integrates with most leading tools on the market and is a great option for orchestrating a DevOps toolchain.

It can be entertain for both type of tenants include on premises and online.

  1. For on premises we have Azure DevOps Sever
  2. For online we have Azure DevOps Services

To start with build automation first Sign Up to Azure DevOps account and if you have one already then login here: https://dev.azure.com

You can even try with free trail account. That account should be on top of Microsoft cloud such as Office 365, Outlook or Azure AD service account.

Power DevOps Tools (aka Dynamics 365 Build Tools)

Power DevOps Tools is a set of tools that makes it easy and quick to automate builds and deployment of your PowerApps/CDS/Dynamics 365 CE solutions.

STEP#01: INSTALL POWER DEVOPS TOOLS EXTENSION

Click on store market and search for Power DevOps Tools and install it.

If you have multiple organization in the domain then you have to install this extension on each organization manually otherwise its only one time effort.

STEP#02: CREATE PROJECT:

  1. Create new project with any suitable name keep the visibility as Private.
  • Click on Repos and initialize a Git Repository:

STEP#03: CREATE PIPELINE

  1. Select new pipeline
  • Select Use the classic editor
  • Select a Source:

Select the option for Source and project where you are creating Pipeline and then select your branch

Click Continue to proceed.

STEP#04: CREATE JOB

  1. Select Template:

Since we are going to create custom pipeline so select Empty Job

STEP#05 ADD POWER DEVOPS TOOL INSTALLER

Add Power DevOps tool Installer task to the job

For quick search type in power on search bar and select Power DevOps Tool Installer and click on Add.

STEP#06 ADD EXPORT SOLUTION EXTENSION

  1. Add Export Solution extension task to the job
  • Add Connection String for Source Instance of Customer Engagement from where you want to Export the solution

AuthType=Office365;Username=$(yourusername);Password=$(yourpassword);Domain=$(yourdomain);Url=https://yourcetenant.crm.dynamics.com

Note: $ and () are used to indicate variables value if you have only static value you can hardcode it.

  • Output path: this is important because this is VM directory where your exported solution will be placed. So give it the same name as mentioned below;

$(Build.ArtifactStagingDirectory)

  • Solution Name: you can provide direct name of the CE solution we have keep it inside a variable to show how variable works.

STEP#07 ADD IMPORT SOLUTION EXTENSION

  1. Add Import Solution extension task to the job
  • Add connection string for Destination instance of CE where you want to import the solution.
  • Also define VM path where the solution is located and Solution Name

Step#08 Save and Run

 After performing the steps mentioned above we are good to go to test and run the Pipeline

  1. Click on Save and Queue:
  • Customer Engagement instance for Source environment.
  • Customer Engagement instance for Destination environment.

In the above example we have used online version of Customer engagement, in case you are working with on premises then you have to get Azure DevOps Server.

Dynamics 365 Application publishing on App Source

App source is a platform where all the power platform apps and related cloud supported apps that are built on top of Microsoft can be publish. Mostly people use app source to show case their master piece of work in form of product.

To publish an app on app source there are few mandatory steps that should be complete.

Step#01: Managed Solution

Create a solution that includes all the components that needs to be pitch as part of your publish application. Export the solution with Managed properties.

image1

Step#02: Create Package using Microsoft Dynamics Package Deployer.

Microsoft dynamics package deployer is part of Nuget package manager for VS 2015, 2012, 2013. In case you have any earlier version of VS then try to upgrade it as it supports .net framework 4.6.2.

Open visual studio as administrator and select new project as defined below;

File > New > Project

Templates > Visual C# > CRM SDK Templates

Image2

  1. Add managed solution zip file in this project that you have created in step 01.
  2. All the files including crm managed solution(s) and other sample data files(s) should in same zip format.
  3. All the files should be add inside PkgFolder.
  4. Make sure the property “Copy to Output Directory” is “Copy always” to each added zip file
  5. Build the project

Image3

In case of successful built check Bin folder for all added files check and project dll inside debug folder there should exist copy of each custom zip file that you have added in PkgFolder. For reference go through the package path in your machine.

C:\\Visual Studio 2015\Projects\CRMPackage\CRMPackage\bin\Debug\PkgFolder

Step#03: Create package for Azure Storage Explorer

Azure Storage Explorer is a free tool from Microsoft that provides a graphical environment to browse and perform actions against Azure Storage accounts.

The tool is available at http://storageexplorer.com/ and once installed authenticate with an Azure AD or Live ID and by default all storage accounts from all subscriptions you have access to will be displayed. You can easily upload and download content in addition to performing server-side asynchronous copy operations.

Through using this tool you can create a blob container package that contains all the dll(s) and files of your Application. Try to keep the naming convention as it is as suggest by Microsoft because MS will use this package to perform their parity checks to ensure that application is eligible to publish on App Source. For further assistance follow this link: https://tinyurl.com/ukqg9g9

Perform following steps to create blob container package.

  1. Open Azure explorer and click on Add an account then click Apply

Image4

Image5

  1. Login here with Azure ID account

Image6

3. Click on Storage account and expand it.

Image7

  1. Click on Blob Containers expand it and then right click on it to select create new Blob container

Image8  5. Now upload package here that you have created on Step 2. Click on upload then select file.

Image9

  1. Right click on the file after upload and select generate Shared access Signature.

The value that you receive from here copy it immediately and save it for further use, because it will not visible for next time and is needed for Partner center .Using this key MS will be able to access your package.

Image10

Step#04: test User creation on Azure portal

  1. Login to: https://portal.azure.com/
  2. Select storage account and then select your Storage account
  3. On the left of the screen there are eclipses click on them and expandImage11
  1. Click on Azure active directory. And then click on UsersImage12
  1. Click on New user button and create a new user having same tenant as you have in your login user.
  2. Now run the following command on windows power shell. Do remember to run power shell with admin user then run commands.
  • Install-Module MSOnline (run this command if MSOnline is not installed)
  • Connect-MsolService (Will show a popup window to login. Login with newly created org tenant)
  • $applicationId = “”
  • $sp = Get-MsolServicePrincipal -AppPrincipalId $applicationId
  • Add-MsolRoleMember -RoleObjectId fe930be7-5e62-47db-91af-98c3a49a38b1 -RoleMemberObjectId $sp.ObjectId -RoleMemberType servicePrincipal
  1. Now open your Customer engagement environment and go to settings> Security>Users>Application userImage13
  2. Now assign this user a security role either an existing one or create new role because both of these user and role will be using in Test drive on App source.

Step#05: Application Submission on Partner Center

Partner Center (PC) is a web-based enrollment system for the Microsoft Partner Network (MPN). Individuals associated to the organization will also use the PC Dashboard to manage their membership and associated benefits. Here comes all the sales and marketing content of your Application.

There are few configurations that’s need to be done to publish application on App Source through partner center.

  1. Login to https://partner.microsoft.com/ with Admin user
  2. Then go to navigation of Left and click on Commercial Marketplace > OverviewImage14
  1. Click on your offer and expand itImage15

Highlighted two areas with name Technical configuration and test drive need most of the attention.

Fill all the required fields and submit your app. You are done with your submission now wait for response from MS team.

 
Continue reading Dynamics 365 Application publishing on App Source