Monsieur Winner

MS D365FO || Monsieur D365FO

Technical

Programmatically switch off D365FO DEV Virtual machine from Azure devOps(ADO)

While onboarding a new client for the Dynamics 365FO, there is a quite number of components to consider; among others fall the Development environment (Tier 1).

 

Prior to November 2020, Tier 1 sandbox was hosted by Microsoft. All clients are expected to host their respective development environment via an azure subscription which will be billed hourly. Most of the time, partners are in charge of clients’ LCS and manage both Dev environment and Azure DevOps platform.

We have to consciously try to stop the VM from LCS every close of business to minimize the consumption cost. We want to be able to switch -off these VM machines automatically during off-hours.

Doing this daily becomes manual where as it could be automated using Azure build agent on ADO, with the help of Dynamics 365 Finance and Operations Tools which is an extension on the Azure marketplace

In simple step we will run through this.

PREREQUISITE

The user account for this exercice must have access to the Azure subscription used in deploying the development environment .

 

Go to project on ADO then go to Pipelines, then click on new.

 

 

Here, we are creating a new pipeline with an empty job. Inside this job, we will install an Azure extension that will do the actual job of putting of our VM when we wish to(off hours preferably).

 

Name the Pipeline and install the Azure virtual machine extension.

Add a new task to the job.

Here, because I have already installed the extension in the past, I would simple add, else we have to install it first.

Configure the Task.

Select stop VM, select the Azure subscription for deploying the cloud hosted environment, select the resource group and lastly the VM.

Lastly setup up the frequency by adding a schedule under the Trigger tab.

The below image shows that we want the VM to auto go off by 3am on the following days.

Merci for reading.

 

admin

Komi Siabi is a Bilingual D365FO Solution architect who loves sharing his knowledge as he works on Both Francophone and Anglophone projects around the globe. He enjoys doing some tiktok videos in his leisure time.

2 thoughts on “Programmatically switch off D365FO DEV Virtual machine from Azure devOps(ADO)

Leave a Reply

Your email address will not be published. Required fields are marked *