Automate VM Provisioning, IS Installation & Configuration - Azure Devops, ARM Templates & Command Central
Tags: azure, devops, automate, tutorial
Published: 2021-08-31 07:28:16

---
title: Automate VM Provisioning, IS Installation & Configuration - Azure Devops, ARM Templates & Command Central
published: true
date: 2021-04-01 05:37:50 UTC
tags: #azure, #devops, #automate, #tutorial
canonical_url: https://tech.forums.softwareag.com/t/automate-vm-provisioning-is-installation-configuration-azure-devops-arm-templates-command-central/240187/1
---

This article provides the steps for achieving automated provisioning of an Azure VM, Install and Configure webmethods Integration Server using Azure Devops, Command Central, Azure Resource Manager (ARM) templates and YAML templates.

The high-level steps are given below

1. Provision Azure VM based on desired configuration using ARM template.
2. Enable WinRm (Windows Remote Management) for installation on HTTPs using ARM template and PowerShell script.
3. Install SPM on the new VM using Command Central via WinRm & YAML templates.
4. Connect to the new VM from Command Central.
5. Install & Configure webmethods Integration Server using Command Central via WinRm & YAML templates.
6. Start the Integration Server.

**Pre-Requisite**

- Command Central Server installed, configured and accessible remotely.
- Access to Azure Portal with a valid subscription.
- Access to Azure Devops Portal.

**Detailed Steps**

1. Log into to Azure Devops Portal ([dev.azure.com](http://dev.azure.com)) and under your organization, create a new project ( _Use the classic editor_ ).
2. Create a new pipeline within the project and connect to the desired repository. In this case, I am using Azure Repos Git.  
 ![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/4/484125586ab4693d39fd5c4dcaf5a4e200daecc2.png)
3. Create and empty pipeline job and azure creates an agent job by default.  
 ![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/a/afd088dcebb465dc9c2d4920772b64f3143ec92b.png)
4. Within the Agent Job, add a new step “ARM Template deployment”  
 ![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/9/966b8277ffc43227abbd7fe4dc13fcfc03660d26.png)  
For this task, you need to have the “Azure Resource Manager Connection” configured. If you have already configured one, go ahead and use it. If not click on manage and create a new service connection.  
For the new service connection, click on “Azure Resource Manager” as shown below and select “Service Principal” manual or automatic. If service principal is not created, you can create one using the below command from Azure PowerShell.  
 ![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/4/498918aad9c67d70fb98dda148fdf2a3885a59bf.png) ![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/0/068a7bd9e89eb5ca78b81251ccde69cfa376d60e.png)  
 ![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/d/dc1f20ab43c5a3cd58763ca5c89ea54d9b73b5e0.png)  
Below is the command for Password based authentication using Azure CLI. You can even use certificate-based authentication.  
Command - `az ad sp create-for-rbac --name ServicePrincipalName`  
For creating an Azure AD application and Service Principal via portal, please refer to link - [Create an Azure AD app & service principal in the portal - Microsoft identity platform | Microsoft Docs](https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal)
5. Once the ARM service connection is configured, lets proceed with VM provisioning via ARM templates.  
In the Azure pipeline “ARM Template Deployment”, select the service connection created and provide the subscription details. The templates here is uploaded from Azure Repos Git.  
The template parameters can be overwritten as shown below.  
The template in this case does the below –  
Provision a new VM with the desired size, OS, location etc.  
Create Self Signed Certificate and Enable WinRm over HTTPs  
 ![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/2/2eeea6ec716d6e267e83f87df8ccb8f06816a16a.png)  
Templates used in the POC Attached below  
[ARM\_SampleTemplate.zip](/uploads/short-url/pgiETSQJv4vxClYw3O1UY398SOx.zip) (4.0 KB)  
Sample templates for different tasks are available in the below link. We can even combine different templates as needed.  
_[Azure Quickstart Templates](https://azure.microsoft.com/en-in/resources/templates/)_
6. After the VM is created and provisioned, we need to install webmethods Platform Manager on the VM remotely using Command Central. Add the “Run PowerShell on Target Machines” task to execute the Platform manager installation.  
This task uses Platform Manager YAML template and a power shell script to access the VM using WinRm. The necessary product image, fix image, license key and the templates need to be uploaded on Command Central.  
For more details refer to - _[sagdevops-templates/templates/sag-spm-boot-winrm at master · SoftwareAG/sagdevops-templates · GitHub](https://github.com/SoftwareAG/sagdevops-templates/tree/master/templates/sag-spm-boot-winrm)_  
 ![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/d/d8c5a69ad0663374ae9d50e4f9ff31d40479e5b1.png)  
Script used here –  
`<Path to sagcc.bat>/sagcc.bat exec templates composite apply <sag spm YAML Template> nodes=["<fqdn of the vm>"] cc.installer=<cc installer.zip> install.dir=C:\\SoftwareAG os.username=<domain>\<username> os.password= ****** --sync-job --wait 900`
7. Next Step is to add a node in Command Central and connect to Platform Manager on the newly provisioned VM. We again use “Run PowerShell on Target Machines” to connect to Platform Manager. This task will also be executed on the build server, i.e. Command Central machine.  
This task uses YAML template and to connect and add the node in Command Central  
 ![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/9/9b24bc49afca76014305195bf8c1cb22a5be9fa5.png)  
Script used here –  
`<Path to sagcc.bat>/sagcc.bat/sagcc.bat exec templates composite apply sag-spm-connect hosts=<fqdn of the vm> spm.port=8092 --sync-job --wait 360`
8. Once the node is added to Command Central, we can proceed with webmethods Products installation again using Command Central. Here also we will use “Run PowerShell on Target Machines” to install and configure Integration Server. The configuration necessary for Integration Server is provided via the YAML template. ![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/5/5d928ed70def69a4a50c3fd37b83fcc75fe78219.png)  
Script used here – `<Path to sagcc.bat>/sagcc.bat exec templates composite apply sag-is-server nodes=<fqdn of the vm> is.memory.max=512 repo.product=<product repo> is.integrationserver.license.key=<is license key> --sync-job --wait 900*`
9. Once all the steps are executed in sequence, VM is provisioned, Platform Manager is installed and connected to Command Central and finally Integration Server is installed and configured based on the YAML template.  
 ![image](https://aws1.discourse-cdn.com/techcommunity/original/2X/c/cf45d8e01520c63131670ea3beff16db8316b13b.png)

[Read full topic](https://tech.forums.softwareag.com/t/automate-vm-provisioning-is-installation-configuration-azure-devops-arm-templates-command-central/240187/1)