I need a counter, that goes up in every time you do a release, per each stage. There's counter support in the build pipeline(https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=vsts&tabs=yaml%2Cbatch#counters) but there's nothing that I'm aware of for the release pipeline.
Somewhat of a workaround is parsing out the release number from the release name, and using that one as the counter. But parsing the string is ugly, and it increments only per new release, not per specific stage(e.g. I want there to be separate counter for "dev" and "prod", and if in the same release, you deploy it again, I want the counter to go up).
Is there something I'm missing? I'm thinking of creating my own pipeline task that does it, but I'm not exactly sure of the best way to hold state between releases. Is there some kind of pattern here? Currently I'm thinking of the task simply creating a configuration file in a a specified storage account to store the state and increment it between releases.