In this article I am going to explain how to develop Azure Logic Apps with parameter for different-different environment. And how to do Azure DevOps for Logic Apps.
If you have below questions in your mind then this
article will be very helpful for you.
- How
to create Azure Logic Apps for different environment ie: Dev, QA & Prod
- How to deploy Azure Logic Apps using Azure DevOps
- How to user Azure Repos git
- How to develop Azure Logic Apps using Visual Studio
I have 2 part article.
#
First Part:
Develop a Logic App with parameter file for Dev, QA and
Production environment.
#
Second Part:
Deploy this Azure Logic Apps using Azure DevOps
I am
using below tools and services in this article.
1. Visual Studio 2017 with Logic App Tools
2. Azure DevOps (CI & CD Pipelines)
In this Azure Logic Apps, I am going to design a
recurrence and create a Blob in respective environment Storage Account.

Image 1.
#First
Part:
Create
Azure Logic Apps using Visual Studio 2017

Image 2.

Image 3.
It will add below files in your solution:

Image 4.
Now I did rename parameter file added more parameter file
as per our environments.

Image 5.
Now right click on LogicApp.json and open with Logic App
designer.

Image 6.
Now design your Logic App as per your business need.

Image 7.

Image 8.
LogicApp.json:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"logicAppName": {
"type": "string",
"minLength": 1,
"maxLength": 80,
"metadata": {
"description": "Name of the Logic App."
}
},
"logicAppLocation": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"allowedValues": [
"[resourceGroup().location]",
"eastasia",
"southeastasia",
"centralus",
"eastus",
"eastus2",
"westus",
"northcentralus",
"southcentralus",
"northeurope",
"westeurope",
"japanwest",
"japaneast",
"brazilsouth",
"australiaeast",
"australiasoutheast",
"southindia",
"centralindia",
"westindia",
"canadacentral",
"canadaeast",
"uksouth",
"ukwest",
"westcentralus",
"westus2",
"koreacentral",
"koreasouth",
"francecentral",
"francesouth",
"southafricanorth",
"southafricawest"
],
"metadata": {
"description": "Location of the Logic
App."
}
},
"azureblob_1_Connection_Name": {
"type": "string",
"defaultValue": "azureblob"
},
"azureblob_1_Connection_DisplayName": {
"type": "string",
"defaultValue": "Connection_DEV_SA"
},
"azureblob_1_accountName": {
"type": "string",
"metadata": {
"description": "Name of the storage account
the connector should use."
},
"defaultValue": "sa4devenv"
},
"azureblob_1_accessKey": {
"type": "securestring",
"metadata": {
"description": "Specify a valid
primary/secondary storage account access key."
},
"defaultValue": "sdfghjklwertyuiocvbjrtg345678TEST=="
}
},
"variables": {},
"resources": [
{
"name": "[parameters('logicAppName')]",
"type": "Microsoft.Logic/workflows",
"location": "[parameters('logicAppLocation')]",
"tags": {
"displayName": "LogicApp"
},
"apiVersion": "2016-06-01",
"properties": {
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Create_blob": {
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['azureblob']['connectionId']"
}
},
"method": "post",
"body": "Test Blob @{utcNow()}",
"path": "/datasets/default/files",
"queries": {
"folderPath": "/destination",
"name": "RBlob",
"queryParametersSingleEncoded": true
}
},
"runAfter":
{},
"runtimeConfiguration": {
"contentTransfer": {
"transferMode": "Chunked"
}
}
}
},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"Recurrence": {
"type": "Recurrence",
"recurrence": {
"frequency": "Minute",
"interval": 3
}
}
},
"contentVersion": "1.0.0.0",
"outputs":
{}
},
"parameters": {
"$connections": {
"value": {
"azureblob": {
"id": "[concat(subscription().id,
'/providers/Microsoft.Web/locations/', parameters('logicAppLocation'),
'/managedApis/', 'azureblob')]",
"connectionId": "[resourceId('Microsoft.Web/connections',
parameters('azureblob_1_Connection_Name'))]",
"connectionName": "[parameters('azureblob_1_Connection_Name')]"
}
}
}
}
},
"dependsOn": [
"[resourceId('Microsoft.Web/connections',
parameters('azureblob_1_Connection_Name'))]"
]
},
{
"type": "MICROSOFT.WEB/CONNECTIONS",
"apiVersion": "2018-07-01-preview",
"name": "[parameters('azureblob_1_Connection_Name')]",
"location": "[parameters('logicAppLocation')]",
"properties": {
"api": {
"id": "[concat(subscription().id,
'/providers/Microsoft.Web/locations/', parameters('logicAppLocation'),
'/managedApis/', 'azureblob')]"
},
"displayName": "[parameters('azureblob_1_Connection_DisplayName')]",
"parameterValues": {
"accountName": "[parameters('azureblob_1_accountName')]",
"accessKey": "[parameters('azureblob_1_accessKey')]"
}
}
}
],
"outputs":
{}
}
Now set these parameters values in your Environment
specific Parameter files:

Image 9.
Same way, set values in QA and Production parameter
files.
First part of Article is complete. Now follow second part
ie: Azure DevOps.
So hoping you have your Azure Account ready.
# Second
Part:
Now Open https://dev.azure.com/
Login with your credentials.
Here under your Organization Create a New Project:

Image 10.
From Azure Repos Copy Azure Repos URL.
Step to commit your code into Azure DevOps Repo:
Go to your Visual Studio Logic Apps Code location.
Here in Address bar type cmd.exe
Enter
Command prompt will open. Now execute below command:
git
init
git
add .
git
commit -am "LogicAppCI/CD_Demo"
git
remote add origin AzureRepoURL
git
push -u origin –all
It will commit all your code into Azure Git Repos:
Now Check:

Image 11.
Now
time to create Pipeline So click on Build Pipeline:

Image 12.
Design your Build Pipeline as below:

Image 13.

Image 14.

Image 15.

Image 16.

Image 17.

Image 18.

Image 19.

Image 20.
Now
time to design Release Pipeline:
Click on Release option under Pipeline.

Image 21.
Now
add a Stage: Dev

Image 22.

Image 23.

Image 24.
Now
trigger your release pipeline.

Image 25.

Image 26.