Versioning when using Git, solved. GitVersion looks at your Git history and works out the semantic version of the commit being built.
It works with most branching strategies but has been designed mainly around GitFlow and GitHubFlow (pull request workflow). The calculated version numbers can then be accessed through variables such as
Azure Pipelines tasks
Azure Pipelines run examples