Synchronizing Azure Tags and vCommander Metadata

Access through:

Views menu > Operational or Deployed

Available to:

vCommander Roles of Superuser and Enterprise Admin

You can synchronize Azure tags, such as Cost Center, Business Unit, Product, Tier or Version, with vCommander custom attributes and other metadata. Like Azure, vCommander uses key-value pairs to allow you to assign metadata to services and cloud infrastructure. Once assigned, this metadata persists throughout a service's lifecycle, enabling administrators to understand the purpose of each service. Tag synchronization provides:

  • better targeting of power schedule recommendations — automatically set one power schedule for VMs with the label "dev" and another for those labeled "prod"
  • advanced search and reporting — report on costs by label, such as application ID or environment, so you can get a handle on costs per application, or for production vs. development environments
  • workflow conditions based on label values — automatically select the right Chef recipe or Ansible playbook to run during post-provisioning, depending on compliance requirements

You can configure tag synchronization when you add an Azure managed system, or at a later time. You can:

  • import tags as custom attributes
  • export custom attributes as tags
  • export the following vCommander metadata as tags:
    • primary owner name
    • primary owner login
    • primary owner email address
    • assigned organization
    • expiry date

vCommander supports synchronization of tags for resource groups, storage accounts, VM instances and VM images.

If you don't want to sync all Azure tags, custom attributes and other vCommander metadata, you can specify which to exclude. Tags prefixed with "Microsoft:", "Azure:", "Windows:" and "vcmdr:" are automatically excluded from import. Form-type custom attributes are automatically excluded from export.

When vCommander finds an Azure tag without an existing matching custom attribute, the tag is imported as a free-form text-type custom attribute that applies to services. By default, Service Portal users can't set values for these custom attributes. Here's an example of a custom attribute created from an imported Azure tag. Notice the description.

Configure Attribute dialog

Custom attribute, vCommander metadata and tag values are updated as part of the automatic Azure synchronization task, as well as when you manually synchronize the inventory. To prevent timing issues, during synchronization, tag values are imported from Azure before custom attribute values are exported to Azure. When a custom attribute value is applied, the value is exported to Azure immediately. New tag values, however, are imported only during automatic or manual synchronization of the Azure managed system.

How custom attributes and Azure tags are matched

When importing Azure tags, if vCommander finds an existing custom attribute with the same name, it automatically populates the value for VMs with that tag assignment. Note that a match will only be made if the existing custom attribute is configured to apply to "All Types" or "Services". In the case of a matching list-type custom attribute, in order for a value to be updated, the value in Azure must match one of the preconfigured values for the custom attribute.

Azure tags aren't case sensitive. When importing Azure tags and values, vCommander matches Azure tag keys with custom attribute names, and tag values with configured list-type custom attribute values, regardless of case.

How ownership, organizational assignment and expiry information are exported

When you configure vCommander to export custom attributes as Azure tags, information about the service's primary owner, assigned organization and expiry is also exported as Azure tags with a "vcmdr:" prefix. This is a one-way synchronization; Azure tags with the "vcmdr:" prefix are automatically excluded from import.

This is what the exported vCommander metadata looks like in the Azure console:

arm-tag-console

If you don't want to export some or all of this metadata, you can exclude it from import, as explained below. The following table provides details on what information is exported.

Export of vCommander metadata to Azure tags

Metadata

Possible values

Azure tag

Details

Expiry Date

Date, of the form yyyy/MM/dd

Never Expires

No Expiry Date Set

vcmdr:ExpiryDate

If no expiry information is assigned, the value is No Expiry Date Set.

Organization

Organization name

vcmdr:Organization

If no organization is assigned, the value is an empty string.

Primary Owner Email

Email address

vcmdr:PrimaryOwnerEmail

If no email address is assigned, the value is an empty string.

Primary Owner Login

Login ID

vcmdr:PrimaryOwnerLogin

If no email address is assigned, the value is an empty string.

Primary Owner Name

