-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathAdaptiveCardsLogicApp.json
1 lines (1 loc) · 9.8 KB
/
AdaptiveCardsLogicApp.json
1
{"$schema":"https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#","contentVersion":"1.0.0.0","parameters":{"logicAppName":{"type":"String","metadata":{"description":"Name of the logic app."}},"logicAppLocation":{"defaultValue":"[resourceGroup().location]","allowedValues":["eastasia","southeastasia","centralus","eastus","eastus2","westus","northcentralus","southcentralus","northeurope","westeurope","japanwest","japaneast","brazilsouth","australiaeast","australiasoutheast","southindia","centralindia","westindia","canadacentral","canadaeast","westcentralus","westus2","[resourceGroup().location]"],"type":"String","metadata":{"description":"Location of the logic app."}},"sharepointonline_Connection_Name":{"defaultValue":"sharepointonline","type":"String","metadata":{"description":"Name of the connection."}},"office365_Connection_Name":{"defaultValue":"office365","type":"String","metadata":{"description":"Name of the connection."}}},"resources":[{"type":"Microsoft.Logic/workflows","name":"[parameters('logicAppName')]","apiVersion":"2016-06-01","location":"[parameters('logicAppLocation')]","properties":{"state":"Disabled","definition":{"$schema":"https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#","contentVersion":"1.0.0.0","parameters":{"$connections":{"defaultValue":{},"type":"Object"},"$authentication":{"defaultValue":{},"type":"SecureObject"}},"triggers":{"manual":{"type":"Request","kind":"Http","inputs":{"schema":{"type":"object","properties":{"response":{"type":"string"},"status":{"type":"string"}}}}}},"actions":{"Compose":{"runAfter":{"Create_item":["Succeeded"]},"type":"Compose","inputs":{"type":"AdaptiveCard","body":[{"type":"TextBlock","size":"Medium","weight":"Bolder","text":"Thank you for your response"},{"type":"TextBlock","text":"Your response has been submitted successfully!"}],"$schema":"http://adaptivecards.io/schemas/adaptive-card.json","version":"1.0"}},"Response":{"runAfter":{"Compose":["Succeeded"]},"type":"Response","kind":"Http","inputs":{"statusCode":200,"headers":{"CARD-UPDATE-IN-BODY":"true"},"body":"@outputs('Compose')"}},"Create_item":{"runAfter":{},"metadata":{"flowSystemMetadata":{"swaggerOperationId":"PostItem"}},"type":"ApiConnection","inputs":{"host":{"connection":{"name":"@parameters('$connections')['sharepointonline']['connectionId']"}},"method":"post","body":{"Reason":"@triggerBody()?['response']","Status":"@triggerBody()?['status']"},"path":"/datasets/@{encodeURIComponent(encodeURIComponent('https://envisionit.sharepoint.com/sites/home'))}/tables/@{encodeURIComponent(encodeURIComponent('b72f451d-beb8-41ba-b6ec-8917e4403254'))}/items","authentication":"@parameters('$authentication')"}},"Compose_2":{"runAfter":{"Response":["Succeeded"]},"type":"Compose","inputs":"<script type=\"application/adaptivecard+json\">\n{\n \"$schema\": \"http://adaptivecards.io/schemas/adaptive-card.json\",\n \"type\": \"AdaptiveCard\",\n \"version\": \"1.0\",\n \"body\": [\n {\n \"type\": \"Container\",\n \"id\": \"45ac620d-7530-1371-a07f-44d9028fc4b9\",\n \"padding\": \"Medium\",\n \"items\": [\n {\n \"type\": \"Container\",\n \"id\": \"3d4e5f64-345f-9eb0-bcc5-84d7469aada8\",\n \"padding\": \"None\",\n \"items\": [\n {\n \"type\": \"ColumnSet\",\n \"id\": \"25cd6d1d-2ee5-ff2f-bab5-c8246fcf8776\",\n \"columns\": [\n {\n \"type\": \"Column\",\n \"id\": \"e7c9fb7d-073a-99b6-ffed-37449dd3e7b1\",\n \"padding\": \"None\",\n \"width\": \"auto\",\n \"items\": [\n {\n \"type\": \"Image\",\n \"id\": \"8285e36e-c3f0-0aa8-5d62-5c12afc40e13\",\n \"url\": \"https://www.envisionit.com/img/logo-eit.png\",\n \"size\": \"Medium\"\n }\n ]\n },\n {\n \"type\": \"Column\",\n \"id\": \"3606c3a5-ec44-4dce-6780-df638979116d\",\n \"padding\": \"None\",\n \"width\": 50,\n \"verticalContentAlignment\": \"Center\",\n \"items\": [\n {\n \"type\": \"TextBlock\",\n \"id\": \"2bbaef48-6ffc-4db3-3a93-37ada7d1b31b\",\n \"text\": \"Request @{body('Create_item')?['Status']}\",\n \"wrap\": true,\n \"size\": \"Medium\",\n \"weight\": \"Bolder\"\n }\n ]\n }\n ],\n \"padding\": \"None\"\n }\n ]\n }\n ],\n \"spacing\": \"Medium\",\n \"style\": \"emphasis\"\n },\n {\n \"type\": \"Container\",\n \"id\": \"2e5d8721-846c-6f4e-c87a-7927fdba6289\",\n \"padding\": {\n \"top\": \"Large\",\n \"bottom\": \"Small\",\n \"left\": \"Medium\",\n \"right\": \"Medium\"\n },\n \"items\": [\n {\n \"type\": \"TextBlock\",\n \"id\": \"e6cb7a90-eda3-35dd-6f99-a7c195e9b50e\",\n \"text\": \"Your request was @{body('Create_item')?['Status']}\",\n \"wrap\": true\n }\n ],\n \"spacing\": \"None\"\n },\n {\n \"type\": \"Container\",\n \"id\": \"5d7791b6-fb12-f898-d027-7feccad73229\",\n \"padding\": {\n \"top\": \"Small\",\n \"bottom\": \"Small\",\n \"left\": \"Medium\",\n \"right\": \"Medium\"\n },\n \"items\": [\n {\n \"type\": \"FactSet\",\n \"id\": \"2c4297fa-e1fd-d21c-d9aa-ef6146845e30\",\n \"facts\": [\n {\n \"title\": \"Reason:\",\n \"value\": \"@{body('Create_item')?['Reason']}\"\n }\n ]\n }\n ],\n \"spacing\": \"None\"\n },\n {\n \"type\": \"Container\",\n \"id\": \"74312a46-9328-cdc8-df41-dc7e17093f23\",\n \"padding\": \"Medium\",\n \"spacing\": \"None\",\n \"items\": [],\n \"style\": \"emphasis\"\n }\n ],\n \"padding\": \"None\",\n \"@type\": \"AdaptiveCard\",\n \"@context\": \"http://schema.org/extensions\"\n}\n</script>"},"Send_an_email_(V2)":{"runAfter":{"Compose_2":["Succeeded"]},"metadata":{"flowSystemMetadata":{"swaggerOperationId":"SendEmailV2"}},"type":"ApiConnection","inputs":{"host":{"connection":{"name":"@parameters('$connections')['office365']['connectionId']"}},"method":"post","body":{"To":"inquiry@envisionit.com","Subject":"Your request has been reviewed","Body":"<p>@{outputs('Compose_2')}</p>"},"path":"/v2/Mail","authentication":"@parameters('$authentication')"}}}},"parameters":{"$connections":{"value":{"sharepointonline":{"id":"[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'sharepointonline')]","connectionId":"[resourceId('Microsoft.Web/connections', parameters('sharepointonline_Connection_Name'))]","connectionName":"[parameters('sharepointonline_Connection_Name')]"},"office365":{"id":"[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'office365')]","connectionId":"[resourceId('Microsoft.Web/connections', parameters('office365_Connection_Name'))]","connectionName":"[parameters('office365_Connection_Name')]"}}}},"runtimeConfiguration":{"lifetime":{"unit":"Day","count":30},"collections":{"maximumItemCount":100000},"performanceProfile":{"throttles":{"mode":"Medium"}}}},"dependsOn":["[resourceId('Microsoft.Web/connections', parameters('sharepointonline_Connection_Name'))]","[resourceId('Microsoft.Web/connections', parameters('office365_Connection_Name'))]"]},{"type":"Microsoft.Web/connections","name":"[parameters('sharepointonline_Connection_Name')]","apiVersion":"2016-06-01","location":"[parameters('logicAppLocation')]","properties":{"api":{"id":"[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'sharepointonline')]"},"displayName":"[parameters('sharepointonline_Connection_Name')]"}},{"type":"Microsoft.Web/connections","name":"[parameters('office365_Connection_Name')]","apiVersion":"2016-06-01","location":"[parameters('logicAppLocation')]","properties":{"api":{"id":"[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'office365')]"},"displayName":"[parameters('office365_Connection_Name')]"}}]}