In Azure Pipelines, I have enabled git tags to trigger pipelines like so:
trigger:
branches:
include:
- \'*\'
tags:
include:
- \'*\'
<
To answer your second question. If you don't mind having a separate pipeline for triggering through tags, then you can enable continuous integration and override the YAML trigger like shown below. This example will trigger builds with tags having the pattern 'test-*' (regardless of branch).
By doing this, you can just execute git describe
in your pipeline and it will output the name of the tag that triggered the build.
Here you can see the result: