Managing ARM Templates and Resource Groups

ARM templates simplify provisioning on Azure. You can create templates for the service or application architectures you want and have Azure use those templates for quick and reliable provisioning of services or applications in resource groups. Resource groups allow you to group resources with similar lifecycle requirements. By adding an ARM template to the Commander service catalog, you can use Commander to deploy any set of Azure resources into an existing resource group or a new resource group — whether or not those resources are directly supported by Commander.

ARM templates are JSON files that specify Azure resources to deploy and configure. These templates can be thought of as an analogue to the Commander service catalog entry. They list the images used to provision instances and they describe information such as network security groups and availability sets used to configure the instances. ARM templates have parameters that serve as inputs, such as DNS name, OS version and credentials.

Commander support for ARM template parameters: Example

Commander allows you to add ARM template parameters to the request form with a combination of custom attributes and variables. When you add an ARM template to the service catalog, the parameters and initial values displayed are retrieved from the template. Parameter values are encrypted when saved in the Commander database. Parameters can also be customized during manual deployment.

Custom attributes allow:

  • Requesters to select parameter values on the form.
  • Requesters to specify a regular expression value for a parameter on the form.
  • Administrators to select parameter values during manual deployment.
  • Administrators to specify a regular expression value for a parameter during manual deployment.

Variables allow you to access information about the deployment destination and the request form. See ARM Template Parameter Variables for the list of supported variables.

For example, our ARM template has parameters for user name, password and Ubuntu version. You can hard-code parameter values when you create the service catalog entry, or you can allow users to input values. To allow a user to specify the credentials and select the Ubuntu version:

  1. Add an ARM template to the catalog as described in Components page.
  2. On the Attributes tab, click Add Attributes.
  3. In the Add Attributes dialog, click Create New Attribute.
  4. Enter "Ubuntu Version" for the Name, and enter a description if you wish.
  5. For Type, choose List (to allow users to select from a list of versions).
  6. To allow users to specify a regular expression instead, select Text. See Creating custom attributes for more information.

  7. For Applies To, choose Form.
  8. Clear the Edit in Service Portal option and click Next.
  9. On the Configure Attribute page of the wizard, enter a comma-separated list of Ubuntu versions, then click Add to move the values to the list box.
  10. Click Finish.
  11. The Ubuntu Version attribute is now selected in the Add Attributes dialog.

  12. Click OK.
  13. Click the Attributes tab. The Ubuntu Version attribute appears. If you want, choose a default version.
  14. Ubuntu Version

  15. Click the Form tab, then from the Toolbox at the right side of the page, click Ubuntu Version to add it to the form.
  16. Click Edit and enable the Required option.
  17. Ubuntu version in Form section

  18. From the Toolbox, click Input Text Field, and once the element is added to the form, in Display Label, type "User Name", then click OK.
  19. From the Toolbox, click Input Text Field again, and once the element is added to the form, in Display Label, type "Password", enable Hide User Input, then click OK.
  20. Click the Parameters tab to add the variables to the adminPassword and adminUsername fields.
    • Beside the adminPassword field, click vars-20x20 to open the Variable Assistant. Notice that the form elements you just created on the Form tab now appear under Form Input Fields.

      In the Variable Assistant, select Password from the list, click Insert, and click OK.

      Password variable

    • Beside the adminUsername field, click vars-20x20, then in the Variable Assistant, select User Name from the list, click Insert, and click OK.
    • Beside the ubuntuOSVersion field, click vars-20x20, then in the Variable Assistant, select Ubuntu Version, click Insert, and click OK

      The Parameters tab now looks like this:

      ARM Template Service

  21. Click Finish to save the service in the catalog.

Now, requesters must enter credentials and select an Ubuntu version when requesting this ARM template from the service catalog. Their selection will be passed to Azure as a parameter through the Commander variable. An administrator can override the requester's selection during manual deployment of the service request.

How Commander displays costs for ARM templates and resources

As the cost of an ARM template can't be determined until the resources are deployed, we recommend that you include an estimated Annual ARM Template Cost in the service catalog. This cost provides users with an estimate of the template's cost at request time.

Once the template is deployed, the cost of each VM in the resource group is displayed in Commander. Costs are not displayed for the resource group itself, or for other types of resources deployed as part of an ARM template.

Resource Group ownership

If a user owns a resource group, but doesn't own all of the VMs in the resource group, the unowned VMs are displayed as unsupported resources. Unsupported resources are displayed in the Resources table for the resource group, but the VM name can't be clicked to access its details, and an icon is not displayed in the Type column.