Aggregator 3Aggregator is a Rule Interpreter for Work Items events, allowing dynamic calculation of field values and more. It is the successor to renowned TFS Aggregator. Aggregator 3.x supports two scenarios:
The latter permits replacing the Server Plugin after migrating the Rule code.
Major features
RequirementsTo write a Rule is required some basic knowledge of C# language and Azure Boards. In addition you need:
CLI & AzureThe CLI scenario has two additional requirements:
DockerThe Docker scenario requires:
How the CLI works with Azure FunctionsAs the name implies, this is a command line tool: you download the latest aggregator-cli*.zip appropriate for your platform from GitHub releases and unzip it on your client machine. Read more below in the Usage section. Through the CLI you create one or more Azure Functions in your Subscription. The Functions use a library named Aggregator Runtime to run your Rules. A Rule is code that reacts to one or more Azure DevOps event; currently, the only language for writing rules is C#. The CLI automatically checks GitHub Releases to ensure that you use the more recent version of Aggregator Runtime available. To avoid automatic upgrades, specify the Runtime version or point to a specific Runtime package file, using an After you setup the Rules in Azure, you must add at least one Mapping. A mapping is an Azure DevOps Service Hook that send a message to the Azure Function when a specific event occurs. Currently we support only Work Item events. When triggered, the Azure DevOps Service Hook invokes a single Aggregator Rule i.e. the Azure Function hosting the Rule code. Azure DevOps saves the Azure Function Key in the Service Hook configuration. You can deploy the same Rule in different Instances, map the same Azure DevOps event to many Rules or map multiple events to the same Rule: you choose the best way to organize your code. CLI AuthenticationYou must instruct Aggregator which credential to use.
To do this, run the To create the credentials, you need an Azure Service Principal and a Azure DevOps Personal Access Token. Full details in the Setup section. Aggregator stores the logon credentials locally and expires them after 2 hours. The PAT is also stored in the Azure Function settings: whoever has access to the Resource Group can read it! The Service Principal must have Contributor permission to the Azure Subscription or, in alternative, pre-create the Resource Group in Azure and give the service account Contributor permission to the Resource Group.
If you go this route, remember add the For Docker only Azure DevOps logon is required. CLI UsageDownload and unzip the latest CLI.zip file from Releases.
It requires .Net Core 3.1 installed on the machine.
To run Aggregator run CLI VerbsThere are about 20 commands described in detail at Commands. They can be grouped in a few categories:
Most commands manage Azure Function, but a few can be used in the Docker scenario. We collected some usage scenarios at Command Examples. How the Docker image worksPull the latest image from Docker Hub. It works on Linux and Windows. Start a container with the image, setting configuration through environment variables. The Rules are simply files on a Docker volume that the container uses. The container must expose a port reachable from your Azure DevOps instance, either Server or Service. Add one or web hook to Azure DevOps using the container URL. Use one Aggregator API Key to authenticate the call. You may use the CLI to add these mappings. More details at Docker configuration Rule languageCurrently we offer only C# as the language to write Rules. The Rules can access a few objects:
See Rule Language for a list of objects and properties to use. For examples see Rule Examples. MaintenanceAggregator stores the PAT in the Azure Function configuration. Before the PAT expire you should refresh it from Azure DevOps or save a new PAT using the Read Production Configuration and Administration for recommendations on running Aggregator in production. TroubleshootingUse the Application Insight instance that was created aside the Azure Function. ContributingDetails on building your own version and testing are in the Contribute section. |