FirstName LastName

vcmdr:PrimaryOwnerName

If no email address is assigned, the value is an empty string.

Best practices

  • If you use labels to store expiry and ownership information, exclude them from import. vCommander has distinct properties to store this information. If you import a label used for expiry or ownership, vCommander will create a custom attribute to store this information, and users may be confused by the duplication.
  • If vCommander is configured to import tags as custom attributes, but isn't configured to export vCommander custom attributes as tags, we recommend keeping the Edit in Service Portal option disabled for all custom attributes created from tags. Otherwise, if a user sets an attribute value, the value will be removed during the next synchronization with Azure. By default, this option is disabled for all custom attributes created from imported tags.
  • If you have an Azure tag that serves the same purpose as an existing vCommander custom attribute, make sure that the tag key and the custom attribute key are identical, and make sure that tag values match the preconfigured custom attribute values.

Synchronizing Azure tags and vCommander metadata

This procedure assumes you're configuring synchronization for an existing Azure managed system. The steps are similar when you add an Azure account to vCommander.

  1. In the Operational or Deployed view, select an Azure managed system in the tree.
  2. In the Commands pane, click Sync Tags and Custom Attributes.
  3. The Synchronize Azure Tags and vCommander Custom Attributes dialog appears.

  4. Enable the options Import Azure Tags as vCommander Custom Attributes and/or Export vCommander Custom Attributes as Azure Tags as required.
  5. To exclude certain Azure tags and custom attributes from synchronization, enter them as a comma-separated list in the Excluded Tags/Custom Attributes field.

    You can enter up to 5000 characters in this field. Azure tag names are not case-sensitive. Tag values are case-sensitive.

    Tags prefixed with "Microsoft:", "Azure:", "Windows:", and "vcmdr:" are automatically excluded from import. Form-type custom attributes are automatically excluded from export.

  6. Click OK.

    vCommander imports tag values from Azure and then exports custom attribute and metadata values to Azure.

    Once you've configured synchronization, when a custom attribute value is applied, the value is exported to Azure immediately. New tag values, however, are imported only during automatic or manual synchronization of the Azure managed system.

Excluding specific tags and metadata from synchronization

If you've configured synchronization and you decide you don't want to import particular Azure tags or export particular custom attributes, you can exclude them.

Tags prefixed with "Microsoft:", "Azure:", "Windows:", and "vcmdr:" are automatically excluded from import. Form-type custom attributes are automatically excluded from export.

  1. In the Operational or Deployed view, select an Azure managed system in the tree.
  2. In the Commands pane, click Sync Tags and Custom Attributes.
  3. In the Synchronize Azure Tags and vCommander Custom Attributes dialog, enter tags, custom attributes and metadata labels as a comma-separated list in the Excluded Tags/Custom Attributes field.

    You can enter up to 5000 characters in this field. Azure tags are not case-sensitive. Tag values are case sensitive.

    vCommander metadata labels have the following format: vcmdr:<metadata>

    For example: vcmdr:ExpiryDate

    See How ownership, organizational assignment and expiry information are exported above for the complete list of metadata labels.

  4. Click OK.

    vCommander will now no longer import this tag during synchronization with Azure.

    If an Azure tag was previously imported, excluding it doesn't automatically delete the custom attribute. You may want to delete the custom attribute manually. Likewise, if a custom attribute was previously exported, excluding it doesn't automatically delete the Azure tag. You may want to delete the tag manually; consult the Azure documentation to learn how.

Synchronizing a custom attribute or tag that had been excluded

If you had previously excluded a custom attribute or tag that you now want to synchronize, follow this procedure.

  1. In the Operational or Deployed view, select the Azure managed system in the tree.
  2. In the Commands pane, click Sync Tags and Custom Attributes.
  3. In the Synchronize Azure Tags and vCommander Custom Attributes dialog, remove the custom attribute or tag from the list and click OK.

    vCommander will now include this label or custom attribute in future synchronizations.