Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 38.76 KB | None | 0 0
  1. {
  2. "template": {
  3. "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  4. "contentVersion": "1.0.0.0",
  5. "parameters": {
  6. "logicAppName": {
  7. "type": "String",
  8. "metadata": {
  9. "description": "Name of the logic app."
  10. }
  11. },
  12. "logicAppLocation": {
  13. "defaultValue": "[resourceGroup().location]",
  14. "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]"],
  15. "type": "String",
  16. "metadata": {
  17. "description": "Location of the logic app."
  18. }
  19. },
  20. "microsoftforms_Connection_Name": {
  21. "defaultValue": "microsoftforms",
  22. "type": "String",
  23. "metadata": {
  24. "description": "Name of the connection."
  25. }
  26. },
  27. "excelonlinebusiness_Connection_Name": {
  28. "defaultValue": "excelonlinebusiness",
  29. "type": "String",
  30. "metadata": {
  31. "description": "Name of the connection."
  32. }
  33. },
  34. "office365_Connection_Name": {
  35. "defaultValue": "office365",
  36. "type": "String",
  37. "metadata": {
  38. "description": "Name of the connection."
  39. }
  40. },
  41. "wordonlinebusiness_Connection_Name": {
  42. "defaultValue": "wordonlinebusiness",
  43. "type": "String",
  44. "metadata": {
  45. "description": "Name of the connection."
  46. }
  47. }
  48. },
  49. "resources": [{
  50. "type": "Microsoft.Logic/workflows",
  51. "name": "[parameters('logicAppName')]",
  52. "apiVersion": "2016-06-01",
  53. "location": "[parameters('logicAppLocation')]",
  54. "properties": {
  55. "state": "Disabled",
  56. "definition": {
  57. "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
  58. "contentVersion": "1.0.0.0",
  59. "parameters": {
  60. "$connections": {
  61. "defaultValue": {},
  62. "type": "Object"
  63. },
  64. "$authentication": {
  65. "defaultValue": {},
  66. "type": "SecureObject"
  67. }
  68. },
  69. "triggers": {
  70. "Bei_Übermitteln_einer_neuen_Antwort": {
  71. "metadata": {
  72. "flowSystemMetadata": {
  73. "swaggerOperationId": "CreateFormWebhook"
  74. }
  75. },
  76. "type": "ApiConnectionWebhook",
  77. "inputs": {
  78. "host": {
  79. "connection": {
  80. "name": "@parameters('$connections')['microsoftforms']['connectionId']"
  81. }
  82. },
  83. "body": {
  84. "eventType": "responseAdded",
  85. "notificationUrl": "@{listCallbackUrl()}",
  86. "source": "ms-connector"
  87. },
  88. "path": "/formapi/api/forms/@{encodeURIComponent('BphdUAfiAE-BTiGbRKL08aBNIIzCHddFjRiQHrgOBidUMFpCM0M2VDkyWjNTSzFIMlkyTzQyWU5BTS4u')}/webhooks",
  89. "authentication": "@parameters('$authentication')"
  90. }
  91. }
  92. },
  93. "actions": {
  94. "Auf_alle_anwenden": {
  95. "foreach": "@triggerBody()?['value']",
  96. "actions": {
  97. "Antwortdetails_abrufen": {
  98. "runAfter": {
  99. "In_Tabelle_vorhandene_Zeilen_auflisten": ["Succeeded"]
  100. },
  101. "metadata": {
  102. "flowSystemMetadata": {
  103. "swaggerOperationId": "GetFormResponseById"
  104. }
  105. },
  106. "type": "ApiConnection",
  107. "inputs": {
  108. "host": {
  109. "connection": {
  110. "name": "@parameters('$connections')['microsoftforms']['connectionId']"
  111. }
  112. },
  113. "method": "get",
  114. "path": "/formapi/api/forms('@{encodeURIComponent('BphdUAfiAE-BTiGbRKL08aBNIIzCHddFjRiQHrgOBidUMFpCM0M2VDkyWjNTSzFIMlkyTzQyWU5BTS4u')}')/responses",
  115. "queries": {
  116. "response_id": "@items('Auf_alle_anwenden')?['resourceData']?['responseId']"
  117. },
  118. "authentication": "@parameters('$authentication')"
  119. }
  120. },
  121. "In_Tabelle_vorhandene_Zeilen_auflisten": {
  122. "runAfter": {},
  123. "metadata": {
  124. "01CS4W2FBFLXJOMJV3ZRCZO3RWBJKK7GOY": "/DEDON DE/IT-Service-Request/IT-Service-Requests.xlsx",
  125. "flowSystemMetadata": {
  126. "swaggerOperationId": "GetItems"
  127. }
  128. },
  129. "type": "ApiConnection",
  130. "inputs": {
  131. "host": {
  132. "connection": {
  133. "name": "@parameters('$connections')['excelonlinebusiness']['connectionId']"
  134. }
  135. },
  136. "method": "get",
  137. "path": "/drives/@{encodeURIComponent('b!PAnHprc240aT6f9oaREcu24Snj40TbROhQu6V5Evo7b-2JnpYqkMSomCFE8WfeOf')}/files/@{encodeURIComponent('01CS4W2FBFLXJOMJV3ZRCZO3RWBJKK7GOY')}/tables/@{encodeURIComponent('{EA8C5562-4CA4-4D33-9600-47FA6642C526}')}/items",
  138. "queries": {
  139. "source": "groups/b7414b06-a888-4ca8-97b1-c7b8e75b9a7c"
  140. },
  141. "authentication": "@parameters('$authentication')"
  142. }
  143. },
  144. "Auf_alle_anwenden_2": {
  145. "foreach": "@body('In_Tabelle_vorhandene_Zeilen_auflisten')?['value']",
  146. "actions": {
  147. "Bedingung": {
  148. "actions": {
  149. "Zeile_aktualisieren": {
  150. "runAfter": {},
  151. "metadata": {
  152. "01CS4W2FBFLXJOMJV3ZRCZO3RWBJKK7GOY": "/DEDON DE/IT-Service-Request/IT-Service-Requests.xlsx",
  153. "flowSystemMetadata": {
  154. "swaggerOperationId": "PatchItem"
  155. }
  156. },
  157. "type": "ApiConnection",
  158. "inputs": {
  159. "host": {
  160. "connection": {
  161. "name": "@parameters('$connections')['excelonlinebusiness']['connectionId']"
  162. }
  163. },
  164. "method": "patch",
  165. "body": {
  166. "Benötigte Hardware": "@body('Antwortdetails_abrufen')?['re412247c0b4146cda70f3df5261755f1']",
  167. "Sonstiges": "@body('Antwortdetails_abrufen')?['r482b718fd003473a8aafb55c44484519']",
  168. "Benötigte Dienste & Berechtigungen": "@body('Antwortdetails_abrufen')?['r9c35020481b7400ebedaa90b2d3aa7e7']",
  169. "Bemerkungen": "@body('Antwortdetails_abrufen')?['r32b663ea2f424f8b975a6a456bc8f07f']",
  170. "Benötigte Software": "@body('Antwortdetails_abrufen')?['r40bca19395bc4ae1817eafcb54589dd6']",
  171. "Sonstiges2": "@body('Antwortdetails_abrufen')?['re76fa4ca734347ee90034a6324187e83']",
  172. "Vollständig": "1"
  173. },
  174. "path": "/drives/@{encodeURIComponent('b!PAnHprc240aT6f9oaREcu24Snj40TbROhQu6V5Evo7b-2JnpYqkMSomCFE8WfeOf')}/files/@{encodeURIComponent('01CS4W2FBFLXJOMJV3ZRCZO3RWBJKK7GOY')}/tables/@{encodeURIComponent('{EA8C5562-4CA4-4D33-9600-47FA6642C526}')}/items/@{encodeURIComponent(encodeURIComponent(body('Antwortdetails_abrufen')?['r7f81713d5166409796eed2c8928e3e02']))}",
  175. "queries": {
  176. "source": "groups/b7414b06-a888-4ca8-97b1-c7b8e75b9a7c",
  177. "idColumn": "ID"
  178. },
  179. "authentication": "@parameters('$authentication')"
  180. }
  181. },
  182. "E-Mail_senden_2": {
  183. "runAfter": {
  184. "Zeile_aktualisieren": ["Succeeded"]
  185. },
  186. "metadata": {
  187. "flowSystemMetadata": {
  188. "swaggerOperationId": "SendEmail"
  189. }
  190. },
  191. "type": "ApiConnection",
  192. "inputs": {
  193. "host": {
  194. "connection": {
  195. "name": "@parameters('$connections')['office365']['connectionId']"
  196. }
  197. },
  198. "method": "post",
  199. "body": {
  200. "To": "@{body('Antwortdetails_abrufen')?['responder']};",
  201. "Subject": "IT-Service-Request erfolgreich",
  202. "Body": "Ihr Service Request für @{body('Zeile_aktualisieren')?['Name']} wurde erfolgreich eingereicht."
  203. },
  204. "path": "/Mail",
  205. "authentication": "@parameters('$authentication')"
  206. }
  207. },
  208. "Bedingung_2": {
  209. "actions": {
  210. "Microsoft_Word-Vorlage_auffüllen": {
  211. "runAfter": {
  212. "Zeile_abrufen": ["Succeeded"]
  213. },
  214. "metadata": {
  215. "01CS4W2FDCKEEL5TJUFZA2ZNF2CVXA35BM": "/DEDON DE/IT-Service-Request/IT-Service-Request-Germany-Vorlage.docx",
  216. "flowSystemMetadata": {
  217. "swaggerOperationId": "CreateFileItem"
  218. }
  219. },
  220. "type": "ApiConnection",
  221. "inputs": {
  222. "host": {
  223. "connection": {
  224. "name": "@parameters('$connections')['wordonlinebusiness']['connectionId']"
  225. }
  226. },
  227. "method": "post",
  228. "body": {
  229. "1048108003": [{
  230. "-1203548884": "@body('Zeile_abrufen')?['Bemerkungen']"
  231. }],
  232. "1139846457": [{
  233. "866641043": "@body('Zeile_abrufen')?['Standort']"
  234. }],
  235. "1143387690": [{
  236. "-1449382187": "@body('Zeile_abrufen')?['Sonstiges2']"
  237. }],
  238. "-1901117170": [{
  239. "696595582": "@body('Zeile_abrufen')?['ID']"
  240. }],
  241. "-1130547426": [{
  242. "-2013598497": "@body('Zeile_abrufen')?['Art der Anfrage']"
  243. }],
  244. "-695472052": [{
  245. "-1194076351": "@body('Zeile_abrufen')?['Name']"
  246. }],
  247. "-1026105239": [{
  248. "-855418504": "@body('Zeile_abrufen')?['Abteilung']"
  249. }],
  250. "-2091840279": [{
  251. "684486028": "@body('Zeile_abrufen')?['Stellenbezeichnung']"
  252. }],
  253. "-1348322774": [{
  254. "1532376593": "@body('Zeile_abrufen')?['Benötigte Hardware']"
  255. }],
  256. "-2065014928": [{
  257. "-385407511": "@body('Zeile_abrufen')?['Sonstiges']"
  258. }],
  259. "-2096230734": [{
  260. "-187213871": "@body('Zeile_abrufen')?['Benötigte Dienste & Berechtigungen']"
  261. }],
  262. "-595173656": [{
  263. "746853730": "@body('Zeile_abrufen')?['Benötigte Software']"
  264. }]
  265. },
  266. "path": "/api/templates/getFile",
  267. "queries": {
  268. "source": "groups/b7414b06-a888-4ca8-97b1-c7b8e75b9a7c",
  269. "drive": "b!PAnHprc240aT6f9oaREcu24Snj40TbROhQu6V5Evo7b-2JnpYqkMSomCFE8WfeOf",
  270. "file": "01CS4W2FDCKEEL5TJUFZA2ZNF2CVXA35BM"
  271. },
  272. "authentication": "@parameters('$authentication')"
  273. }
  274. },
  275. "Zeile_abrufen": {
  276. "runAfter": {},
  277. "metadata": {
  278. "01CS4W2FBFLXJOMJV3ZRCZO3RWBJKK7GOY": "/DEDON DE/IT-Service-Request/IT-Service-Requests.xlsx",
  279. "flowSystemMetadata": {
  280. "swaggerOperationId": "GetItem"
  281. }
  282. },
  283. "type": "ApiConnection",
  284. "inputs": {
  285. "host": {
  286. "connection": {
  287. "name": "@parameters('$connections')['excelonlinebusiness']['connectionId']"
  288. }
  289. },
  290. "method": "get",
  291. "path": "/drives/@{encodeURIComponent('b!PAnHprc240aT6f9oaREcu24Snj40TbROhQu6V5Evo7b-2JnpYqkMSomCFE8WfeOf')}/files/@{encodeURIComponent('01CS4W2FBFLXJOMJV3ZRCZO3RWBJKK7GOY')}/tables/@{encodeURIComponent('{EA8C5562-4CA4-4D33-9600-47FA6642C526}')}/items/@{encodeURIComponent(encodeURIComponent(body('Antwortdetails_abrufen')?['r7f81713d5166409796eed2c8928e3e02']))}",
  292. "queries": {
  293. "source": "groups/b7414b06-a888-4ca8-97b1-c7b8e75b9a7c",
  294. "idColumn": "ID"
  295. },
  296. "authentication": "@parameters('$authentication')"
  297. }
  298. },
  299. "E-Mail_senden_3": {
  300. "runAfter": {
  301. "Microsoft_Word-Vorlage_auffüllen": ["Succeeded"]
  302. },
  303. "metadata": {
  304. "flowSystemMetadata": {
  305. "swaggerOperationId": "SendEmail"
  306. }
  307. },
  308. "type": "ApiConnection",
  309. "inputs": {
  310. "host": {
  311. "connection": {
  312. "name": "@parameters('$connections')['office365']['connectionId']"
  313. }
  314. },
  315. "method": "post",
  316. "body": {
  317. "To": "Service.Servicedesk@DEDON.DE;",
  318. "Subject": "IT-Service-Request: @{body('Zeile_abrufen')?['Name']} - @{body('Zeile_abrufen')?['Art der Anfrage']} (@{body('Zeile_abrufen')?['Datum des Fertigstellung']})",
  319. "Body": "IT-Service-Request im Anhang.",
  320. "Attachments": [{
  321. "Name": "IT-Service-Request: @{body('Zeile_abrufen')?['Name']} - @{body('Zeile_abrufen')?['Art der Anfrage']} (@{body('Zeile_abrufen')?['Datum des Fertigstellung']})",
  322. "ContentBytes": "@{base64(body('Microsoft_Word-Vorlage_auffüllen'))}"
  323. }],
  324. "Importance": "Normal"
  325. },
  326. "path": "/Mail",
  327. "authentication": "@parameters('$authentication')"
  328. }
  329. }
  330. },
  331. "runAfter": {
  332. "E-Mail_senden_2": ["Succeeded"]
  333. },
  334. "else": {
  335. "actions": {
  336. "E-Mail_senden_4": {
  337. "runAfter": {},
  338. "metadata": {
  339. "flowSystemMetadata": {
  340. "swaggerOperationId": "SendEmail"
  341. }
  342. },
  343. "type": "ApiConnection",
  344. "inputs": {
  345. "host": {
  346. "connection": {
  347. "name": "@parameters('$connections')['office365']['connectionId']"
  348. }
  349. },
  350. "method": "post",
  351. "body": {
  352. "To": "@{body('Antwortdetails_abrufen')?['responder']};",
  353. "Subject": "IT-Service-Request fehlgeschlagen!",
  354. "Body": "Bitte wenden sie sich an den IT-Support.\n\nFehlecode: DaFuVollERROR"
  355. },
  356. "path": "/Mail",
  357. "authentication": "@parameters('$authentication')"
  358. }
  359. }
  360. }
  361. },
  362. "expression": {
  363. "equals": ["@body('Zeile_aktualisieren')?['Vollständig']", 1]
  364. },
  365. "type": "If"
  366. }
  367. },
  368. "runAfter": {},
  369. "else": {
  370. "actions": {
  371. "E-Mail_senden": {
  372. "runAfter": {},
  373. "metadata": {
  374. "flowSystemMetadata": {
  375. "swaggerOperationId": "SendEmail"
  376. }
  377. },
  378. "type": "ApiConnection",
  379. "inputs": {
  380. "host": {
  381. "connection": {
  382. "name": "@parameters('$connections')['office365']['connectionId']"
  383. }
  384. },
  385. "method": "post",
  386. "body": {
  387. "To": "@{body('Antwortdetails_abrufen')?['responder']};",
  388. "Subject": "Fehler bei der Erstellung des IT-Service-Request!",
  389. "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",
  390. "Importance": "High"
  391. },
  392. "path": "/Mail",
  393. "authentication": "@parameters('$authentication')"
  394. }
  395. }
  396. }
  397. },
  398. "expression": {
  399. "contains": ["@items('Auf_alle_anwenden_3')?['ID']", "@body('Antwortdetails_abrufen')?['r7f81713d5166409796eed2c8928e3e02']"]
  400. },
  401. "type": "If"
  402. }
  403. },
  404. "runAfter": {},
  405. "type": "Foreach"
  406. }
  407. },
  408. "runAfter": {
  409. "Antwortdetails_abrufen": ["Succeeded"]
  410. },
  411. "type": "Foreach"
  412. }
  413. },
  414. "outputs": {}
  415. },
  416. "parameters": {
  417. "$connections": {
  418. "value": {
  419. "microsoftforms": {
  420. "id": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'microsoftforms')]",
  421. "connectionId": "[resourceId('Microsoft.Web/connections', parameters('microsoftforms_Connection_Name'))]",
  422. "connectionName": "[parameters('microsoftforms_Connection_Name')]"
  423. },
  424. "excelonlinebusiness": {
  425. "id": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'excelonlinebusiness')]",
  426. "connectionId": "[resourceId('Microsoft.Web/connections', parameters('excelonlinebusiness_Connection_Name'))]",
  427. "connectionName": "[parameters('excelonlinebusiness_Connection_Name')]"
  428. },
  429. "office365": {
  430. "id": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'office365')]",
  431. "connectionId": "[resourceId('Microsoft.Web/connections', parameters('office365_Connection_Name'))]",
  432. "connectionName": "[parameters('office365_Connection_Name')]"
  433. },
  434. "wordonlinebusiness": {
  435. "id": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'wordonlinebusiness')]",
  436. "connectionId": "[resourceId('Microsoft.Web/connections', parameters('wordonlinebusiness_Connection_Name'))]",
  437. "connectionName": "[parameters('wordonlinebusiness_Connection_Name')]"
  438. }
  439. }
  440. }
  441. },
  442. "runtimeConfiguration": {
  443. "lifetime": {
  444. "unit": "Day",
  445. "count": 30
  446. },
  447. "collections": {
  448. "maximumItemCount": 100000
  449. },
  450. "performanceProfile": {
  451. "throttles": {
  452. "mode": "Medium"
  453. }
  454. }
  455. }
  456. },
  457. "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'))]"]
  458. }, {
  459. "type": "Microsoft.Web/connections",
  460. "name": "[parameters('microsoftforms_Connection_Name')]",
  461. "apiVersion": "2016-06-01",
  462. "location": "[parameters('logicAppLocation')]",
  463. "properties": {
  464. "api": {
  465. "id": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'microsoftforms')]"
  466. },
  467. "displayName": "[parameters('microsoftforms_Connection_Name')]"
  468. }
  469. }, {
  470. "type": "Microsoft.Web/connections",
  471. "name": "[parameters('excelonlinebusiness_Connection_Name')]",
  472. "apiVersion": "2016-06-01",
  473. "location": "[parameters('logicAppLocation')]",
  474. "properties": {
  475. "api": {
  476. "id": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'excelonlinebusiness')]"
  477. },
  478. "displayName": "[parameters('excelonlinebusiness_Connection_Name')]"
  479. }
  480. }, {
  481. "type": "Microsoft.Web/connections",
  482. "name": "[parameters('office365_Connection_Name')]",
  483. "apiVersion": "2016-06-01",
  484. "location": "[parameters('logicAppLocation')]",
  485. "properties": {
  486. "api": {
  487. "id": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'office365')]"
  488. },
  489. "displayName": "[parameters('office365_Connection_Name')]"
  490. }
  491. }, {
  492. "type": "Microsoft.Web/connections",
  493. "name": "[parameters('wordonlinebusiness_Connection_Name')]",
  494. "apiVersion": "2016-06-01",
  495. "location": "[parameters('logicAppLocation')]",
  496. "properties": {
  497. "api": {
  498. "id": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('logicAppLocation'), '/managedApis/', 'wordonlinebusiness')]"
  499. },
  500. "displayName": "[parameters('wordonlinebusiness_Connection_Name')]"
  501. }
  502. }]
  503. }
  504. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement