Created
December 27, 2019 13:50
-
-
Save johnybradshaw/b6f0395065a52c1e24249611f5bcbfdd to your computer and use it in GitHub Desktop.
An Azure Log Analytics data collector function app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"definition": { | |
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", | |
"actions": { | |
"For_each": { | |
"actions": { | |
"Send_Data": { | |
"inputs": { | |
"body": "@{items('For_each')}", | |
"headers": { | |
"Log-Type": "skytap_CL" | |
}, | |
"host": { | |
"connection": { | |
"name": "@parameters('$connections')['azureloganalyticsdatacollector']['connectionId']" | |
} | |
}, | |
"method": "post", | |
"path": "/api/logs" | |
}, | |
"runAfter": {}, | |
"type": "ApiConnection" | |
} | |
}, | |
"foreach": "@triggerBody()?['Payload']", | |
"runAfter": {}, | |
"type": "Foreach" | |
}, | |
"Terminate": { | |
"inputs": { | |
"runStatus": "Succeeded" | |
}, | |
"runAfter": { | |
"For_each": [ | |
"Succeeded" | |
] | |
}, | |
"type": "Terminate" | |
} | |
}, | |
"contentVersion": "1.0.0.0", | |
"outputs": {}, | |
"parameters": { | |
"$connections": { | |
"defaultValue": {}, | |
"type": "Object" | |
} | |
}, | |
"triggers": { | |
"manual": { | |
"inputs": { | |
"schema": { | |
"properties": { | |
"Payload": { | |
"items": { | |
"properties": { | |
"customer": { | |
"properties": { | |
"id": { | |
"type": "string" | |
}, | |
"name": { | |
"type": "string" | |
} | |
}, | |
"type": "object" | |
}, | |
"date": { | |
"type": "string" | |
}, | |
"department": { | |
"properties": { | |
"id": {}, | |
"name": {} | |
}, | |
"type": "object" | |
}, | |
"id": { | |
"type": "integer" | |
}, | |
"operated_on": { | |
"items": { | |
"properties": { | |
"guid": { | |
"type": "string" | |
}, | |
"id": { | |
"type": "integer" | |
}, | |
"name": { | |
"type": "string" | |
}, | |
"resource_type": { | |
"type": "string" | |
} | |
}, | |
"required": [ | |
"resource_type", | |
"name", | |
"id", | |
"guid" | |
], | |
"type": "object" | |
}, | |
"type": "array" | |
}, | |
"operation_id": { | |
"type": "string" | |
}, | |
"payload": { | |
"properties": {}, | |
"type": "object" | |
}, | |
"project": { | |
"properties": { | |
"id": {}, | |
"name": {} | |
}, | |
"type": "object" | |
}, | |
"region": { | |
"type": "string" | |
}, | |
"type": { | |
"type": "string" | |
}, | |
"type_code": { | |
"type": "string" | |
}, | |
"user": { | |
"properties": { | |
"id": {}, | |
"name": { | |
"type": "string" | |
} | |
}, | |
"type": "object" | |
} | |
}, | |
"required": [ | |
"id", | |
"type", | |
"type_code", | |
"date", | |
"region", | |
"payload", | |
"user", | |
"department", | |
"project", | |
"operation_id", | |
"customer", | |
"operated_on" | |
], | |
"type": "object" | |
}, | |
"type": "array" | |
}, | |
"category": { | |
"type": "string" | |
}, | |
"message_id": { | |
"type": "string" | |
}, | |
"timestamp": { | |
"type": "string" | |
}, | |
"version": { | |
"type": "integer" | |
} | |
}, | |
"type": "object" | |
} | |
}, | |
"kind": "Http", | |
"type": "Request" | |
} | |
} | |
}, | |
"parameters": { | |
"$connections": { | |
"value": { | |
"azureloganalyticsdatacollector": { | |
"connectionId": "/subscriptions/564d2745-1496-4766-956b-fc14172c78ab/resourceGroups/csa-jbradshaw/providers/Microsoft.Web/connections/azureloganalyticsdatacollector", | |
"connectionName": "azureloganalyticsdatacollector", | |
"id": "/subscriptions/564d2745-1496-4766-956b-fc14172c78ab/providers/Microsoft.Web/locations/eastus/managedApis/azureloganalyticsdatacollector" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment