Rule commands

add.rule #

Add a rule to existing Aggregator instance in Azure. It requires three mandatory options.

OptionShort formDescription
--instance-iThe name of an existing Aggregator instance (Azure Function App).
--name-nThe name of the new Rule. This will be the name of the Azure Function.
--file-fRelative or absolute path to the file with the Rule code.

You can use these two options to further specify the Instance name.

OptionShort formDescription
--resourceGroup-gAzure Resource Group that contains the Aggregator instance.
--namingTemplaten/aSpecify affixes for Azure resources. This option requires defining --resourceGroup, also. This turns off automatic name generation and allow comply with enterprise requirements.

Note that the Rules sharing the same Instance use the same Runtime version.

invoke.rule #

Executes a rule locally or in an existing Aggregator instance emulating a typical message from Azure DevOps.

CAVEAT

Even when run locally the Rule connects to Azure DevOps, so remember to add the --dryrun option unless you want to write the changes back to Azure DevOps.

Common options #

These options defines the payload sent to the Rule.

OptionShort formDescription
--project-pName of existing Azure DevOps project.
--event-eEvent to emulate: can be workitem.created workitem.updated workitem.restored or workitem.deleted.
--workItemId-wValid Id of Azure DevOps Work Item.

These options defines the modes of execution.

OptionShort formDescription
--dryrun-dAggregator will not committing the changes to Azure DevOps.
--saveMode-mSets the algorithm to save the data changed by Rules back to Azure DevOps.
--impersonaten/aDo rule changes on behalf of the person triggered the rule execution. See impersonate directive, for details, requires special account privileges.

Local Execution #

OptionShort formDescription
--local-nThe Rule Engine runs locally, not on Azure.
--source-sRelative or absolute path to the file with the Rule code.

Remote Execution #

IF you do not specify the --local, the Rule Engine will run on Azure, in an existing Instance. The Rule must be already added to Instance.

OptionShort formDescription
--instance-iThe name of an existing Aggregator instance (Azure Function App).
--resourceGroup-gAzure Resource Group that contains the Aggregator instance.
--namingTemplaten/aSpecify affixes for Azure resources. This option requires defining --resourceGroup, also. This turns off automatic name generation and allow comply with enterprise requirements.
--name-nThe name of an existing Rule to run. It must be previously uploaded using add.rule.
--account-aAzure DevOps account name.

configure.rule #

Changes a rule configuration.

These parameters identify the Rule.

OptionShort formDescription
--instance-iThe name of an existing Aggregator instance (Azure Function App).
--resourceGroup-gAzure Resource Group that contains the Aggregator instance.
--namingTemplaten/aSpecify affixes for Azure resources. This option requires defining --resourceGroup, also. This turns off automatic name generation and allow comply with enterprise requirements.
--name-nThe name of an existing Rule to run. It must be previously uploaded using add.rule.

Disable a Rule #

OptionShort formDescription
--disable-dDisable the Azure Function that implements the Rule.
--enable-eEnable the Azure Function that implements the Rule.

A disabled Azure Function returns an error to Azure DevOps.

Impersonate #

OptionShort formDescription
--enableImpersonate-eEnable the rule to do the changes on behalf of the person triggered the rule execution. See impersonate directive, for details, requires special account privileges.
--disableImpersonate-dDisable impersonation.

update.rule #

Update a Rule’s code.

These parameters identify the Rule.

OptionShort formDescription
--instance-iThe name of an existing Aggregator instance (Azure Function App).
--resourceGroup-gAzure Resource Group that contains the Aggregator instance.
--namingTemplaten/aSpecify affixes for Azure resources. This option requires defining --resourceGroup, also. This turns off automatic name generation and allow comply with enterprise requirements.
--name-nThe name of an existing Rule to run. It must be previously uploaded using add.rule.

The file option points to the new code version.

OptionShort formDescription
--file-fRelative or absolute path to the file with the Rule code.

NOTE: It is up to you to manage the story of rule code. Aggregator offers no versioning.

remove.rule #

Remove a rule from existing Aggregator instance in Azure. All mappings pointing to this Rule are automatically deleted.

These parameters identify the Rule to delete.

OptionShort formDescription
--instance-iThe name of an existing Aggregator instance (Azure Function App).
--resourceGroup-gAzure Resource Group that contains the Aggregator instance.
--namingTemplaten/aSpecify affixes for Azure resources. This option requires defining --resourceGroup, also. This turns off automatic name generation and allow comply with enterprise requirements.
--name-nThe name of an existing Rule to run. It must be previously uploaded using add.rule.

The Instance (Azure Function App) will be empty if you delete the last Rule.