Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

DevOps : Power Platform Set Solution Version

(0) ShareShare
ReportReport
Posted on by 945

Hi,

 

Trying my luck here, after googling with no good finding. So I'm trying to add a step in my DevOps Build Pipeline : 

Axal_0-1646830149289.png

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 :

 

Axal_1-1646830669551.png

Anyone can help what's wrong with it? I hope there is no silly mistake like typo error.

Much thanks.

 

 

  • aofosu Profile Picture
    103 on at
    Re: DevOps : Power Platform Set Solution Version

    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

  • moshe raab Profile Picture
    80 on at
    Re: DevOps : Power Platform Set Solution Version

    I'll try to give it a shot....

    There are three steps i need to do

    1. define variables, either in a library that could be used in many pipelines, or under the variable tab in the pipeline itself. the variables are called
      1. DEVCRMMajor = 1
      2. DEVCRMMinor = 0
      3. DEVCRMPatch = 0
    2. Under the Options tab in the pipeline and populate the Build Number Format Field as follows (remember that to use a variable it needs to be referenced as $(var-name)
      1. $(DEVCRMMajor).$(DEVCRMMinor).$(DEVCRMPatch).$(Rev:r)
      2. using the varialbe as defined it will produce a version number starting with  1.0.0.1 as the Rev:r value is an incremental counter and add add 1 each time
    3. IN the Power Platform Set Solution Version task set the Solution Version Number value to:
      1. $(Build.BuildNumber)

    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

     

  • Shoeb Memon Profile Picture
    6 on at
    Re: DevOps : Power Platform Set Solution Version

    Can you please describe this in a bit more detail? I am trying to accomplish this as well.

     

    Thanks!

  • moshe raab Profile Picture
    80 on at
    Re: DevOps : Power Platform Set Solution Version

    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

  • moshe raab Profile Picture
    80 on at
    Re: DevOps : Power Platform Set Solution Version

    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?

  • Axal Profile Picture
    945 on at
    Re: DevOps : Power Platform Set Solution Version

    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,

     

     

     

     

  • cchannon Profile Picture
    4,702 Super User 2025 Season 1 on at
    Re: DevOps : Power Platform Set Solution Version

    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:

     

    cchannon_0-1647005685659.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 72

Overall leaderboard