Create a dictionary

Placeholders are configurable entries in your application that will be set to an actual value at deployment time. This makes the deployment package environment-independent and reusable. At deployment time, you can provide values for placeholders manually or they can be resolved from dictionaries that are assigned to the target environment.

Dictionaries are sets of key-value pairs that store environment-specific information such as file paths and user names and sensitive data such as passwords. Dictionaries are designed to store small pieces of data. XL Deploy does not limit the length of dictionary values, but the recommended maximum number of characters is 100. Longer values will degrade performance.

You can assign dictionaries to environments. If the same entry exists in multiple dictionaries, XL Deploy uses the first entry that it finds. Ensure that you use the correct order for dictionaries in an environment.

A dictionary can contain both plain-text and encrypted entries. Use dictionaries for plain-text entries and encrypted dictionaries for sensitive information.

Create a dictionary

To create a dictionary:

  1. In the top bar, click Explorer.
  2. Hover over Environments, click Menu button, and select New > Dictionary.
  3. In the Name field, enter a name for the dictionary.
  4. In the Common section, in the Entries field, click Add new row.
  5. Under Key, enter the placeholder without delimiters {{ and }} by default.
  6. Under Value, enter the corresponding value.
  7. Repeat this process for each plain-text entry. Note: To remove an entry, click cross icon against the entry.
  8. In the Encrypted Entries section, click Add new row.
  9. Under Key, enter the placeholder without delimiters.
  10. Under Value, enter the corresponding value. Note: Encrypted entry values are always masked with an asterisks (*).
  11. Repeat this process for each encrypted entry. Note: To remove an entry, click cross icon against the entry.
  12. Click Save.

Tip: You can create a dictionary while creating a new environment.

Create an encrypted dictionary

To create an encrypted dictionary:

  1. In the top bar, click Explorer.
  2. Hover over Environments, click Menu button, and select New > Encrypted dictionary.
  3. In the Name field, enter a name for the encrypted dictionary.
  4. In the Common section, in the Entries field, click Add new row.
  5. Under Key, enter the placeholder without delimiters {{ and }} by default.
  6. Under Value, enter the corresponding value.
  7. Repeat this process for each plain-text entry. Note: To remove an entry, click cross icon against the entry.
  8. Click Save to save the dictionary.

Assign a dictionary to an environment

To assign a dictionary to an environment:

  1. In the top bar, click Explorer.
  2. Expand Environments and double-click the desired environment.
  3. In the Dictionaries field, select a dictionary from the dropdown list.
  4. Click Save to save the environment.

Multiple dictionaries can be assigned to an environment. Dictionaries are evaluated in order. XL Deploy resolves each placeholder using the first value that it finds. For more information, see Using placeholders in XL Deploy.

Restrict a dictionary to containers or applications

You can restrict a dictionary to ensure that XL Deploy applies it only to specific containers, specific applications, or both. To restrict a dictionary:

  1. In the top bar, click Explorer.
  2. Expand Environments and double-click the desired dictionary.
  3. Under the Restrictions section, click in the Restrict to containers field and select one or more container from the dropdown list.
  4. Click in the Restrict to applications field, and from the dropdown list, select one or more applications.
  5. Click Save.

Note: An unrestricted dictionary cannot refer to entries in a restricted dictionary.

Troubleshooting restricted dictionary

When you restrict a dictionary, it affects how XL Deploy resolves placeholders at deployment time.

For example, if you have the following setup:

  • A dictionary called DICT1 has an entry with the key key1. DICT1 is restricted to a container called CONT1.
  • A dictionary called DICT2 has an entry with the key key2 and value key1.
  • An environment has CONT1 as a member. DICT1 and DICT2 are both assigned to this environment.
  • An application called APP1 has a deployment package that contains a file.File CI. The artifact attached to the CI contains the placeholder {{key2}}.

When you deploy the package to the environment, mapping of the CI will fail with the error Cannot expand placeholder {{key1}} because it references an unknown key key1.

This occurs because, when XL Deploy resolves placeholders from a dictionary, it requires that all keys in the dictionary are resolved. In this scenario, XL Deploy tries to resolve {{key2}} with the value from key1, but key1 is missing because DICT1 is restricted to CONT1. The restriction means that DICT1 is not available to APP1.

Suggested workarounds:

  • Restrict DICT1 to APP1 (in addition to CONT1).
  • Add key1 to DICT2 and assign it a “dummy” value (so the mapping will succeed).
  • Create another unrestricted dictionary that will provide a default value for key1.