Skip to main content

Azure DevOps Task to Deploy Code

Today we are happy to announce the release of our second Azure DevOps task in the marketplace, which allows you to deploy code from the asset library into a cloud test and sandbox environment. This completes are first version of end-to-end CI/CD automation for Dynamics 365 for Finance and Operations. If you already have the extension enabled in your Azure DevOps account, the update upload task and new deploy task should be available without any action needed. Search for "LCS" when adding new tasks to your release pipeline and you will find the new Asset Deployment task. We are also actively working on official documentation on the usage and setup of the tasks, so stay tuned for that.

AZDO_5F00_Tasks.jpg

As outlined in our original post when we released the asset library upload task, you will need to perform some setup around Azure Active Directory to create a Dynamics Lifecycle Services (LCS) connection in Azure DevOps. If you've already performed this setup previously, you can re-use the same connection for this new task.

With this release, there are a few notes to make.

For the upload task:

  • The existing upload task has remove the option to upload a database, as there were some issues around this feature that are currently unresolved. However, new asset types are now available for upload, including the much requested model and data package types.
  • The existing upload task has a new parameter called Wait for Validation, which is enabled by default, which will make the task wait for validation of the asset. This is necessary for a release pipeline where the software deployable package type will be deployed after uploading - it needs to be validated before it can deployed. For situations where you're not deploying you can turn this option off.
  • The upload task now has an output variable. This returns the ID (guid) of the asset in the asset library. This ID is needed to tell the deploy task which asset to deploy. Under "Output Variables" you will find the list of variables. Enter a Reference Name, for example "Upload", and you will notice the list of variables will show "Upload.FileAssetId". This means in subsequent tasks such as the deploy task, you can use $(Upload.FileAssetId) to retrieve the ID returned by the upload task.

AZDO_5F00_OutputVars.jpg

For the new deploy task:

  • You can (should) reuse the same connection setup for the upload task.
  • You can use the upload task's output variable for the asset ID. If the reference name you entered in the Output Variables section of the upload task is "Upload", then use $(Upload.FileAssetId) .
  • The LCS Environment Id to deploy to is the GUID identifying your environment in LCS. You can find this on the environment details page of your environment in the top section named Environment Details which lists the Environment Id.
  • The deploy task also has a Wait for Completion checkbox that is turned on by default. You can decide to wait for the deployment to succeed or fail (and succeed/fail the release) or decide to trigger the deployment and end the release (the release could still fail if the deployment couldn't be started, for example if an existing servicing request will still going on). This provides some flexibility in use cases.
  • LIMITATIONS: The deployment task currently only supports traditional cloud hosted environments on private or on the Microsoft subscription. It currently does not support on-premise or the newer self-service environments. This is planned for a future release.
  • The task will not allow you to deploy to production environments. This is a deliberate design choice and we have no plans to remove this limitation at this point. You can deploy to any tier1 and tier2+. Deploying a software deployable package to a build environment is also blocked, which is consistent with the experience from the LCS portal itself.
  • There is a known issue with a wrong error message. When trying to deploy an incompatible version to an environment (eg, a software deployable package build on a more recent platform version than the environment supports) the task will return an error that says there is already "an operation in progress" - which is the same message returned when an environment is not in a state where it can be serviced. We are working on fixing the error message in one of the upcoming updates.

We are excited about these first steps in our CI/CD story and are looking forward to your feedback.

Comments

*This post is locked for comments

  • Community Member Profile Picture Community Member Microsoft Employee
    Posted at
    Is this limitation still relevant? "LIMITATIONS: The deployment task currently only supports traditional cloud hosted environments on private or on the Microsoft subscription. It currently does not support on-premise or the newer self-service environments. This is planned for a future release." Thanks
  • Community Member Profile Picture Community Member Microsoft Employee
    Posted at
    Is this limitation still relevant? LIMITATIONS: The deployment task currently only supports traditional cloud hosted environments on private or on the Microsoft subscription. It currently does not support on-premise or the newer self-service environments. This is planned for a future release. Thanks
  • mhdshb1 Profile Picture mhdshb1 1,250
    Posted at
    Thank you Joris, Excellent work. It saved us a lot of time. When is the estimate for arrival of the LCS asset deployment for OnPrem?
  • perreaultd Profile Picture perreaultd
    Posted at
    Any ETA on support for on-prem or self-service environments?
  • perreaultd Profile Picture perreaultd
    Posted at
    There is one limitation i do not understand where you say that tasks is supported for cloud-hosted but not for on-prem or the "newer self-service environments". Whats the differences between those 3 env. type? I have not found any clear documentation about the "self-service environments".
  • MeaCulpa Profile Picture MeaCulpa
    Posted at
    For those who do not understand why the deployments are shown as "failed" despite succeding on LCS, here's the response I got from contacting the Microsoft Support : "I think what you may be seeing is the 60 minute maximum on hosted agent processes. If you’re running the release pipeline on an Azure DevOps (AZDO) hosted agent, AZDO will only let it run for 60 minutes. If it’s over 60 minutes, it will cancel the job. In that case, AZDO will show a failure, but LCS is still running the deployment and may actually succeed. This is expected." So it's basically your agent which timeout
  • zoemac1112 Profile Picture zoemac1112 5
    Posted at
    Ive got an issue where the task failed becuase the agent isnt above 2.119, even though it is No agent found in pool which satisfies the specified demands: azureps Agent.Version -gtVersion 2.119.1 Agent.Version - 2.150.0
  • kgmadsen Profile Picture kgmadsen 30
    Posted at
    Regarding the issue with the Error "in request to deploy file asset: 'The request is invalid." please take a look at the link here : www.linkedin.com/.../ - Worked for me ! :)
  • Martin Rasmussen Profile Picture Martin Rasmussen 15
    Posted at
    Any input to this? It fails at DevOps. i.imgur.com/3VYGwEc.jpg But it seems completed at LCS: i.imgur.com/9kaYFhV.jpg We are using the same configuration in other environments, both at the same customer and other customers, where we sometimes see the error as well.
  • Budi Ristanto Profile Picture Budi Ristanto 75
    Posted at
    Hi Joriz thanks you very much,, i got some error after upload release to lcs -> Error '' in request to deploy file asset: 'The request is invalid.' im using $(Release.ReleaseName) $(Build.BuildNumber)for name and it succesuffuly uploaded to lcs with release name and build number..