Dynamics Lifecycle Services Archives - Impulz Technologies LLC https://impulztech.com/tag/dynamics-lifecycle-services/ Microsoft Dynamics and Power Platform consulting company Wed, 01 Nov 2023 11:01:41 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.3 https://impulztech.com/wp-content/uploads/2022/08/cropped-impulz-tech-32x32.png Dynamics Lifecycle Services Archives - Impulz Technologies LLC https://impulztech.com/tag/dynamics-lifecycle-services/ 32 32 Create Build & Development Server In D365 FO – Part 1 https://impulztech.com/create-build-development-server-d365-finance-operations-part-1/ Wed, 01 Nov 2023 09:46:36 +0000 https://impulztech.com/?p=3255 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 create build and […]

The post Create Build & Development Server In D365 FO – Part 1 appeared first on Impulz Technologies LLC.

]]>

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 create build and development server and set up Azure DevOps to build and deploy code for Microsoft Dynamics 365 to LCS environment.

1-Pre-Requisite:

2-Setup Agent Pool:

If you are an organization administrator, you create and manage agent pools from the agent pools tab in admin settings.

  1. Sign in to your organization (https://dev.azure.com/{yourorganization}).
  2. Choose Azure DevOpsOrganization settings.
  3. Click on “New agent pool…” button and give it a name.

3-Build Agent Setup

As part of the LCS deployment to a Microsoft-hosted environment, you can configure a Build Agent properties. As a part of the deployment process, you can configure your build agent name and the 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, but here we are using our own agent pool.

  • In your LCS environment, go to your Project and select cloud hosted environment setting from the top.
  • Here you can select the Add button and after selecting the proper version choose the Dev/Test Environement Topology.
  • After that choose the Build/Test environment and in advance setting choose the pool which you were created in past.
  • When a Build VM is deployed in Developer topology through LCS, it is pre-configured and ready to start a build. You can change the default configuration at any time from the Visual Studio IDE or the Azure DevOps interface.

3.1-Setup Build Pipeline

  • In your Azure DevOps Project Pipeline Section, 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.
  • 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.
  • 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.
  • 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.

4-Developer Agent Setup

To deploy a cloud development environment in your Lifecycle Services (LCS) project:

  • Create a connection between an LCS project and your Azure subscription. You’ll need your Azure subscription ID and authorize the use of the subscription.
  • Select + under Environments to deploy.
  • Select an application and platform version.
  • Select an environment topology.
  • If you chose a cloud-hosted environment, select which Azure connector you want to use.Then Select Develop Topology.
  • Then on next page, simply click the done and your dev machine is deployed, it usually takes 5 to 6 hours approximately for the machine to be in deployed state.
  • The user who requests the cloud environment is provisioned as the administrator in that environment.
  • User accounts are provisioned on the development VM to allow access to the environment using Remote Desktop, these credentials are accessible on the environment page in LCS.

4.1-Visual Studio Solution and Project Setup

  • Login to Azure DevOps then go to your Project > Repos.
  • Click the 3 dots next to the Trunk folder to create 2 folders called ‘Dev’ and ‘Main’.
  • Create 2 sub-folders called ‘Metadata’ and ‘Projects’ under each of the Dev and Main folders. Your folder structure should look like this:
  • Login to your Dev environment.
  • Launch File Explorer to create the following folder structure in your C drive.
  • Launch Visual Studio in Admin mode.
  • Create a new project.
  • Type ‘Finance Operations’ in the search field then select Finance Operations and click next.
  • Enter your project name, location, and solution name then set your location to “C:\VS\Projects\” folder. Leave the box ‘Place solution and project in the same directory’ unchecked and click create.
  • From the main menu, click View > Team Explorer.
  • Click the Home icon then Source Control Explorer.
  • Click the plug icon at the top to connect your local environment with Azure DevOps Project.
  • From the Source Control Explorer, open Workspaces.
  • Click ‘add’ to create a workspace:<ComputerName>_Dev.
  • Select the Dev workspace then click edit. Map your Source Control Folders to your Local Folders as follows. Click ok when done.
  • Switch to your Dev workspace.
  • Convert the Dev and Main Folders to Dev and Main Branches:Right click Dev > Branching and Merging > Convert to Branch.Right click Main > Branching and Merging > Convert to Branch.
  • In this way, developers work in the Dev branch and when they successfully done their work we simply merge the code from Dev > Main Branch and apply the changes.
  • Right-click the Main folder then select ‘Check In Pending Changes’. This will copy the files to the Main folder in DevOps Repos (Main Source Control).

5-Conclusion

  • Now you simply have to commit the changes by going to the pending changes section in source control explorer and your code is successfully synced to the Azure DevOps Repo and triggered the build pipeline, In this way you can successfully create build and development server and connect Azure DevOps to automate your package deployment!

 

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

HAPPY LEARNING!

The post Create Build & Development Server In D365 FO – Part 1 appeared first on Impulz Technologies LLC.

]]>
How To Setup A Connection Between Azure DevOps & LCS https://impulztech.com/how-to-setup-a-connection-between-azure-devops-lcs/ Mon, 23 Oct 2023 12:21:59 +0000 https://impulztech.com/?p=3231 Transferring software deployable packages to the Asset Library is actively enabled by the connection between DevOps and LCS. Here I am describing each step in detail that how can you setup connection between Azure DevOps & LCS so it will be easy for you to deploy your dynamics packages easily in LCS Environment. 1-Workflow: After […]

The post How To Setup A Connection Between Azure DevOps & LCS appeared first on Impulz Technologies LLC.

]]>

Transferring software deployable packages to the Asset Library is actively enabled by the connection between DevOps and LCS. Here I am describing each step in detail that how can you setup connection between Azure DevOps & LCS so it will be easy for you to deploy your dynamics packages easily in LCS Environment.

1-Workflow:

After you configure an Azure DevOps subscription in Microsoft Dynamics Lifecycle Services (LCS), you can use LCS to deploy developer VMs or build/test VMs. LCS configures a developer VM, which can be linked to an Azure DevOps project. Additionally, LCS sets up a build VM, automatically associating it with an Azure DevOps project. This build VM includes a build agent/controller responsible for compiling modules from the Azure DevOps project and executing automated tests through an external validation endpoint. This workflow includes an LCS deployment of a developer VM and a build/test VM in Azure.

  • LCS creates developer and the build/test environments in Azure. To create a build/test environment, LCS must be able to determine where the source code for the Azure DevOps project is.
  • Developer works on source code on the developer VM, and the work is synced to the Azure DevOps project.
  • The build process synchronizes the code from Azure DevOps onto the build/test VM and produces deployable packages that you can apply to sandbox and production environments. The source code doesn’t flow directly from the development VM to the build/test VM. They are synced through Azure DevOps.

1.1-Create a new Azure DevOps project

  • Go to https://www.visualstudio.com/.
  • Click Sign in in the upper-right corner.
  • Sign in by using an AAD account that is in the tenant that your subscription is linked to. If the browser already has your credentials, you won’t see the sign-in page and should instead click your name in the upper-right corner.
  • On the right side of the page, under Accounts, click Create a free account now.
  • Specify an account URL, and then click Create Account.
  • Name your project, and specify a process template. Your project should now be created.

2-LCS project settings: Set up Azure DevOps:

2.1-Create a personal access token

To connect to an Azure DevOps project, LCS is authenticated by using a personal access token. Follow these steps to create a personal access token in Azure DevOps.

  • Go to https://www.visualstudio.com, sign in, and find your Azure DevOps project.
  • In the upper-right corner, hold the pointer over your name, and then, on the menu that appears, select Security.
  • Select Add to create a new personal access token.
  • Enter a name for the token, and then specify how long the token should last.
  • Select Create Token.
  • Copy the token to your clipboard.

2.2-Configure your LCS project to connect to Azure DevOps

  • In this step we see how to setup connection between Azure DevOps & LCS
  • In your LCS project, select the Project settings tile.
  • Select Azure DevOps, and then select Setup Azure DevOps. This configuration is required by many LCS tools. If you’ve already configured LCS to connect to your Azure DevOps project, you can either skip this procedure or select Change to change the existing configuration.
  • Enter the root URL for your Azure DevOps account, and the personal access token that you created earlier, and then select Continue.
  • Select your Azure DevOps project.
  • LCS requires entering the Azure DevOps root URL in the legacy format. The legacy format is and .
  • Specify the mapping between LCS/BPM items and the associated Azure DevOps work item types.
  • Select Continue, review your changes, and then select Save.

3-Set up Azure Service Connection in Azure DevOps:

3.1-Create an App Registration

  • Now create a new “App Registration” under Azure Active Directory with a name like “D365 – DevOps to LCS”
  • Under “Supported account Types” please select “Accounts in this organizational directory only (“Your company” only – Single tenant) 
  • Now click “Registrer”
  • Create an app registration and make a note of the Application (Client) Id.
  • Proceed to the ‘Authentication’ section within the app registration.
  • Choose ‘Yes’ for the option to ‘Treat the application as a public client.’
  • You can adjust this setting before moving on to ‘Add a platform’ if necessary..
  • When you now “Add a platform” select the “Mobile and Desktop application”
  • Set a checkmark by the native URL … and click on ‘Configure’
  • Now ‘Save’ your “App Registration”
  • Now open the “API permissions” and “Add a permission”
  • Click on the tab ‘APIs my organization uses” and search for “Dynamics”, select “Dynamics Lifecycle services”
  • Now select “Delegated permissions” make sure the checkmark is set by permissions at “user_impersonation” and click “Add permissions”
  • Now click on “Grant admin consent for <Your Company>” and select ‘Yes’

3.2-Create the Service Connection in DevOps

To create a service connection in DevOps it is required that you have installed the extension “Dynamics 365 Finances and Operations tools” (it’s free) into the DevOps, you can find it here:

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

Once it is installed you can verify it by going to the Organization settings and in extension column like this

Now open you Project settings in your DevOps and select ‘Service Connections*’

Click ‘ New service connection’ and select “Dynamics Lifecycle Services” and click Next.

and now fill out the Username , Password and the Application Client Id. Click Save and you are done.

4-Set up Azure Connecter in LCS:

4.1-Create a new role in Azure Portal

  • On your Azure Portal, go to your Azure Subscription.
  • Go to IAM Settings tab, and then click create a new role button.
  • Give new role Contributor access.
  • For Assign Access to Select Azure Ad user, service principals.
  • Then select Dynamics Deployment Services [wsfed-enabled].
  • You can go to LCS and then on Project Settings column select Azure Connector.
  • Here you click Add and then simply fill the naming field of your own choice, for Subscription ID you have to add your Active Subscription ID where you had created a role and then select Yes to configure to use ARM.
  • In the Authorization Page, download the required certification file for authenticating LCS with your Azure Environment.
  • Navigate to the ‘Management Certificates’ tab in your Azure Subscription and upload the certificate acquired from LCS, which will serve as the authentication credential. After the successful upload of the certificate, go back to your LCS environment.
  • Click ‘Next,’ select your preferred region, and finally, click ‘Connect’ to complete the setup.

In this way we setup connection between Azure DevOps & LCS Environment and setup the pre-requisite of our Build and Development Environment in Azure DevOps.

The post How To Setup A Connection Between Azure DevOps & LCS appeared first on Impulz Technologies LLC.

]]>