Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "template": {
- "$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."
- }
- },
- "microsoftforms_Connection_Name": {
- "defaultValue": "microsoftforms",
- "type": "String",
- "metadata": {
- "description": "Name of the connection."
- }
- },
- "excelonlinebusiness_Connection_Name": {
- "defaultValue": "excelonlinebusiness",
- "type": "String",
- "metadata": {
- "description": "Name of the connection."
- }
- },
- "office365_Connection_Name": {
- "defaultValue": "office365",
- "type": "String",
- "metadata": {
- "description": "Name of the connection."
- }
- },
- "wordonlinebusiness_Connection_Name": {
- "defaultValue": "wordonlinebusiness",
- "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": {
- "Bei_Übermitteln_einer_neuen_Antwort": {
- "metadata": {
- "flowSystemMetadata": {
- "swaggerOperationId": "CreateFormWebhook"
- }
- },
- "type": "ApiConnectionWebhook",
- "inputs": {
- "host": {
- "connection": {
- "name": "@parameters('$connections')['microsoftforms']['connectionId']"
- }
- },
- "body": {
- "eventType": "responseAdded",
- "notificationUrl": "@{listCallbackUrl()}",
- "source": "ms-connector"
- },
- "path": "/formapi/api/forms/@{encodeURIComponent('BphdUAfiAE-BTiGbRKL08aBNIIzCHddFjRiQHrgOBidUMFpCM0M2VDkyWjNTSzFIMlkyTzQyWU5BTS4u')}/webhooks",
- "authentication": "@parameters('$authentication')"
- }
- }
- },
- "actions": {
- "Auf_alle_anwenden": {
- "foreach": "@triggerBody()?['value']",
- "actions": {
- "Antwortdetails_abrufen": {
- "runAfter": {
- "In_Tabelle_vorhandene_Zeilen_auflisten": ["Succeeded"]
- },
- "metadata": {
- "flowSystemMetadata": {
- "swaggerOperationId": "GetFormResponseById"
- }
- },
- "type": "ApiConnection",
- "inputs": {
- "host": {
- "connection": {
- "name": "@parameters('$connections')['microsoftforms']['connectionId']"
- }
- },
- "method": "get",
- "path": "/formapi/api/forms('@{encodeURIComponent('BphdUAfiAE-BTiGbRKL08aBNIIzCHddFjRiQHrgOBidUMFpCM0M2VDkyWjNTSzFIMlkyTzQyWU5BTS4u')}')/responses",
- "queries": {
- "response_id": "@items('Auf_alle_anwenden')?['resourceData']?['responseId']"
- },
- "authentication": "@parameters('$authentication')"
- }
- },
- "In_Tabelle_vorhandene_Zeilen_auflisten": {
- "runAfter": {},
- "metadata": {
- "01CS4W2FBFLXJOMJV3ZRCZO3RWBJKK7GOY": "/DEDON DE/IT-Service-Request/IT-Service-Requests.xlsx",
- "flowSystemMetadata": {
- "swaggerOperationId": "GetItems"
- }
- },
- "type": "ApiConnection",
- "inputs": {
- "host": {
- "connection": {
- "name": "@parameters('$connections')['excelonlinebusiness']['connectionId']"
- }
- },
- "method": "get",
- "path": "/drives/@{encodeURIComponent('b!PAnHprc240aT6f9oaREcu24Snj40TbROhQu6V5Evo7b-2JnpYqkMSomCFE8WfeOf')}/files/@{encodeURIComponent('01CS4W2FBFLXJOMJV3ZRCZO3RWBJKK7GOY')}/tables/@{encodeURIComponent('{EA8C5562-4CA4-4D33-9600-47FA6642C526}')}/items",
- "queries": {
- "source": "groups/b7414b06-a888-4ca8-97b1-c7b8e75b9a7c"
- },
- "authentication": "@parameters('$authentication')"
- }
- },
- "Auf_alle_anwenden_2": {
- "foreach": "@body('In_Tabelle_vorhandene_Zeilen_auflisten')?['value']",
- "actions": {
- "Bedingung": {
- "actions": {
- "Zeile_aktualisieren": {
- "runAfter": {},
- "metadata": {
- "01CS4W2FBFLXJOMJV3ZRCZO3RWBJKK7GOY": "/DEDON DE/IT-Service-Request/IT-Service-Requests.xlsx",
- "flowSystemMetadata": {
- "swaggerOperationId": "PatchItem"
- }
- },
- "type": "ApiConnection",
- "inputs": {
- "host": {
- "connection": {
- "name": "@parameters('$connections')['excelonlinebusiness']['connectionId']"
- }
- },
- "method": "patch",
- "body": {
- "Benötigte Hardware": "@body('Antwortdetails_abrufen')?['re412247c0b4146cda70f3df5261755f1']",
- "Sonstiges": "@body('Antwortdetails_abrufen')?['r482b718fd003473a8aafb55c44484519']",
- "Benötigte Dienste & Berechtigungen": "@body('Antwortdetails_abrufen')?['r9c35020481b7400ebedaa90b2d3aa7e7']",
- "Bemerkungen": "@body('Antwortdetails_abrufen')?['r32b663ea2f424f8b975a6a456bc8f07f']",
- "Benötigte Software": "@body('Antwortdetails_abrufen')?['r40bca19395bc4ae1817eafcb54589dd6']",
- "Sonstiges2": "@body('Antwortdetails_abrufen')?['re76fa4ca734347ee90034a6324187e83']",
- "Vollständig": "1"
- },
- "path": "/drives/@{encodeURIComponent('b!PAnHprc240aT6f9oaREcu24Snj40TbROhQu6V5Evo7b-2JnpYqkMSomCFE8WfeOf')}/files/@{encodeURIComponent('01CS4W2FBFLXJOMJV3ZRCZO3RWBJKK7GOY')}/tables/@{encodeURIComponent('{EA8C5562-4CA4-4D33-9600-47FA6642C526}')}/items/@{encodeURIComponent(encodeURIComponent(body('Antwortdetails_abrufen')?['r7f81713d5166409796eed2c8928e3e02']))}",
- "queries": {
- "source": "groups/b7414b06-a888-4ca8-97b1-c7b8e75b9a7c",
- "idColumn": "ID"
- },
- "authentication": "@parameters('$authentication')"
- }
- },
- "E-Mail_senden_2": {
- "runAfter": {
- "Zeile_aktualisieren": ["Succeeded"]
- },
- "metadata": {
- "flowSystemMetadata": {
- "swaggerOperationId": "SendEmail"
- }
- },
- "type": "ApiConnection",
- "inputs": {
- "host": {
- "connection": {
- "name": "@parameters('$connections')['office365']['connectionId']"
- }
- },
- "method": "post",
- "body": {
- "To": "@{body('Antwortdetails_abrufen')?['responder']};",
- "Subject": "IT-Service-Request erfolgreich",
- "Body": "Ihr Service Request für @{body('Zeile_aktualisieren')?['Name']} wurde erfolgreich eingereicht."
- },
- "path": "/Mail",
- "authentication": "@parameters('$authentication')"
- }
- },
- "Bedingung_2": {
- "actions": {
- "Microsoft_Word-Vorlage_auffüllen": {
- "runAfter": {
- "Zeile_abrufen": ["Succeeded"]
- },
- "metadata": {
- "01CS4W2FDCKEEL5TJUFZA2ZNF2CVXA35BM": "/DEDON DE/IT-Service-Request/IT-Service-Request-Germany-Vorlage.docx",
- "flowSystemMetadata": {
- "swaggerOperationId": "CreateFileItem"
- }
- },
- "type": "ApiConnection",
- "inputs": {
- "host": {
- "connection": {
- "name": "@parameters('$connections')['wordonlinebusiness']['connectionId']"
- }
- },
- "method": "post",
- "body": {
- "1048108003": [{
- "-1203548884": "@body('Zeile_abrufen')?['Bemerkungen']"
- }],
- "1139846457": [{
- "866641043": "@body('Zeile_abrufen')?['Standort']"
- }],
- "1143387690": [{
- "-1449382187": "@body('Zeile_abrufen')?['Sonstiges2']"
- }],
- "-1901117170": [{
- "696595582": "@body('Zeile_abrufen')?['ID']"
- }],
- "-1130547426": [{
- "-2013598497": "@body('Zeile_abrufen')?['Art der Anfrage']"
- }],
- "-695472052": [{
- "-1194076351": "@body('Zeile_abrufen')?['Name']"
- }],
- "-1026105239": [{
- "-855418504": "@body('Zeile_abrufen')?['Abteilung']"
- }],
- "-2091840279": [{
- "684486028": "@body('Zeile_abrufen')?['Stellenbezeichnung']"
- }],
- "-1348322774": [{
- "1532376593": "@body('Zeile_abrufen')?['Benötigte Hardware']"
- }],
- "-2065014928": [{
- "-385407511": "@body('Zeile_abrufen')?['Sonstiges']"
- }],
- "-2096230734": [{
- "-187213871": "@body('Zeile_abrufen')?['Benötigte Dienste & Berechtigungen']"
- }],
- "-595173656": [{
- "746853730": "@body('Zeile_abrufen')?['Benötigte Software']"
- }]
- },
- "path": "/api/templates/getFile",
- "queries": {
- "source": "groups/b7414b06-a888-4ca8-97b1-c7b8e75b9a7c",
- "drive": "b!PAnHprc240aT6f9oaREcu24Snj40TbROhQu6V5Evo7b-2JnpYqkMSomCFE8WfeOf",
- "file": "01CS4W2FDCKEEL5TJUFZA2ZNF2CVXA35BM"
- },
- "authentication": "@parameters('$authentication')"
- }
- },
- "Zeile_abrufen": {
- "runAfter": {},
- "metadata": {
- "01CS4W2FBFLXJOMJV3ZRCZO3RWBJKK7GOY": "/DEDON DE/IT-Service-Request/IT-Service-Requests.xlsx",
- "flowSystemMetadata": {
- "swaggerOperationId": "GetItem"
- }
- },
- "type": "ApiConnection",
- "inputs": {
- "host": {
- "connection": {
- "name": "@parameters('$connections')['excelonlinebusiness']['connectionId']"
- }
- },
- "method": "get",
- "path": "/drives/@{encodeURIComponent('b!PAnHprc240aT6f9oaREcu24Snj40TbROhQu6V5Evo7b-2JnpYqkMSomCFE8WfeOf')}/files/@{encodeURIComponent('01CS4W2FBFLXJOMJV3ZRCZO3RWBJKK7GOY')}/tables/@{encodeURIComponent('{EA8C5562-4CA4-4D33-9600-47FA6642C526}')}/items/@{encodeURIComponent(encodeURIComponent(body('Antwortdetails_abrufen')?['r7f81713d5166409796eed2c8928e3e02']))}",
- "queries": {
- "source": "groups/b7414b06-a888-4ca8-97b1-c7b8e75b9a7c",
- "idColumn": "ID"
- },
- "authentication": "@parameters('$authentication')"
- }
- },
- "E-Mail_senden_3": {
- "runAfter": {
- "Microsoft_Word-Vorlage_auffüllen": ["Succeeded"]
- },
- "metadata": {
- "flowSystemMetadata": {
- "swaggerOperationId": "SendEmail"
- }
- },
- "type": "ApiConnection",
- "inputs": {
- "host": {
- "connection": {
- "name": "@parameters('$connections')['office365']['connectionId']"
- }
- },
- "method": "post",
- "body": {
- "To": "Service.Servicedesk@DEDON.DE;",
- "Subject": "IT-Service-Request: @{body('Zeile_abrufen')?['Name']} - @{body('Zeile_abrufen')?['Art der Anfrage']} (@{body('Zeile_abrufen')?['Datum des Fertigstellung']})",
- "Body": "IT-Service-Request im Anhang.",
- "Attachments": [{
- "Name": "IT-Service-Request: @{body('Zeile_abrufen')?['Name']} - @{body('Zeile_abrufen')?['Art der Anfrage']} (@{body('Zeile_abrufen')?['Datum des Fertigstellung']})",
- "ContentBytes": "@{base64(body('Microsoft_Word-Vorlage_auffüllen'))}"
- }],
- "Importance": "Normal"
- },
- "path": "/Mail",
- "authentication": "@parameters('$authentication')"
- }
- }
- },
- "runAfter": {
- "E-Mail_senden_2": ["Succeeded"]
- },
- "else": {
- "actions": {
- "E-Mail_senden_4": {
- "runAfter": {},
- "metadata": {
- "flowSystemMetadata": {
- "swaggerOperationId": "SendEmail"
- }
- },
- "type": "ApiConnection",
- "inputs": {
- "host": {
- "connection": {
- "name": "@parameters('$connections')['office365']['connectionId']"
- }
- },
- "method": "post",
- "body": {
- "To": "@{body('Antwortdetails_abrufen')?['responder']};",
- "Subject": "IT-Service-Request fehlgeschlagen!",
- "Body": "Bitte wenden sie sich an den IT-Support.\n\nFehlecode: DaFuVollERROR"
- },
- "path": "/Mail",
- "authentication": "@parameters('$authentication')"
- }
- }
- }
- },
- "expression": {
- "equals": ["@body('Zeile_aktualisieren')?['Vollständig']", 1]
- },
- "type": "If"
- }
- },
- "runAfter": {},
- "else": {
- "actions": {
- "E-Mail_senden": {
- "runAfter": {},
- "metadata": {
- "flowSystemMetadata": {
- "swaggerOperationId": "SendEmail"
- }
- },
- "type": "ApiConnection",
- "inputs": {
- "host": {
- "connection": {
- "name": "@parameters('$connections')['office365']['connectionId']"
- }
- },
- "method": "post",
- "body": {
- "To": "@{body('Antwortdetails_abrufen')?['responder']};",
- "Subject": "Fehler bei der Erstellung des IT-Service-Request!",
- "Body": "Die angegebene Anfragen-ID existiert nicht! Bitte füllen sie das Formular erneut aus:\nDie Anfragen-ID finden sie in der letzten Email.\nFormular: https://forms.office.com/Pages/ResponsePage.aspx?id=BphdUAfiAE-BTiGbRKL08aBNIIzCHddFjRiQHrgOBidUMFpCM0M2VDkyWjNTSzFIMlkyTzQyWU5BTS4u",
- "Importance": "High"
- },
- "path": "/Mail",
- "authentication": "@parameters('$authentication')"
- }
- }
- }
- },
- "expression": {
- "contains": ["@items('Auf_alle_anwenden_3')?['ID']", "@body('Antwortdetails_abrufen')?['r7f81713d5166409796eed2c8928e3e02']"]
- },
- "type": "If"
- }
- },
- "runAfter": {},
- "type": "Foreach"
- }
- },
- "runAfter": {
- "Antwortdetails_abrufen": ["Succeeded"]
- },
- "type": "Foreach"
- }
- },
- "outputs": {}
- },
- "parameters": {
- "$connections": {
- "value": {
- "microsoftforms": {
- "id": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'microsoftforms')]",
- "connectionId": "[resourceId('Microsoft.Web/connections', parameters('microsoftforms_Connection_Name'))]",
- "connectionName": "[parameters('microsoftforms_Connection_Name')]"
- },
- "excelonlinebusiness": {
- "id": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'excelonlinebusiness')]",
- "connectionId": "[resourceId('Microsoft.Web/connections', parameters('excelonlinebusiness_Connection_Name'))]",
- "connectionName": "[parameters('excelonlinebusiness_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')]"
- },
- "wordonlinebusiness": {
- "id": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'wordonlinebusiness')]",
- "connectionId": "[resourceId('Microsoft.Web/connections', parameters('wordonlinebusiness_Connection_Name'))]",
- "connectionName": "[parameters('wordonlinebusiness_Connection_Name')]"
- }
- }
- }
- },
- "runtimeConfiguration": {
- "lifetime": {
- "unit": "Day",
- "count": 30
- },
- "collections": {
- "maximumItemCount": 100000
- },
- "performanceProfile": {
- "throttles": {
- "mode": "Medium"
- }
- }
- }
- },
- "dependsOn": ["[resourceId('Microsoft.Web/connections', parameters('microsoftforms_Connection_Name'))]", "[resourceId('Microsoft.Web/connections', parameters('excelonlinebusiness_Connection_Name'))]", "[resourceId('Microsoft.Web/connections', parameters('office365_Connection_Name'))]", "[resourceId('Microsoft.Web/connections', parameters('wordonlinebusiness_Connection_Name'))]"]
- }, {
- "type": "Microsoft.Web/connections",
- "name": "[parameters('microsoftforms_Connection_Name')]",
- "apiVersion": "2016-06-01",
- "location": "[parameters('logicAppLocation')]",
- "properties": {
- "api": {
- "id": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'microsoftforms')]"
- },
- "displayName": "[parameters('microsoftforms_Connection_Name')]"
- }
- }, {
- "type": "Microsoft.Web/connections",
- "name": "[parameters('excelonlinebusiness_Connection_Name')]",
- "apiVersion": "2016-06-01",
- "location": "[parameters('logicAppLocation')]",
- "properties": {
- "api": {
- "id": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'excelonlinebusiness')]"
- },
- "displayName": "[parameters('excelonlinebusiness_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')]"
- }
- }, {
- "type": "Microsoft.Web/connections",
- "name": "[parameters('wordonlinebusiness_Connection_Name')]",
- "apiVersion": "2016-06-01",
- "location": "[parameters('logicAppLocation')]",
- "properties": {
- "api": {
- "id": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'wordonlinebusiness')]"
- },
- "displayName": "[parameters('wordonlinebusiness_Connection_Name')]"
- }
- }]
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement