Automating the creation of virtual machines and storage accounts


As an application business analyst, you can automate the actions that you perform in Microsoft Azure, such as creating a storage account and creating a virtual machine. To automate these actions, in your application, you can create processes by using the Create VM and Create Storage Account Service elements in the Process designer of BMC Helix Innovation Studio.

Before you begin

Make sure that an administrator has configured the Microsoft Azure connector. For more information, see Adding-a-Microsoft-Azure-connector-configuration.

Create VM element properties

A Create VM element creates a virtual machine in Microsoft Azure.

The following video (2:49) explains how to automate the task of creating a virtual machine in Microsoft Azure:


icon_play.png https://youtu.be/NgByYLkA8_I

The following table describes the Create VM input properties:

Property

Description

Connection ID

Connection ID of the Microsoft Azure connector.

User Name

User login name for the virtual machine that you want to create.

Password

Password for the virtual machine.

The password can be 8 to 123 characters long and must meet any three of the following requirements:

  • At least one lowercase character
  • At least one uppercase character
  • At least one numeric character
  • At least one special character

Vm Name

Name of the virtual machine.

The value must be 1 to 15 characters with no special characters.

(Optional) Region

Name of the region in which you want to create the virtual machine.

If you do not specify a region, the region configured in the Azure connector is used.

For information about supported regions, see Microsoft Azure regions.

Resource Group

Name of the resource group to which the virtual machine belongs.

Vm Size

Size of the virtual machine.

Primary Network

Network address space of the virtual machine.

Os Type

External ID of a service imported from the Microsoft Azure that is mapped to the process.

Important:

  • If you want to use a custom, specific, or latest virtual machine image, you must specify the Os Type value as Windows or Linux.
  • If you want to use a popular virtual image, specify the Os Type value from the following list:
    Values for Linux


      • UBUNTU_SERVER_14_04_LTS
      • UBUNTU_SERVER_16_04_LTS
      • UBUNTU_SERVER_18_04_LTS
      • DEBIAN_9
      • DEBIAN_10
      • CENTOS_8_1
      • OPENSUSE_LEAP_15_1
      • SLES_15_SP1
      • REDHAT_RHEL_8_2
      • ORACLE_LINUX_8_1

    Values for Windows

    • WINDOWS_DESKTOP_10_20H1_PRO
    • WINDOWS_SERVER_2019_DATACENTER
    • WINDOWS_SERVER_2019_DATACENTER_WITH_CONTAINERS
    • WINDOWS_SERVER_2016_DATACENTER
    • WINDOWS_SERVER_2012_R2_DATACENTER
  • If you want to use the latest virtual machine image, you must specify the Os TypeImage PublisherImage Offer, and Image SKU values.
  • If you want to use a specific virtual machine image, you must specify the Os TypeImage PublisherImage Offer, Image SKU, and Image Version values.
  • If you want to use a custom virtual image, you must specify the Os Type and customImageID values.
  • If you want to use a popular virtual image, you must specify the Os Type and imageURL values.

USER_BY

Login name of the virtual machine requestor.

(Optional) Is Existing Resource Group

This value specifies whether the virtual machine belongs to an existing resource group.

You can specify the value as True or False.

Important: If you specify the Is Existing Resource Group as True, you must also specify the Existing Primary Network Resource Group, Existing Primary Network Name, and Existing Primary Network Subnet values.

(Optional) Is Existing Group

This value specifies whether the virtual machine belongs to an existing resource group.

You can specify the value as True or False.

(Optional) Existing Primary Network Resource Group

Name of the resource group of the primary network that you want to use.

(Optional) Existing Primary Network Name

Name of the existing network that you want to add to the virtual machine.

(Optional) Existing Primary Network Subnet

Name of the associated virtual network subnet.      

(Optional) Existing Primary Network Interface Resource Group

Name of the resource group of the network interface that you want to use.

Important: If you specify the Existing Primary Network Interface Resource Group value, you must also specify the Existing Primary Network Interface Name value.

(Optional) Existing Primary Network Interface Name

Name of the network interface that connects the IP address with the network.

(Optional) Image Publisher

Name of the organization that provides a virtual machine image in the Azure Marketplace, that you want to use.

(Optional) Image Offer

Name of a group of related images created by the image publisher.

(Optional) Image Sku

An instance of an image offer such as a major release of image distribution.

(Optional) Image Version

The version number of an image SKU.

(Optional) Custom Image ID

ID of the image that you want to use.

(Optional) Image URL

Location of the image.

Important

  • You must specify a value for either the Is Existing Resource Group field or the Is Existing Group field.
    If you do not provide values for both the fields, the following error is displayed:
    Please specify the value for isCreateWithExistingResourceGroup or isCreateWithExistingGroup
  • If you specify values for both the fields, Is Existing Resource Group and Is Existing Group, the values of both fields must be the same.

The following table describes the Create VM output properties:

Property

Description

Example

IP

The IP address of the provisioned virtual machine.

192.158. 1.3

Status

Current status of a virtual machine such as Running, Deallocating, and Stopped.

Running

User Name

User login name of the virtual machine.

Allen

User Password

Login password of the virtual machine.

<User password>

Create Storage Account Service element properties

A Create Storage Account Service element creates a storage account in Microsoft Azure.

The following table describes the Create Storage Account Service input properties:

Property

Description

Connection Id

Connection ID of the Microsoft Azure connector.

Resource Group

Name of the resource group to which the storage account belongs.

Storage Account Name

Name of the storage account that you want to create.

The name must meet the following requirements:

  • 3 to 24 characters long
  • Numeric characters and lowercase letters only
  • Unique within Azure portal

(Optional) Region

Name of the region in which you want to create the storage account.

If you do not specify a region, the region configured in the Azure connector is used.

USER_BY

Login name of the storage account requestor.

(Optional) Is Existing Resource Group

This value specifies whether the storage account belongs to an existing resource group.

You can specify the value as True or False.

(Optional) Is Existing Group

This value specifies whether the storage account belongs to an existing resource group.

You can specify the value as True or False.

Authorized Network Name

Name of the authorized network that you want to use.

Important: You can create a storage account only on the virtual networks that are authorized networks for storage account creation.

Authorized Network Subnet

Name of the associated authorized network subnet.    

Authorized Network Resource Group

Name of the authorized network resource group.

Authorized Ip Address

The IP address of the authorized network.

Authorized Ip Address Range

The IP address range of the authorized network.

Important

  • You must specify a value for either the Is Existing Resource Group field or the Is Existing Group field.
    If you do not provide values for both the fields, the following error is displayed:
    Please specify the value for isCreateWithExistingResourceGroup or isCreateWithExistingGroup
  • If you specify values for both the fields, Is Existing Resource Group and Is Existing Group, the values of both fields must be the same.

The following table describes the Create Storage Account Service input properties:

Property

Description

Example

Account Name

Name of the storage account.

mystorageaccount

Key 1

Key 1 of the storage account.

Sample value:

6HUgdtEBmTrG3nKXsT6oNccgtQA7rnFJ8lhPgCwSXjIUlJe3gFC+dzhZAlxoUxAzvIASFYXKflNhi29O/1k7/g==

Key 2

Key 2 of the storage account.

Sample value:cpaQtiTly9b1gVLTRjjfdRa+zTz7uJcFodh5LO2ePxuFd5AFzhlb57P1Tgn5UiP+ZBkvzv+ceGeWQ9GCYaXOWQ==

To create a process to create a virtual machine or storage account

  1. Log in to BMC Helix Innovation Studio.
  2. Navigate to the Workspace tab, and select the application in which you want to create a process.
  3. In the application, select Processes, and click New.
  4. In the Process designer, drag the element to the canvas based on the action that you want to perform in Microsoft Azure:
    • To create a virtual machine, drag the Create VM element to the canvas.
    • To create a storage account, drag the Create Storage Account Service element to the canvas.
  1. In the element Properties pane, enter the property values.
  2. If required, add the other process elements and specify the flow of execution that you want to create for your business logic.
  3. Save the process.

Data lookups and Azure Resource Graph queries

