cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sperry1625
Solution Supplier
Solution Supplier

Solution Version Numbering with Azure DevOps

By default, when manually exporting a solution from an environment it will auto increment the end of the version number.  So, if you are starting with 1.0.0.0, an export will propose, or auto inclement that to 1.0.0.1.

Our versioning is a little different, we increment the 1.0.0.0 to 1.0.1.0.

 

So, my question is, how do I fetch the current version number during a build process and increment the number and set that version number in the solution?

 

I have not found any of the content on the internet helpful in solving this problem.

 

Thanks all!

Regards,

-S

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

3 REPLIES 3
eleung83
Resolver II
Resolver II

By "Build process" I'm assuming you would be referring to something like ADO pipelines and releases?

 

If that is correct then there's 2 tasks that you can use to both get the current solution details, and also to set the solution version of any solution:

 

Task to get the details of a solution: 
https://marketplace.visualstudio.com/items?itemName=WaelHamze.xrm-ci-framework-build-tasks (Look at the "Get Solution (preview)" task)

 

Task to set the version of a solution:
https://docs.microsoft.com/en-us/power-platform/alm/devops-build-tool-tasks (Look at the Power Platform Set Solution Version task)

 

This is only a partial solution.  I can get the version number, but how do I manipulate the version number before I set it. I would assume I would need to do substring manipulations. I do not know how, or where, I would do that.

 

Also, is there a way to put conditionals in a release pipeline? Ex. If I pull a release, and its version number is the same as what is already deployed, stop the pipeline.

 

Thank you.

Regards,

-S

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

eleung83
Resolver II
Resolver II

You can use powershell scripts to do whatever you want with the values that get extracted as part of those tasks. There's already a powershell task you can add which can execute your powershell scripts inline or execute powershell files. And you should be able to access the pipeline variables with the powershell script.

 

Essentially the Powershell script allows you do anything with the pipeline variables and do whatever validation/manipulation/error blocking functionality that you need to do, but there is a bit of a learning curve (googling) with powershell as it's pretty much a black box. The nice thing is that it does allow you to mix C# code statements inline with the powershell script

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (3,857)