Deploying a Logic App Standard resource through GitHub Actions

This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Tech Community.

In this article, I am providing the step-by-step instructions on provisioning a Logic App Standard resources and deploying a simple workflow to it through GitHub actions.

 

 

1. Generate deployment credentials and store it under GitHub Secrets:

 

To create a Service Principal for GitHub to deploy resources to Azure, In the below command, replace myApp with a unique name for your service principal and provide the resource ID of the Resource Group to which you are deploying the Logic App.

 

az ad sp create-for-rbac --name {myApp} --role contributor --scopes /subscriptions/{subscription-id}/resourceGroups/{MyResourceGroup} --sdk-auth

 

Run this command in Azure CLI and copy the complete output which looks like below.

 

 

{

    "clientId": "<GUID>",

    "clientSecret": "<GUID>",

    "subscriptionId": "<GUID>",

    "tenantId": "<GUID>",

      (...)

  }

Shree_Divya_M_V_2-1625578153735.png

 

 

 

In the GitHub repository, go to Settings > Secrets > New secret.

Name the secret as AZURE_CREDENTIALS and paste the output of the above CLI command.

 

Shree_Divya_M_V_0-1625574290590.png

 

 

Deploy Resource Manager templates by using GitHub Actions - Azure Resource Manager | Microsoft Docs

 

 

 

 

2. Provisioning Logic App with all the dependent resources.

 

1.     Create ARM templates to deploy the Logic app and all the dependent resources:

 

Please find below the sample template and param file. This template would help to create a Storage Account, App service plan, App insight and a Logic App under the specified resource group. Please modify the parameter value as per your requirement and place these files in the GitHub repository.

 

https://github.com/ShreeDivyaMV/LogicAppGithub/blob/7e968a3676725ad43d5ddb2fed34f3a624919679/ARMTemplates/LA_Standard_Basic.json

https://github.com/ShreeDivyaMV/LogicAppGithub/blob/7e968a3676725ad43d5ddb2fed34f3a624919679/ARMTemplates/LA_Standard_Basic_Param.json

This example doesn’t have any API connections. If any API connections, add those to the ARM template as well. Please refer the link in the reference section for more examples.

 

2.     Create GitHub action to deploy the Logic App:

 

Go to Actions tab in the repository, click on ‘new workflow’

Shree_Divya_M_V_1-1625574290593.png

You can refer the below YAML file for the template. You might have to modify the path and name of your ARM templates. Save this file and go back to Actions tab.

https://github.com/ShreeDivyaMV/LogicAppGithub/blob/7e968a3676725ad43d5ddb2fed34f3a624919679/.github/workflows/DeployLogicApp.yml

 

Shree_Divya_M_V_3-1625578192340.png

 

3.     Run the GitHub action:

 

Select the action “create a Logic App” and provide the Subscription ID and Resource group Name and run the action.

This would create the Logic app based on the ARM template provided.

Shree_Divya_M_V_2-1625574290598.png

 

 

 

3. Deploy the workflows to the Logic App:

 

Copy your Logic App project folder to GitHub repository.

 

Shree_Divya_M_V_0-1625671279567.png

 

 

 

Go to Actions tab and create another action to deploy the workflow to the earlier provisioned Logic App.

You can refer the below YAML file for the sample.

https://github.com/ShreeDivyaMV/LgoicAppGithub/blob/44ac6e908b4818bacccab484a33075e76949e20f/.github/workflows/DeployWorkflow.yml

 

You can run this workflow by providing the Resource Group name and Logic App Name

 

Shree_Divya_M_V_4-1625574290610.png

 

 

 

References:

 

GitHub Repository of the above example- ShreeDivyaMV/LogicAppGithub

GitHub Repository for more examples on Logic App Standard- Azure/logicapps: Azure Logic Apps labs, samples, and tools (github.com)

More info on Logic App Standard: Overview - Single-tenant Azure Logic Apps - Azure Logic Apps | Microsoft Docs

Leave a Reply

Your email address will not be published. Required fields are marked *

*

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