In our previous post on Logic App Deployment, we offered insights on deploying Azure Logic Apps in a monotonous environment. This latest blog will continue the discussion further by demonstrating the scenario of deploying a Logic App in multiple environments.
In the previous blog, we referred to the Template Parameters file, which is necessary to bring about environment specific changes, and the Template file, which is generic for all environments. However, in the case where Logic App is to be deployed in multiple environments, you must provide multiple parameter files respective to each environment.
This latest blog will discuss how multiple environments are created for Logic Apps which are the part of Microsoft Azure Cloud Services.
Creation of multiple environments
With the assumption that Environment1 has already been created, let’s look at how multiple environments can be created.
First, click on Add environment as shown in the below snippet.
That will give you two options as shown in the below screenshot.
Choose Clone Selected environment. This will clone the existing environment 1, name it environment 2, and then enable you to make respective changes. It also adds the task of Azure Resource Group deployment. For more details about task addition, please read through the first part of this blog.
The below snippet shows the two environments with the task – Azure Resource Group Deployment added to it.
In order to deploy a Azure Logic App in multiple environments, there is a need to provide multiple parameter files like Template_env1.parameters.json and Template_env2.parameters.json and so on, under Template parameters as highlighted in the above snippet.
Disadvantages of creating multiple parameter files
Creating multiple Template.parameters.json files and checking them in a source code repository can be a tedious task. Whenever a new environment comes into the picture, it is not possible to proceed with deployment unless Template.parameters.json file is created and checked-in into the source code repository. So, for each new environment, there is a need for these two tasks to be executed before the deployment takes place and creates a dependency.
Let’s look at how these disadvantages can be addressed. Template.parameters.json is responsible for bringing the environment specific changes. All the environment-related variables are kept blank and the following approaches can be taken to simplify the overall process.
Override the variables of template parameter file in – Override template Parameters. In the image depicted below, respective template parameters are highlighted and then similar changes can be made in the other environments. However, if there’s a considerable number of environment specific variables, making changes in each of the values may result in errors. Therefore, this approach is not a stable approach.
Environment1 (Dev Env)
Environment2 (QA Env)
Use Microsoft’s Visual Studio Team System to create customized Environment variables. This tool enables users to create the variable respective to specific environments in Release definition and then use it in tasks of the corresponding environment.
To begin this task, click configure variables in environment 2 as shown in the screenshot below.
That will bring up this next screenshot.
Enter the variable information and then click OK. Now, certain variables have been created (highlighted in diagram below) respective to a specific environment.
In the task “Azure Resource Group Deployment,” the paths of TemplateParameters.json and Template.json file (by clicking on the highlighted dots) must be provided, and under Override Template parameters, the tokens created under “Configure Variables” can be specified, as can be seen in the screenshot below.
However, you must ensure the variables are created under “Configure Variables” section before they are used here.
This is how the environment variables are created and called during the Logic Apps Deployment process.
To summarize, when there is need to create a new environment, it can be easily done by cloning it then setting up the environment variables. The deployment part can also be simplified by creating customized environments then calling them under respective tasks.
If your organization needs assistance in utilizing Logic Apps, Emtec can help. Contact Us today.