Depending DevOps pipelines on Customer’s current version

I wanted to add one more blogpost before the end of the year.  A short one.  But one I think might be interesting to some – and I just want to present it as an idea, nothing else..

The context

Some pipelines in DevOps (or GitHub for that matter) should simply not be dependent on a “latest” version of Business Central, or a “NextMinor” or “NextMajor” version for that matter.  But it should run against the version the customer is currently working in.

As an example: a DevOps pipeline that updates AppSource apps in the Customer’s environment(s).  In such a pipeline, you might want to test the combo:

  • The latest PTE(s) running in production at the customer
  • The latest AppSource version of the apps you’re about the upgrade
  • The current version of BC that is used by that customer at that very moment in time.

This combo needs to be tested (in our case: run the automated tests), and if the successful, we could go to the next stage and update the apps.

So – how do I get and use the customer’s BC version in my pipeline?

Well, you can simply do that by means of the Business Central Admin Center API – Environments (in the provided link, you can find its explanation).  

Simply introduce a step that calls this API, and save the output in variables that you can re-use in other steps.  The “applicationVersion” contains the exact version of BC your customer is working with (also the country info is in there).  If you would do this in PowerShell for Azure DevOps, you can create variables simply by a write-host.  In GitHub – no clue 🤷‍♂️.

Just FYI – ALOps simply does all of this out-of-the-box with the AdminCenterAPI step. I don’t know about AL-Go for GitHub, but I’d assume there is a way to get the info from the admin center…

When you have this info, it’s just a matter of using the variables for (from the top of my head, but not limited to):

  • Building a container with the right BC version to run your tests (very important)
  • Getting the right artifacts (from nuget or other way) (may be based on only the major-version)

Benefits

Remember – we’re in an ever-updating world where all our customers get updated automatically every month (even every day). Our pipelines need to follow.. for all customers.

We’re bothered with these so-called “waves” which potentially cause disruptions when combining them with all those versions of our apps – which means – you only want to (to take the example of above) update your apps when you really have tested everything .. for all customers.

So – this way – you can set up an automated way, that is going to test your apps against all the right versions – and the pipeline automatically gets updated when the customer was updated.

Remark: this doesn’t take away the necessity of having NextMinor/Major pipelines, obviously!

Happy Holidays!

0.00 avg. rating (0% score) - 0 votes

Permanent link to this article: https://www.waldo.be/2024/12/27/depending-devops-pipelines-on-customers-current-version/

1 pings

  1. […] Depending DevOps pipelines on Customer’s current version […]

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.