You can use data lookups and Azure Resource Graph queries with the Create VM element to select a value from the list of available values to specify the input properties. You can use Azure Resource Graph queries as queryable datasets for all the resources that are available in the Azure Resource Graph Explorer. The following image shows an example of a Resource Graph Explorer:

22_1_Azure Resource Graph Explorer.png

Consider the following points while using Azure Resource Graph:

  • Azure Resource Graph lookups are recognizable by their names that contain slashes (/). For example, microsoft.compute/disks
  • All the data lookups on the Azure Resource Graph require the following qualification criteria:
    Subscription ID is <subcription ID>
  • The subscription ID that you define in the Azure connector configuration is not used as the default subscription ID. Use the subscription ID available in the Azure dashboard with a question that lists the subscriptions. For example, use the Subscriptions map-to-form data lookup. If you do not specify a subscription ID, other qualification filters are ignored, and the lookup data is blank. 
  • You can use the Azure Resource Graph lookups for the IDNameTypeTenant IDLocationSubscription ID, and Managed by parameters. Do not use the Azure Resource Graph lookups for Resource GroupSKUPlanPropertiesTagsIdentityZones, and Extended Location parameters. 
  • The Azure Resource Graph lookups return API values that are not formatted values. For example, for the Subscription ID, the value returned is the subscription GUID.

To learn about Azure Resource Graph, see Azure Resource Graph.

Example: Automating virtual machine creation in Azure

Ajay is an application business analyst in Apex Global. He wants to automate the task of creating a virtual machine in Microsoft Azure, which will reduce the manual efforts of the agents.

To automate the task, Ajay creates a process. He uses the Create VM element to create a virtual machine in Azure and uses the Send Virtual Machine Creation Email element to notify the virtual machine details to the user.

Ajay performs the following actions to create the process to automate the creation of a virtual machine:

Step

Description

Example

1

Create a process.

22_1_Create VM process.png

2

Add the process properties.

22_1_Create VM process properties.png

3

Add the Create VM element properties.

22_1_Create VM properties.png

4

Add Send Virtual Machine Creation Email element properties.


22_1_Send VM properties.png

5

Save the process.


Example: Automating storage account creation in Azure

Ajay is an application business analyst in Apex Global. He wants to automate the task of creating a storage account in Microsoft Azure. To automate the task, Ajay creates a process. He uses the Create Storage Account Service element to create a storage account in Azure and the Send Azure Storage Creation Email element to notify the storage account details to the user.

Ajay performs the following actions to create the process to automate the creation of a storage account:

Step

Description

Example

1

Create a process as shown in the example.

22_1_Create storage process.png

2

Add the process properties.

22_1_Create storage process properties.png

3

Add the Create Storage Account Service element.

22_1_Create storage properties.png

4

Add Send Azure Storage Creation Email element properties.

22_1_Send storage properties.png

5

Save the process.


Example: Using lookups to specify Create VM element input properties

Ajay is an application business analyst at Apex Global. Apex Global uses BMC Helix Digital Workplace Catalog application to manage user service requests. Ajay automates the task of creating a virtual machine in Azure. He creates a process to automate the task and uses the process as a workflow in a service in BMC Helix Digital Workplace Catalog. While adding a questionnaire for the service, Ajay wants to use lookups to populate answers in the questionnaire. When a user uses the service to submit a virtual machine creation request, the user can specify the answers by selecting a value from the list of available values.

Ajay performs the following actions to use lookups in the questionnaire:

  1. In the Question Designer of the service, add the user-generated questions of Lookup type in the following sequence:

    Lookup

    Details

    subscriptionID

    22_1_Subscription ID.png

    region

    22_1_Region.png

    imagePublisher

     22_1_Image publisher.png

    imageOffer

     22_1_Image offer.png

    imageSKU

     22_1_Image SKU.png

    imageVersion

     22_1_Image version.png

    vmSize

    22_1_VMsizes.png

    resourceGroupName

    Map the Azure Resource Graph query to the Question Values field.

    22_1_Resource group name.png

    virtualNetwork

     22_1_Virtual network.png

    subnet

     22_1_Subnet.png

  2. Save the questionnaire.

Learn about how to create questionnaires at Creating service questionnaires.