21

Automating Deployment of Azure Logic App Using Azure DevOps

 3 years ago
source link: https://waelkdouh.medium.com/automating-deployment-of-azure-logic-app-using-azure-devops-c83d2161097f
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Automating Deployment of Azure Logic App Using Azure DevOps

This is part 2 of a 2 part series where we discuss automating the deployment of an APIM changes as well as automating the Logic Apps deployment which are utilized as backends for the APIM instance.

Part 1 — Automating Deployment of Azure API Management Changes Using Azure DevOps

Part 2 — Automating Deployment of Azure Logic App Using Azure DevOps

In part 1 we discussed in details how to automate deployment of Azure API Management APIs and their configurations from one environment to another. In this post we switch our focus to building CI/CD pipelines for the Logic Apps that serve as backend APIs for the APIM instance. As a reminder Figure 1 and Figure 2 below show both the source and target environments we are dealing with in our scenario. Unlike the case with the APIM the assumption here is that the Maintenance environment doesn’t have any Logic Apps and would have to be created as part of the deployment. Figure 2 below shows the end result after the deployment is completed.

Figure 1: Sandbox Environment (Source Environment)
1*KLOROkeWbgQpWdrKajMK3Q.png
Figure 2: Maintenance Environment (Target Environment)

When building the CI/CD pipeline for the Logic Apps we had to take couple things into consideration:

  • The Logic APPs targets a different SQL server depending on the environment.
  • Each SQL Server information is maintained by a connector.
  • The connector needs to be deployed in the target environment before the Logic App can be deployed.
  • We assume that the SQL database servers are already deployed in both environments.

We start by downloading the Logic App templates as well as the associated connector template from the Azure portal as shown in Figure 1 and Figure 2 respectively.

1*ZA2Ox5u0moFSKRBfJH16mA.png?q=20
automating-deployment-of-azure-logic-app-using-azure-devops-c83d2161097f
Figure 1: Downloading the Logic app templates from the Azure Portal
1*vRyMOV7HnVrFfQxz4l9PZg.png?q=20
automating-deployment-of-azure-logic-app-using-azure-devops-c83d2161097f
Figure 2: Downloading the Logic app Connector templates from the Azure Portal

Figure 3 shows the structure of our Sandbox repository which hosts the templates for the Logic App and its associated connector.

1*XL4XxTnMZOBpUMiLBvbLAQ.png?q=20
automating-deployment-of-azure-logic-app-using-azure-devops-c83d2161097f
Figure 3: Logic App and Connector Templates hosted in the Sandbox Repo

Figure 4 and Figure 5 show the CI and CD pipelines for the Logic App along with its associated connector. Here both the Sandbox and Maintenance environments have the same CI/CD pipelines and only differ by the templates parameters overrides. Figure 6 shows the template parameters for the Logic app and Figure 7 shows the template parameters for the associated connector.

1*c7frfe3Mfyqm_yB4-5wXCg.png?q=20
automating-deployment-of-azure-logic-app-using-azure-devops-c83d2161097f
Figure 4: Logic App CI pipeline
1*IAavkGhbqGy_wJkMpxAbWw.png?q=20
automating-deployment-of-azure-logic-app-using-azure-devops-c83d2161097f
Figure 5: Logic App CD pipeline
1*ShnA_fIjzocQpwpkAW6Hmg.png?q=20
automating-deployment-of-azure-logic-app-using-azure-devops-c83d2161097f
Figure 6: Logic App parameters
1*17gzBF6xA9M9SO2yo51-FQ.png?q=20
automating-deployment-of-azure-logic-app-using-azure-devops-c83d2161097f
Figure 7: Logic App Connector parameters

That is all that is required as its a straightforward affair. Figure 8 and Figure 9 show the final CI/CD for the complete solution (both APIM and Logic Apps).

1*wsC55vnxqiwOH8BEu-5D2Q.png?q=20
automating-deployment-of-azure-logic-app-using-azure-devops-c83d2161097f
Figure 8: Different CI pipelines for APIM and Logic Apps
1*giOoIfqy6EReO2ERzjq1tg.png?q=20
automating-deployment-of-azure-logic-app-using-azure-devops-c83d2161097f
Figure 9: Different C pipelines for APIM and Logic Apps

Figure 10 shows the final repo structure.

1*t7FtKKvLHqpg_x18fQLilw.png?q=20
automating-deployment-of-azure-logic-app-using-azure-devops-c83d2161097f
Figure 10: Repository hosting both the APIM and Logic Apps Code

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK