Manage package deployments

Completed

To ensure a smooth transition of code changes from development to production environments, developers must understand how to create deployable packages, manage deployments, and track build artifacts. This unit provides step-by-step guidance tailored for intermediate-level developers.

With the use of Unified Developer Experience (UDE), developers are deploying packages to their development environments in PPAC, and that is covered as well as in Deploy models to Online Environment.

Build software deployable packages using Visual Studio

A Software Deployable Package (SDP) is essential for applying code changes to non-development environments. Visual Studio simplifies the process of creating these packages.

  1. Navigate to Builds in Team Explorer.

  2. Right-click the desired build definition and select Queue New Build.

  3. Sign in to Azure DevOps if prompted.

  4. Use the Queue button to open the build queue dialog box.

  5. Enter any required parameters and confirm the build.

A build definition refers to a build pipeline in Azure DevOps, and can be queued to be performed within Visual Studio.

Once the build completes, you can download the resulting AX Deployable Runtime (an SDP) from the Artifacts section of the completed build's status page. This package is then ready for deployment.

Note

Monitoring active builds is possible through the My Builds section in Team Explorer, which displays the status and timestamps of recent builds.

Deploy code changes across environments using Lifecycle Services

Lifecycle Services (LCS) facilitates the deployment of code changes across various environments. Follow these steps to deploy your code:

  1. Merge your code from the development branch to the testing/main branch.

  2. Build the code in the corresponding Azure DevOps pipeline to generate a .zip file.

  3. Upload the .zip file to the LCS Asset Library:

    • Navigate to the Asset Library in your LCS project.

    • Select Software deployable package and use the + button to upload the file.

  4. Deploy the package to the desired environment:

    • Go to the environment's full detail page.

    • Select Maintain > Apply updates and choose the correct package.

Tip

Ensure that the package is uploaded to the Asset Library before attempting deployment.

Track and manage build artifacts in Azure DevOps

Azure DevOps provides tools to monitor builds and manage deployable runtime packages effectively. After queuing a build in Visual Studio, you can:

  • Access build logs and artifacts from the completed build's status page.

  • Download the AX Deployable Runtime package for deployment.

  • Monitor active builds in the My Builds section of Team Explorer.

These features help developers maintain visibility over the build process and ensure that the correct artifacts are used for deployment.

Troubleshooting errors

When encountering errors during the package deployment process, it is crucial to follow a systematic approach to troubleshooting. Here are some common errors and their potential solutions:

  • Environment State Issues: If the deployment fails with an unexpected environment state, check the logs for any error messages and follow the steps to verify the package's validity.

  • Missing Modules: Ensure that all required modules are included in the deployable package. If a module is missing, uninstall it explicitly and then create a new deployable package.

  • Deployment Process Errors: Review the logs for any errors related to the deployment process. If you encounter an error message, follow the troubleshooting steps provided in the logs to resolve the issue.

  • Service Fabric Explorer: Access Service Fabric Explorer to diagnose errors and verify the deployment status. If you receive an error message, download the latest version of Azure Service Fabric to resolve the issue.

  • Custom Packages: If a custom package fails to deploy, check the orchestrator machine event logs for any errors. If the package has the same filename as a previously deployed package, rename it to avoid deployment issues.

By following these troubleshooting steps, you can resolve common errors encountered during the package deployment process in Dynamics 365 finance and operations apps.

Sign off and finalize package deployments

After successfully deploying a package, it is crucial to verify its success and mark it as complete. In LCS:

  1. Navigate to the environment's Full details page.

  2. Select History > Environment changes and locate the deployed package.

  3. Click Sign off to confirm the deployment.

  4. If the package was applied to a Tier 2 Sandbox Acceptance Test environment, mark it as a release candidate for production.

This process ensures that deployments are properly tracked and ready for the next stage in the deployment flow.

Deploy models to Online Environment

Developers can deploy their models into the development online environment (UDE). Packages will be deployed and database synchronized to the UDE environment. In Visual Studio:

  1. Navigate to the Extensions > Dynamics 365 > Deploy and Deploy Models to Online Environment.

  2. Find the Package to deploy (note: more models can exist in one package).

  3. Make Deploy and DBSync for the packages to be included.

  4. Click Deploy to start the operation.

Package(s) will be deployed to the attached UDE environment, and will take some time. Check the Output log for status.

Further resources

Also see: