{"id":8748,"date":"2025-04-10T07:32:59","date_gmt":"2025-04-10T07:32:59","guid":{"rendered":"https:\/\/pariswells.com\/blog\/?p=8748"},"modified":"2025-04-10T07:33:07","modified_gmt":"2025-04-10T07:33:07","slug":"powerapp-to-delete-montir-emails-e-g-azure-activated-severity-emails-once-the-azure-deactivated-severity-has-been-recieved","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/research\/powerapp-to-delete-montir-emails-e-g-azure-activated-severity-emails-once-the-azure-deactivated-severity-has-been-recieved","title":{"rendered":"PowerApp to Delete Montir Emails e.g. Azure: Activated Severity emails once the Azure: Deactivated Severity has been recieved"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code class=\"\">{\n  \"name\": \"1200139d-495b-4846-8379-10c8abc2117a\",\n  \"id\": \"\/providers\/Microsoft.Flow\/flows\/1200139d-495b-4846-8379-10c8abc2117a\",\n  \"type\": \"Microsoft.Flow\/flows\",\n  \"properties\": {\n    \"apiId\": \"\/providers\/Microsoft.PowerApps\/apis\/shared_logicflows\",\n    \"displayName\": \"Clean Azure VPN Alerts\",\n    \"definition\": {\n      \"metadata\": {\n        \"workflowEntityId\": null,\n        \"processAdvisorMetadata\": null,\n        \"flowChargedByPaygo\": null,\n        \"flowclientsuspensionreason\": \"None\",\n        \"flowclientsuspensiontime\": null,\n        \"flowclientsuspensionreasondetails\": null,\n        \"creator\": {\n          \"id\": \"4a35c6fc-e945-4f70-8791-ba7ea5900e7f\",\n          \"type\": \"User\",\n          \"tenantId\": \"e417d5cc-e5d8-4cad-b2cd-c5ef82dea0a0\"\n        },\n        \"provisioningMethod\": \"FromDefinition\",\n        \"failureAlertSubscription\": true,\n        \"clientLastModifiedTime\": \"2025-04-10T06:58:29.3779237Z\",\n        \"connectionKeySavedTimeKey\": \"2025-04-10T06:58:29.3779237Z\",\n        \"creationSource\": \"Portal\",\n        \"modifiedSources\": \"Portal\"\n      },\n      \"$schema\": \"https:\/\/schema.management.azure.com\/providers\/Microsoft.Logic\/schemas\/2016-06-01\/workflowdefinition.json#\",\n      \"contentVersion\": \"1.0.0.0\",\n      \"parameters\": {\n        \"$authentication\": {\n          \"defaultValue\": {\n            \n          },\n          \"type\": \"SecureObject\"\n        },\n        \"$connections\": {\n          \"defaultValue\": {\n            \n          },\n          \"type\": \"Object\"\n        }\n      },\n      \"triggers\": {\n        \"When_a_new_email_arrives_(V3)\": {\n          \"splitOn\": \"@triggerOutputs()?['body\/value']\",\n          \"type\": \"OpenApiConnectionNotification\",\n          \"inputs\": {\n            \"parameters\": {\n              \"includeAttachments\": false,\n              \"importance\": \"Any\",\n              \"fetchOnlyWithAttachment\": false,\n              \"folderPath\": \"Inbox\"\n            },\n            \"host\": {\n              \"apiId\": \"\/providers\/Microsoft.PowerApps\/apis\/shared_office365\",\n              \"connectionName\": \"shared_office365\",\n              \"operationId\": \"OnNewEmailV3\"\n            },\n            \"authentication\": \"@parameters('$authentication')\"\n          }\n        }\n      },\n      \"actions\": {\n        \"Condition_1\": {\n          \"actions\": {\n            \"DeleteEmail1\": {\n              \"runAfter\": {\n                \"For_each\": [\n                  \"Succeeded\"\n                ]\n              },\n              \"metadata\": {\n                \"flowSystemMetadata\": {\n                  \"portalOperationIconOverride\": \"https:\/\/conn-afd-prod-endpoint-bmc9bqahasf3grgk.b01.azurefd.net\/releases\/v1.0.1722\/1.0.1722.3975\/office365\/icon.png\",\n                  \"portalOperationBrandColorOverride\": \"#0078D4\",\n                  \"portalOperationId\": \"\/providers\/Microsoft.PowerApps\/apis\/shared_office365\/apiOperations\/DeleteEmail_V2\"\n                }\n              },\n              \"type\": \"OpenApiConnection\",\n              \"inputs\": {\n                \"parameters\": {\n                  \"messageId\": \"@triggerOutputs()?['body\/id']\"\n                },\n                \"host\": {\n                  \"apiId\": \"\/providers\/Microsoft.PowerApps\/apis\/shared_office365\",\n                  \"connectionName\": \"shared_office365\",\n                  \"operationId\": \"DeleteEmail_V2\"\n                },\n                \"authentication\": \"@parameters('$authentication')\"\n              }\n            },\n            \"Get_emails_(V3)\": {\n              \"type\": \"OpenApiConnection\",\n              \"inputs\": {\n                \"parameters\": {\n                  \"from\": \"azure-noreply@microsoft.com\",\n                  \"fetchOnlyUnread\": true,\n                  \"searchQuery\": \"subject:'Activated Severity'\",\n                  \"top\": 25\n                },\n                \"host\": {\n                  \"apiId\": \"\/providers\/Microsoft.PowerApps\/apis\/shared_office365\",\n                  \"connectionName\": \"shared_office365\",\n                  \"operationId\": \"GetEmailsV3\"\n                },\n                \"authentication\": \"@parameters('$authentication')\"\n              }\n            },\n            \"For_each\": {\n              \"foreach\": \"@outputs('Get_emails_(V3)')?['body\/value']\",\n              \"actions\": {\n                \"Delete_email_(V2)\": {\n                  \"type\": \"OpenApiConnection\",\n                  \"inputs\": {\n                    \"parameters\": {\n                      \"messageId\": \"@item()?['id']\"\n                    },\n                    \"host\": {\n                      \"apiId\": \"\/providers\/Microsoft.PowerApps\/apis\/shared_office365\",\n                      \"connectionName\": \"shared_office365\",\n                      \"operationId\": \"DeleteEmail_V2\"\n                    },\n                    \"authentication\": \"@parameters('$authentication')\"\n                  }\n                }\n              },\n              \"runAfter\": {\n                \"Get_emails_(V3)\": [\n                  \"Succeeded\"\n                ]\n              },\n              \"type\": \"Foreach\"\n            }\n          },\n          \"runAfter\": {\n            \n          },\n          \"else\": {\n            \"actions\": {\n              \n            }\n          },\n          \"expression\": {\n            \"and\": [\n              {\n                \"equals\": [\n                  \"@triggerOutputs()?['body\/subject']\",\n                  \"Azure: Deactivated Severity: 3 VPNConnection\"\n                ]\n              }\n            ]\n          },\n          \"type\": \"If\"\n        }\n      },\n      \"outputs\": {\n        \n      }\n    },\n    \"connectionReferences\": {\n      \"shared_office365\": {\n        \"connectionName\": \"shared-office365-96b1849c-c7f2-4c88-8789-5410edf28b88\",\n        \"source\": \"Embedded\",\n        \"id\": \"\/providers\/Microsoft.PowerApps\/apis\/shared_office365\",\n        \"tier\": \"NotSpecified\",\n        \"apiName\": \"office365\"\n      }\n    },\n    \"flowFailureAlertSubscribed\": false,\n    \"isManaged\": false\n  }\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2025\/04\/image-17.png\"><img loading=\"lazy\" decoding=\"async\" width=\"670\" height=\"812\" src=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2025\/04\/image-17.png\" alt=\"\" class=\"wp-image-8749 img-responsive\" srcset=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2025\/04\/image-17.png 670w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2025\/04\/image-17-248x300.png 248w\" sizes=\"auto, (max-width: 670px) 100vw, 670px\" \/><\/a><\/figure>\n\n\n\n<p><a href=\"https:\/\/github.com\/pariswells\/public-code\/blob\/master\/PowerApps\/CleanAzureVPNAlerts_20250410070955.zip\">https:\/\/github.com\/pariswells\/public-code\/blob\/master\/PowerApps\/CleanAzureVPNAlerts_20250410070955.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/github.com\/pariswells\/public-code\/blob\/master\/PowerApps\/CleanAzureVPNAlerts_20250410070955.zip<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8748","post","type-post","status-publish","format-standard","hentry","category-research"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/8748","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=8748"}],"version-history":[{"count":1,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/8748\/revisions"}],"predecessor-version":[{"id":8750,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/8748\/revisions\/8750"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=8748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=8748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=8748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}