Logic Apps: Integration, Connectors & Workflow Automation
Workflow automation with Azure Logic Apps for data engineering integration and orchestration
Logic Apps Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β LOGIC APPS ARCHITECTURE β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β TRIGGERS ACTIONS OUTPUTS β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Recurrence ββββββ>β HTTP βββββ>β Email β β
β β HTTP Request β β Azure SQL β β Teams β β
β β Event Grid β β ADLS Gen2 β β Slack β β
β β Service Bus β β ADF β β HTTP Responseβ β
β β Blob Storageβ β Databricks β β Storage β β
β ββββββββββββββββ β Key Vault β ββββββββββββββββ β
β β Logic Apps β β
β PLAN TYPES: β (Nested) β β
β ββββββββββββββββββββ ββββββββββββββββ β
β β Consumption: β β
β β Pay per action β CONNECTORS: β
β β β βββββββββββββββββββββββββββββββββββ β
β β Standard: β β 300+ built-in connectors β β
β β Per app plan β β β’ Azure services β β
β β (dedicated) β β β’ SaaS (Salesforce, SAP) β β
β β β β β’ On-premises (via gateway) β β
β ββββββββββββββββββββ βββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Logic App Definition
{
"definition": {
"triggers": {
"Recurrence": {
"type": "Recurrence",
"recurrence": {
"frequency": "Hour",
"interval": 1
}
}
},
"actions": {
"Get_New_Files": {
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['azureblob']['connectionId']"
}
},
"method": "get",
"path": "/v2/datasets/@{encodeURIComponent('raw')}/foldersV2/@{encodeURIComponent('incoming')}"
}
},
"For_Each_File": {
"type": "Foreach",
"foreach": "@body('Get_New_Files')?['value']",
"actions": {
"Trigger_ADF_Pipeline": {
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['azuredatafactory']['connectionId']"
}
},
"method": "post",
"path": "/v1/subscriptions/@{encodeURIComponent('subscriptionId')}/resourceGroups/@{encodeURIComponent('resourceGroup')}/providers/Microsoft.DataFactory/factories/@{encodeURIComponent('factoryName')}/createRun",
"body": {
"referenceName": "pl_process_file",
"parameters": {
"fileName": "@items('For_Each_File')?['name']"
}
}
}
}
}
},
"Send_Alert": {
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "@parameters('$connections')['office365']['connectionId']"
}
},
"method": "post",
"body": {
"To": "data-team@company.com",
"Subject": "Files Processed",
"Body": "Successfully processed @{length(body('Get_New_Files')?['value'])} files"
}
}
}
}
}
}
Key Vault Integration
# Logic App Key Vault connector
import requests
import json
# Secret rotation workflow
def rotate_secret(vault_name, secret_name):
# Generate new secret value
new_value = generate_secret_value()
# Update Key Vault secret
headers = {
"Authorization": f"Bearer {get_token()}",
"Content-Type": "application/json"
}
response = requests.put(
f"https://{vault_name}.vault.azure.net/secrets/{secret_name}?api-version=7.4",
headers=headers,
json={"value": new_value}
)
return response.status_code == 200
βΉοΈ
Pro Tip: Use Logic Apps for event-driven workflows (blob arrival, API calls) and ADF for complex ETL orchestration. Logic Apps excel at integrating disparate systems with 300+ connectors.
Interview Questions
Q1: When would you use Logic Apps vs Azure Functions for data engineering? A: Logic Apps for workflow orchestration with many connectors (SaaS, Azure services). Azure Functions for custom code, complex computation, and event-driven processing.
Q2: How do you handle errors in Logic Apps? A: Use scopes with Try-Catch pattern, configure retry policies, implement error notifications, and use compensation actions for rollback scenarios.
Q3: What are the cost implications of Logic Apps? A: Consumption: ~$0.000025 per action. Standard: App Service plan costs. Use Standard for high-volume workflows; Consumption for sporadic workloads.