Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,322 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Trying to do the following things, one after another:
I found out that this can be done through logic app. Can someone help me out how to do it.
@Saransh Gaur Thanks for your question. You can use Recurrence trigger to specify how frequently the logic app should be executed. To trigger ADX cluster query, you can use existing ADX connector actions.
Here is sample logic app code for your reference
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"For_each": {
"actions": {
"Compose": {
"inputs": "@items('For_each')",
"type": "Compose"
},
"Send_an_email_(V2)": {
"inputs": {
"body": {
"Body": "<p>@{outputs('Compose')}</p>",
"Importance": "Normal",
"Subject": "Test",
"To": "xxxxx@microsoft.com"
},
"host": {
"connection": {
"name": "@parameters('$connections')['office365']['connectionId']"
}
},
"method": "post",
"path": "/v2/Mail"
},
"runAfter": {
"Compose": [
"Succeeded"
]
},
"type": "ApiConnection"
}
},
"foreach": "@body('Run_KQL_query')?['value']",
"runAfter": {
"Initialize_variable": [
"Succeeded"
]
},
"type": "Foreach"
},
"Initialize_variable": {
"inputs": {
"variables": [
{
"name": "Count",
"type": "integer",
"value": 0
}
]
},
"runAfter": {
"Run_KQL_query": [
"Succeeded"
]
},
"type": "InitializeVariable"
},
"Run_KQL_query": {
"inputs": {
"body": {
"cluster": "https://help.kusto.windows.net/",
"csl": "StormEvents \n| where StartTime between (datetime(2007-11-01) .. datetime(2007-12-01))\n| where State == \"FLORIDA\" \n| take 2",
"db": "Samples"
},
"host": {
"connection": {
"name": "@parameters('$connections')['kusto']['connectionId']"
}
},
"method": "post",
"path": "/ListKustoResults/false"
},
"runAfter": {},
"type": "ApiConnection"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
}
},
"triggers": {
"Recurrence": {
"evaluatedRecurrence": {
"frequency": "Month",
"interval": 3
},
"recurrence": {
"frequency": "Month",
"interval": 3
},
"type": "Recurrence"
}
}
},
"parameters": {
"$connections": {
"value": {
"kusto": {
"connectionId": "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/Integration/providers/Microsoft.Web/connections/kusto",
"connectionName": "kusto",
"id": "/subscriptions/
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
/providers/Microsoft.Web/locations/eastus/managedApis/kusto"
},
"office365": {
"connectionId": "/subscriptions/
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
/resourceGroups/swdhanwa_Integration/providers/Microsoft.Web/connections/office365",
"connectionName": "office365",
"id": "/subscriptions/
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
/providers/Microsoft.Web/locations/eastus/managedApis/office365"
}
}
}
}
}