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.

Example: Commander support for ARM template parameters

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 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. Note: To allow users to specify a regular expression instead, select Text. See Working with Custom AttributesIn this topic:Working with Custom AttributesCreating custom attributesEditing custom attributesDeleting custom attributesApplying custom attribute valuesViewing custom attribute valuesCreating custom attributesAccess through:Configuration > Custom AttributesAvailable to:Commander Roles of Superuser and Enterprise AdminTo create a new custom attribute:On the Custom Attributes page, click Add.Tip: You can search for a custom attribute by name or description. In the Configure Custom Attribute dialog, enter a name for the custom attribute. This is the name that appears for users to select when they apply an attribute to an infrastructure element.Caution: Although you shouldn't create an attribute that's already defined in Commander or duplicates the name of a policy within Commander, you can create new custom attributes that are variations of existing attributes (for example, Cost Center Europe). See Predefined custom attributes. Optional: Enter a Description. The details that you enter here will be visible to users. From Type, select the attribute type: Text allows users to enter text values. You can allow either free-form text or enforce a specific format.Note: Text-type custom attribute values support a maximum of 4096 characters.List allows you to define values that users can select from a drop-down menu.Sublist allows you to define allowed values for each value of another custom attribute. For more information, see Creating Relationships Between Attributes Used on Forms. If you select Sublist, the Sublist Of drop-down appears. Select the custom attribute that will act as the "parent" attribute.Note: If you're editing an existing custom attribute, you can't change the attribute type. If you want to change the attribute type, you must delete the attribute and create it again with a different type.To use the custom attribute for Intelligent Placement, enable the Placement Attribute option. For more information, see Configuring Placement Attributes.Note: You can only enable the Placement Attribute option if the Type is set to List.From the Applies To menu, do one of the following:Select the virtual infrastructure element that you want the custom attribute to be available for.Note: Services includes all service types (VMs, load balancers, databases, virtual services, application stacks, auto scaling groups and Kubernetes namespaces).Select Form to create a custom attribute to capture information required only during the service request process (form attributes aren't attached to deployed services).Select All if:The infrastructure element where you want to apply a custom attribute doesn't appear in the drop-down menu (for example, a datacenter, a Kubernetes managed cluster, or a Kubernetes namespace).You want the custom attribute to be available for all infrastructure elements.Note: Custom attributes configured to be available for All Types can also be added to request forms through the Custom Attribute form element. In this case, selected values are applied to deployed services. See Service Request Form Elements.To allow a user to change the value of the attribute in the Service Portal, enable Edit in Service Portal. Notes:  Service Portal users can set a value only if their role has the required permission. If Commander is configured to import AWS, GCP, or Azure tags as Commander custom attributes, but isn't configured to export Commander custom attributes as tags, we recommend keeping this option disabled for all custom attributes created from public cloud tags. Otherwise, if a user sets an attribute value, the value will be removed during the next public cloud synchronization. By default, this option is disabled for all custom attributes created from imported tags.On the Configure Attribute page, configure the acceptable values for the attribute type you selected:Text — Select one of the following:Free Form — Allows users to enter text in any format.Specific Format— Forces users to follow a set text format.In the Regular Expression field, enter a regular expression.In the Validation Error Message field, enter a message that users will see if they enter text that doesn't conform to the regular expression.In the Entry to test against field, to test your regular expression, enter text that should pass validation. For example, if you're enforcing a project code, enter a valid project code.Tip: To avoid format conflicts, Text Type custom attributes used in Cost Models shouldn't contain regular expressions. All custom attributes used in cost models are validated as positive numbers.List — To add list values, do either of the following:Enter each value separately and click Add.Enter a comma-separated list of allowed values for the attribute and click AddThe maximum number of characters for each value is 100.Tips:  To specify a fixed cost for each value of a list type custom attribute, see Custom page.To calculate a custom cost for each value of a list type custom attribute, see Calculating Custom Costs.Sublist — For each value of the parent attribute, enter a comma-separated list of allowed values for the sublist attribute. Click a value in the list and enter values in the text field, then click Add.Click another value in the list and enter values for it, then click Add. Use the Move Up and Move Down buttons to position the allowed values.Click Finish.Editing custom attributesYou make changes to existing custom attributes, such as the attribute's name, description, its value, or the position of those values in a selectable list. However, you can't change the attribute type. If you want to change the attribute from a text to a list type or from a list to a text type, you must delete the attribute and configure it again.Access through:Configuration > Custom AttributesAvailable to:Commander Roles of Superuser and Enterprise AdminTo edit a custom attribute: On the Custom Attributes page, select a custom attribute, and click Edit.In the Configure Custom Attribute dialog, make the configuration changes required.Click Finish.Deleting custom attributesNote: A custom attribute in use by a tag compliance policy can't be deleted.Access through:Configuration > Custom AttributesAvailable to:Commander Roles of Superuser and Enterprise AdminTo delete a custom attribute: On the Custom Attributes page, select a custom attribute, and click Delete.Click Yes to confirm the deletion.If the custom attribute you're deleting has sublist attributes, the confirmation dialog provides a list of sublist attributes. When you confirm the deletion, the sublist attributes are also deleted.Applying custom attribute valuesCommander allows you to apply an unlimited number of custom attributes to services and infrastructure elements. You can manually apply custom attributes to: An infrastructure element such as a cloud account, Kubernetes cluster, datacenter, folder, datastore, host, or resource pool.A service, such as a VM, virtual service, or Kubernetes namespace.Notes:  Custom attribute values set for a parent element, such as a virtual service or application stack, aren't inherited by its children.If Commander is configured to import AWS, GCP, or Azure tags as Commander custom attributes but isn't configured to export Commander custom attributes as tags, a value set for a custom attribute created from an imported tag will be overwritten during the next public cloud synchronization. Tip: Besides manually applying custom attribute values as described here, you can also set custom attributes on a service request form, with a workflow step, during manual deployment, and through the tag compliance policy.Access through:Views > InventoryAvailable to:Administrator and All Operator Levels of Access RightsTo set a custom attribute value: Click the Infrastructure, Applications, or Storage tab.Select a service or other element in the tree or in a table, then do the following:For a selected VM, select Action > Lifecycle Management > Set Custom Attributes.For all other selected elements, select Actions > Set Custom Attributes.The Set Custom Attributes dialog displays all available attributes for the selected element.Tip: To view an attribute's description, hover over its name. Descriptions beginning with "Automatically generated from" indicate custom attributes imported from AWS, GCP, or Azure tags. See also If Commander is configured to import AWS, GCP, or Azure tags as Commander custom attributes but isn't configured to export Commander custom attributes as tags, a value set for a custom attribute created from an imported tag will be overwritten during the next public cloud synchronization. .For a list-type custom attribute, select a value from the drop-down list. For a text-type custom attribute, enter a value in any or all of the Value fields.Note: If this is a Cost custom attribute, use the Value field to enter the cost. Enter a number only, such as 500 or 67. For more information, see Custom page.Click OK. If the custom attribute has a required format, a validation error is displayed for input that doesn't match the required format.Viewing custom attribute valuesAccess through:Views > Inventory > Infrastructure, Applications, or StorageAvailable to:All Access Rights LevelsWhen you select a resource from the Inventory tree, you can view its custom attribute values in the Details section of the Summary page for the resource.Note: If you don't see any custom attributes in the Details pane, right-click anywhere in the Details pane, select Pick Properties, and select available custom attributes. For more information, see Customizing the Commander Display. 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 and do the following:
    1. In the adminPassword field, click , then select Password from the list and click OK.
    2. Beside the adminUsername field, click , then select User Name from the list and click OK.
    3. Beside the ubuntuOSVersion field, click , then select Ubuntu Version from the list 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 isn't displayed in the Type column.