Skip to content

OctopusInvalidVariableNameCheck

Mark Harrison edited this page Feb 27, 2025 · 1 revision

OctoLintInvalidVariableNames returns a warning if any project variables are named incorrectly, according to a specified regular expression.

Recommendation

Without established naming conventions, variable name collisions are possible. A common example is when a project and a variable set have the same variable name scoped to the same environment. When a name collision occurs, Octopus Deploy will do its best to pick the "right one" using an algorithm. But sometimes, the variables are scoped equally. If this occurs, Octopus will choose project-defined variables ahead of library-defined ones.

The recommendation is to avoid name collisions in the first place by following these naming standards.

Project variables

Project.[Component].[Name] - for example, Project.Database.UserName.

Tenant variables

[ProjectName].[Component].[Name] - for example, OctoPetShopWebUI.URL.Port.

Step Templates

[TemplateShortName].[Component].[Name] - for example, SlackNotification.Message.Body.

Library Variable Sets

Library.[LibrarySetName].[Component].[Name] - for example, Library.Notification.Slack.Message.

Note: These naming conventions only apply to variables used for a deployment or runbook run. Variables used for configuration file replacement have a specific naming convention to follow. The above naming convention makes it easier to distinguish between the two.

Remediation

Consider changing the variable names to valid ones that match your convention.

Clone this wiki locally