Defining a template to create resources in Microsoft Azure
The following video (3:08) explains how to automate the task of defining an Azure Resource Management template for creating a storage account in Microsoft Azure:
Before you begin
Make sure that an administrator has configured the Microsoft Azure connector.
To create a process to define a resource template
- Log in to BMC Helix Innovation Studio.
- Navigate to the Workspace tab, and select the application in which you want to create a process.
- In the application, select Processes, and click New.
The system opens Process designer. - In the Process designer, drag the Create Template element to the canvas.
In the element Properties pane, enter the values of the following input properties:
Property
Description
Storage account template example
Connection ID
ID of the Microsoft Azure connector.
7f46afa3-7feb-43f8-8c67-9662c42eb8b8
Resource Name
Name of the resource that you want to create by using the template.
storage1
Template
JSON that defines the Azure resource that you want to create and its properties as per Azure formats.
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string"
},
"storageAccountName": {
"type": "string"
},
"accountType": {
"type": "string"
},
"kind": {
"type": "string"
},
"accessTier": {
"type": "string"
}
},
"variables": {},
"resources": [
{
"name": "[parameters('storageAccountName')]",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"location": "[parameters('location')]",
"properties": {
"accessTier": "[parameters('accessTier')]"
},
"dependsOn": [],
"sku": {
"name": "[parameters('accountType')]"
},
"kind": "[parameters('kind')]",
"tags": {}
}
],
"outputs": {}
}Important: You must add all the JSON name and value pairs in double quotes such as ""contentVersion"":""1.0.0.0""
Parameters
Expression for the template parameters.
To specify the parameters, use any one of the following ways:
- Specify a key-value pair in a JSON, key is the parameter name as the value is the parameter value.
- Specify the output of the Create Document template.
{
"location": {
"value": "eastus"
},
"storageAccountName": {
"value": "storage1"
},
"accountType": {
"value": "Standard_RAGRS"
},
"kind": {
"value": "StorageV2"
},
"accessTier": {
"value": "Hot"
}
}Important: You must add all the JSON name and value pairs in double quotes such as
{""location"":{""value"":""eastus""}Is Existing Resource Group
Value specifies whether the resource belongs to an existing resource group.
You can specify the value as True or False.
True
Resource Group
Resource group in which you want to create the resource.
MyStorageGroup
(Optional) Region
Name of the region in which you want to create the resource group.
This field is applicable when you specify the Is Existing Resource Group as False.
eastus
(Optional) Template Link URL
If you do not want to specify a JSON in the Template property, specify the URL of the template that you created in Azure portal.
https://mystorageaccount.blob.core.windows.net/container1/template.json
(Optional) Template Link Content Version
To use a specific version of an existing template that you created in Azure portal, specify the template version.
If you do not specify the template version, 1.0.0.0 version of the template is used by default.1.0.0.0
Mode
Specify one of the following template modes:
- Complete—Select this mode to delete the existing resources in the resource group and then add resources specified in the template to the resource group.
- Incremental—Select this mode to add resources specified in the template to the resource group and do not change the existing resources in the resource group.
COMPLETE
The Create Template element provides Resource Name as an output.
- If required, add the other process elements and specify the flow of execution that you want to create for your business logic.
- Save the process.
Example: Automating storage account template creation in Azure
Ajay is an application business analyst in Calbro Services. He wants to automate the task of defining an ARM template to create a storage account in Azure. To automate the task, he creates a process. Ajay uses the Create Document element to access attributes within the schema of the AzureTemplateParameters document definition. He add the values for the document nodes and uses these values as input to create the template. Ajay uses the Create Template element to define the template.
Ajay performs the following actions to create the process to define the template:
- Create the process as shown in the following image:
Add the Create Document element properties as shown in the following image:
- To add a document, select the AzureTemplateParameters document definition as shown in the following image:
- To add values for the document nodes, click Add/Remove Document Nodes, and select the key and value check boxes of nodes as shown in the following image:
For information about the Create Document element, see Creating-a-document-instance.
- To add a document, select the AzureTemplateParameters document definition as shown in the following image:
- Add Create Template element properties as shown in the following image:
- In the Create Template properties, in the Parameters field, map the Create Template element output as shown in the following image:
- Save the process.