You are on page 1of 18

D365 F&O Azure DevOps Tasks

Introduction – All about me


• Joris de Gruyter
• Senior Engineer/Program Manager at Microsoft
• 17 years in Axapta / Dynamics AX / Dynamics 365
• Official “Insiders tips on development and customization” blog
• https://community.dynamics.com/365/financeandoperations/b/newdynamicsax/
• Personal
• Blog: https://daxmusings.codecrib.com
• Twitter: @jorisdg
• LinkedIn: https://www.linkedin.com/in/jorisdg/
Introduction – ALM & CI/CD
• Application Lifecycle Management (ALM)
• Encompasses a lot of things related to the environment: updates,
database management, code artifacts, etc.
• We typically like to differentiate “Dev ALM”

• Continuous Integration, Continuous Delivery (CI/CD)


• Fail early and quickly
• Integration = code integration = builds
• Delivery = deliver into testers’ hands = deployment
Introduction - DevOps
• DevOps
• Is a process, supported by tooling
• The continuous delivery of “value” to users
• This is everything: build+deployment+monitoring
• Cross-team : developer + admin + user

• Dynamics 365 and Azure DevOps


• Lifecycle Services (LCS) owns the ALM experience
• Azure DevOps is our default orchestrator and automation tool
Introduction - Dyn365 and Azure DevOps
• Lifecycle Services (LCS) owns the ALM experience
• Because it owns the environments
• Updates, Database Movement, Code Deployment
• APIs are being added to allow automation and orchestration of the ALM
experience
• Azure DevOps is our default orchestrator and automation tool
• But we are standardizing
• Visual Studio, LCS APIs
• We will document
• To support community efforts and existing enterprise processes/tools
Continuous Integration
• Build VM
• Contains full environment and build agent
• Default build definition variables allow for tweaking the process with
variables
• Do NOT use for development
• Tightly coupled with the version/update
• A new build experience is coming, without VM
• Simple and standard .NET
• No VM required
• Free on Azure DevOps hosted agents, with minutes per month
Continuous Delivery
• Manual LCS process:
• Upload deployable package to Asset Library
• Start servicing update on an environment

• Azure DevOps tasks now available to automate these two steps


Azure DevOps Marketplace
To enable on your Azure DevOps account, go to marketplace.visualstudio.com and on the Azure
DevOps tab search for “Dynamics 365”. Click “Get it free” and follow the prompts.
https://marketplace.visualstudio.com/items?itemName=Dyn365FinOps.dynamics365-finops-tools
Release Pipeline
• Link to “artifacts” from your build automation pipeline
• Add the two tasks by click on the + sign and search for “LCS”
Connection Setup
• Prerequisites to add the LCS Connection:
• Create Azure Active Directory (AAD) “Application ID” for a “native” or
“public client” application
• Give “Dynamics Lifecycle services” API permission for the application
registration
• Grant consent for the user you will use to authenticate to LCS using
this app registration
A good walkthrough:
https://www.jaestevan.com/release-your-dynamics-365-for-finance-and-operation-
packages-to-lcs-with-azure-devops-pipelines-en/
Upload Task
• Project ID: Get the number from your LCS project’s URL
• File to upload: if tied to your build definition/artifact you can pick
the file. You can replace the build number with the actual
number that came from the build.
• Asset name/description are optional (it will default to filename)
but can be useful to use variables of release number, dates, etc.
• “Wait for validation” is necessary it the next step will be
deploying.
Upload Task
• Expand Output Variables!
• Upload will generate a file asset ID you need to start deployment.
Supply a reference name so that subsequent tasks can use the
variables. In this example, I can now use “Upload.FileAssetId” in the
next tasks…
Deployment Task
• Get the Environment ID from your environment’s URL, or from
the environment details page
• LCS File Asset Id should be the variable name listed in the
upload output section, in the correct format. Per the previous
example, it should be $(Upload.FileAssetId)
• Wait for completion can be turned off if you just want to
deployment to start and only fail if it couldn’t start
Deployment Task
• When using “hosted” agents, there is a 60 minute maximum run
time. You can use a private agent (e.g. the build VM) or turn off
the wait for completion option.

• There’s a known issue where the deploy will fail with an error
saying the environment is not in a state where it can start a new
deployment. This typically means there is a version mismatch.
Limitations
• ‘Current’ Limitations
• Connection to LCS can’t be used with MFA accounts
• No on-prem
• No self-service environments
• Intended Limitations
• No production environments
• Azure DevOps Limitation
• Output variables across stages
• See https://www.linkedin.com/pulse/azure-devops-task-deploy-code-micosoft-
dynamics-365-ghazvinizadeh/
What’s Next

• For you:
• Get creative with Azure DevOps!

• For Microsoft:
• More LCS APIs!
• Telemetry
Thank You!
Contact
Joris de Gruyter, Senior Engineer/Program Manager at Microsoft

• Official “Insiders tips on development and customization” blog


• https://community.dynamics.com/365/financeandoperations/b/newdynamicsax/

• Personal
• Blog: https://daxmusings.codecrib.com
• Twitter: @jorisdg
• LinkedIn: https://www.linkedin.com/in/jorisdg/

You might also like