Example: Automating service requests to create a virtual machine in Microsoft Azure


Use the BMC Sample Create Virtual Machine <versionsample service in BMC Helix Digital Workplace Catalogto automate service requests for creating virtual machines in Microsoft Azure.

Scenario

Ajay, an application business analyst, wants to create a service to automate the task of creating virtual machines in Azure. He uses the BMC Sample Create Virtual Machine <version> sample service content package. Ajay first creates an Azure connector configuration. He updates the service and publishes the service to make it available to users.

The following video (2:26) explains how to automate a user request for virtual machine creation:

22_1_icon_play.pnghttps://youtu.be/ytn_M5Pxcpo

Task 1: To create an Azure connector

  1. Log in to BMC Helix Digital Workplace Catalog.
  2. On the Administration tab, click Connectors.
  3. Select Connectors > Azure, and click Add new setting.
  4. Enter the following fields:

    Field

    Description

    Connection Id

    Connection ID for the connection.

    Name

    Name for the connection.

    Subscription Id

    ID obtained while creating the Azure account.

    Tenant Id

    Value of the Directory ID corresponding to Active Directory in Azure.

    Client Id

    Value of the Application ID obtained after creating an application in Azure Active Directory.

    Client Key

    The password that you specified during the creation of the Active Directory account.

    Region

    The region from the available Microsoft Azure regions.

  5. Click Save.

Task 2: To define Create Azure VM service

  1. Log in to BMC Helix Digital Workplace Catalog.
  2. On the Services tab, click Services.
    The service BMC Sample Create Virtual Machine <version> is displayed in the Service Management console.
  1. Select the service, click Actions, and click Edit Service Name.
    22_1_CreateVm edit service name.png
  1. Update the service name, and click Save.
    For example, Create Azure VM.

Task 3: To define Create Azure VM service workflow

  1. In the BMC Helix Digital Workplace Catalogapplication, in the Service Management console, select the Create Azure VM service.
  2. Click Actions and click Open.
  3. In the Service Options pane, click Edit corresponding to the Workflow option.
    22_1_Azure Edit workflow.png
  1. In the Workflow and Questions pane, in the Workflow section, click Edit.
    22_1_CreateVM edit workflow.png
    The following workflow is displayed in the Workflow designer:
    22_1_CreateVM_workflow.png
    The following elements are used in the workflow:
    • Create Vm—Creates a virtual machine in Azure based on the input variables provided to the workflow. 
    • Send User Message—Uses the Create Vm output and sends an email to the service requester with details of the virtual machine that is created.
  1. If required, update the workflow input variables.
    The following input variables are available:

    22_1_CreateVM_workflow_properties.png 
    Map these input variables to the service questionnaire so that the user responses to service questions are used as variable values.
  2. Select the Send User Message element in the workflow and update the Outgoing Profile Source and Outgoing Email Profile properties.
  1. Save the changes.

Task 4: To define Create Azure VM service questionnaire

  1. In the BMC Helix Digital Workplace Catalogapplication, in the Service Management console, select the Create Azure VM service.
  2. Click Actions and click Open.
  3. In the Service Options pane, click Edit corresponding to the Workflow option.

    22_1_Azure Edit workflow.png
  4. In the Workflow and Questions pane, in the Questions section, click Edit.
    22_1_CreateVm edit questions.png
    The following questions are displayed in the Questions Designer:

    Question

    Description

    vnName

    The value specifies the name of the virtual machine. Users can specify any name.

    subscriptionID

    Values are populated by using the Subscription Azure Resource Graph. Users can select any one of the values.

    region

    Values are populated based on the selected subscriptionIDUsers can select any one of the values.

    imagePublisher

    Values are populated based on the selected region. Users can select any one of the values.

    imageOffer

    Values are populated based on the selected imagePublisherUsers can select any one of the values.

    imageSKU

    Values are populated based on the selected imageOfferUsers can select any one of the values.

    imageVersion

    Values are populated based on the selected imageSKUUsers can select any one of the values.

    imageURL

    Values are populated based on the selected imageVersionUsers can select any one of the values.

    customImageID

    Values are populated based on the selected imageURLUsers can select any one of the values.

    osType

    Values are populated based on the selected subscriptionIDUsers can select any one of the values.

    IsExistingResourceGroup

    Value specifies whether the virtual machine belongs to an existing resource group. Users can specify the value as True or False.

    ResourceGroupName

    Values are populated by using Resource Group Name Azure Resource Graph. Users can select any one of the values.

    networkName

    Values are populated based on the selected ResourceGroupNameUsers can select any one of the values.

    subnet

    Values are populated based on the selected networkNameUsers can select any one of the values.

  5. If you have added additional input variables in the workflow to receive inputs from the service requester, add questions corresponding to the variables.
  6. Save the changes.

Task 5: To publish the Create Azure VM service

  1. In the BMC Helix Digital Workplace Catalogapplication, in the Service Management console, select the Create Azure VM service.
  2. In the Service Options pane, click 22_1_Example_Icon for publishing service.png, and click Publish.
    22_1_Publish Create VM service.png

After you publish the service, the service is available to users.

Task 6: To test the Create Azure VM service

  1. Log in to BMC Helix Digital Workplaceapplication.
  2. Submit a virtual machine creation request by using the Create Azure VM service.
    22_1_CreateVm request submit.png
  1. Verify that you receive an email about virtual machine creation.

Result

The Create Azure VM service is available to users. Users can submit Azure virtual machine creation requests by using this service, and their requests are processed automatically.


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*