Welcome again to another Logic Apps Best practices, Tips, and Tricks. In my previous blog posts, I talked about some of the most essential best practices you should have while working with the Azure Logic App:
And some tips and tricks:
- #4 Using Scopes
- #5 Delete comments
- #6 Error handling configure run after settings
- #7 Learn from failures
- #8 Expressions nightmare
- #9 Control your connectors (API connections)
- #10 Fix connectors (or API connections)
- #11 Connectors naming convention
- #12 Choose your developer tools properly
- #13 Logic App (Standard) vs (Consumption)
- #14 Implement good governance policies
- #15 get the error message
Today I’m going to speak about another critical best practice, Tips and Tricks that you need to know, especially when you are developing your Logic Apps Consumption directly on the Azure Portal: If we are developing in the Azure Portal, can we roll back to a previous version of an Azure Logic App Consumption?
#16 roll back to a previous version of an Azure Logic App Consumption – Using Azure Portal
Suppose we are using Visual Studio to develop our Logic App Consumptions – something that you should use in real-case scenarios, especially if you will be working with multiple environments. Then there isn’t much to say about rolling back to a previous version of a Logic App. Of course, once again, you should have the basic best practices while developing any solutions:
- Add your solution to a source code controller like DevOps, GitHub, or TFS;
- Regularly Commit Changes;
- Always Ensure That the Repository is Up to Date;
- Create Good Detailed Commit Messages;
- Make Sure Every Commit Is Traceable;
- Follow Branching Best Practices;
Then, and by using source control, you can check out a previous version of the Logic App Consumption and deploy it again to our Azure resource.
Here, the main question is: if I don’t have Visual Studio and develop my Logic App Consumptions directly on the Azure Portal? Can I roll back to a previous version?
And the answer is, yes, you can! Maybe it is not as straightforward as using Visual Studio and Source Control, but you can perform that task directly on the Azure Portal.
You can use the Azure portal for version control of your logic apps. You can find your logic app’s version history and promote previous versions. Follow the below steps to roll back the last version of your Logic app:
- Step 1: Access your Logic App Consumption on the Azure Portal, and inside the Logic App page, select from the left menu option Version under the Development Tools section from the left tree menu.
- Step 2: Now, we’ll be presented with the list of all previous versions – a version here means that a new version will be created each time you save your Logic App in the Azure Portal.
- We can now select one and validate if that is the correct version we want to roll back by seeing all the configuration/code. If we choose a version inside the Azure portal, the Logic App designer will load, showing that previous version. We could click through these various actions inside our business process and see what some of the differences might be.
- Step 3: If we want to promote that particular version to be the current version, we can click the Promote button.
That would be the current version of the Logic App that’s running. But, there is always a but! Not everything is perfect, unfortunately.
I consider myself a simple person and very easy to please. However, in terms of work-related, I desire nothing more, nothing less than perfection. So in terms of features and functionalities, my mind works like a “hacker” trying to find ways to break something. And unfortunately, I found an astronomical bug on the out-of-the-box Versions feature available on Logic App Consumption. In reality, I found this bug unintentional while trying to prepare one of my Logic App Best practices, Tips, and Tricks sessions while simultaneously cleaning up and organizing my Azure resources in my subscription.
When you move a Logic App Consumption resource to another resource group, a regular task, especially for Azure administrators that organize all the Azure resources properly, you will lose all the version history! Don’t get me wrong, you will continue to see all the versions you made and the date and time when they were published (ala saved on the Azure Portal), but this is the big but. You will not be able to see the business process then nor promote it to production. The version history will be broken with the error:
- The Resource ‘Microsoft.Logic/workflows/<name-of-the-Logic-App>’ under resource group ‘<resource-group-name>’ was not found. For more details, please go to https://aka.ms/ARMResourceNotFoundFix (Code: ResourceNotFound)
- Yes, Logic App Consumption provides a built-in source control called Versions.
- Yes, it is possible to roll back to a previous version of our Logic App Consumption
- But be aware that if you move your Logic App Consumptions to a different resource, you will break the versioning feature, and you no longer be able to roll back to previous versions.
Stay tuned for the following Logic App Best practices, Tips, and Tricks.