Hi,
Trying my luck here, after googling with no good finding. So I'm trying to add a step in my DevOps Build Pipeline :
So currently I have a small error (well it is a starter step, I bet there will be many more, lol) saying "##[error]The version is in an invalid format. Version: 1.1.$(Version.Revision)"
So based on the picture, I created variable before I put the steps like this :
Anyone can help what's wrong with it? I hope there is no silly mistake like typo error.
Much thanks.
In the classic pipeline add a trailing period like this
Version.MajorMinor: 1.0.
and it should work as described in the documentation here that its need minimum two periods: https://learn.microsoft.com/en-us/azure/devops/pipelines/process/expressions?view=azure-devops#version
I'll try to give it a shot....
There are three steps i need to do
this will increment the version number of the solution by one each time it is run. to increade the major or minor version, just update the library value (and Rev:r will reset to 1)
I hope this helps
Can you please describe this in a bit more detail? I am trying to accomplish this as well.
Thanks!
I have solved this problem by defining the Build Number Format (under Options) as:
$(DEVCRMMajor).$(DEVCRMMinor).$(DEVCRMPatch).$(Rev:r)
where i defined the variables in a linked variable group
Did you ever get an answer to this? I need to do this in a classic pipeline. I create a variable: with is this value: 1.0.0.$(Rev:r)
and i get this error:
##[error]The version is in an invalid format. Version: 1.0.0.$(Rev:r)
is there a solution?
Hi @cchannon
I'm sorry, but to have a better understanding on this matter may I ask more questions. So basically those setting I convert from YAML code (made by someone else, and left) and he has something like this :
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
variables:
Version.MajorMinor: 1.0
Version.Revision: $[counter(variables['Version.MajorMinor'], 0)]
VersionNumber: $(Version.MajorMinor).$(Version.Revision)
SolutionName: 'MySolutionName'
PowerAppsSPN: 'MySPN
name: $(Version.MajorMinor).$(Version.Revision)
stages:
- stage: Build
jobs:
- task: PowerPlatformSetSolutionVersion@0
displayName: 'Set solution version'
inputs:
authenticationType: 'PowerPlatformSPN'
PowerPlatformSPN: '$(PowerAppsSPN)'
SolutionName: '$(SolutionName)'
SolutionVersionNumber: '$(VersionNumber)'
May I know why this YAML works but when I create the same with classic / visual step, it has that error.
Thanks in advance,
Yeah, I see what you're trying to do here but it is a headache. Have you tried using Wael Hamze's power platform tools for devops? They add a lot of really convenient operations like a Get Solution Info (or something like that) that will let you retrieve the current version #, then all you need to do is increment the last number in that and you're all set. Much easier.
Here's an example a colleague of mine (much more talented with DevOps than I am) put together a little while back. What you're looking for is the $newVersion line near the middle:
WarrenBelz
109
Most Valuable Professional
Michael E. Gernaey
82
Super User 2025 Season 1
MS.Ragavendar
72