Microsoft Dynamics 365 version control Archives - Impulz Technologies LLC https://impulztech.com/tag/microsoft-dynamics-365-version-control/ 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 Microsoft Dynamics 365 version control Archives - Impulz Technologies LLC https://impulztech.com/tag/microsoft-dynamics-365-version-control/ 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.

]]>
Set up Git version Control for Dynamics 365 Finance and Operations project https://impulztech.com/set-up-git-version-control-for-dynamics-365-finance-and-operations-project/ Wed, 13 Jul 2022 07:18:16 +0000 https://impulztech.com/?p=2484 This blog describes the process of setting up Git as version control for the Dynamics 365 Finance and Operations project. Before starting to set up make sure you have Visual Studio 2017 or above and the latest Git installed on your system. Initial Steps: Create a new project in DevOps and select version control as […]

The post Set up Git version Control for Dynamics 365 Finance and Operations project appeared first on Impulz Technologies LLC.

]]>
This blog describes the process of setting up Git as version control for the Dynamics 365 Finance and Operations project.

Before starting to set up make sure you have Visual Studio 2017 or above and the latest Git installed on your system.

Initial Steps:

  1. Create a new project in DevOps and select version control as Git.

2. Then go to repos and create a new repository if a default repository is not created upon creating a new project.

3. Enter repo name and select type as Git. Select the add README option and select visual studio in the “Add a .gitignore” type selection.

Clone Repo & Setup Folder Structure:

  1. Access your D365 Finance and operations development environment and open Visual Studio as an administrator
  2. Open Team Explorer and select the plug icon then select Manage connections and then select Connect to a project

 

3. Select the project and select connect. It might ask for credentials upon connecting, provide the credentials which you are using for DevOps sign In.

4. Clone the repository. You can change the clone directory. It is preferable that you create a root folder in C: drive and clone your project there.

5. Following will be the structure of the folder after cloning completes.

6. Add these three folders to the cloned repo directory.

7. Create a power shell script using the provided script with the name “Mount” in the scripts folder.

Mount

8. Go to team explorer in Visual Studio and select Changes.

9. Commit the initial changes.

10. Push these changes to the DevOps repository.

11. After the above steps create a new custom model with the project in D365 Visual Studio.

12. Stop the AOS service in IIS Manager. Then in the PackageLocalDirectory cut the newly created model folder.

13. Paste it into the Metadata folder created in the above steps.

14. Delete any app folder and bin or Xref files if exists in your model’s folder.

15. After these steps open a PowerShell command prompt as admin. Run the Mount.ps1 file created in the above steps. The project will be linked to source control and any changes can be pushed to the repo.

For Existing Model:

If a Project/model is deployed through a deployable package or imported through a axpp file it can be added into source control through the same process just skipping the new model creation step.

The post Set up Git version Control for Dynamics 365 Finance and Operations project appeared first on Impulz Technologies LLC.

]]>