{"id":1352,"date":"2019-09-17T00:19:13","date_gmt":"2019-09-17T00:19:13","guid":{"rendered":"https:\/\/www.ciraltos.com\/?p=1352"},"modified":"2023-03-23T22:56:26","modified_gmt":"2023-03-24T03:56:26","slug":"azure-automation-azure-functions-teams-and-event-grid","status":"publish","type":"post","link":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/","title":{"rendered":"Azure Automation, Azure Functions, Teams, and Event Grid"},"content":{"rendered":"\n<figure class=\"wp-block-image alignleft\"><img decoding=\"async\" loading=\"lazy\" width=\"136\" height=\"127\" src=\"https:\/\/www.ciraltos.com\/wp-content\/uploads\/2019\/09\/Azure-Function-Automation.png\" alt=\"Azure Functions Azure Automation\" class=\"wp-image-1355\"\/><\/figure>\n\n\n\n<p>Well, I did it.&nbsp; I\nfinally started working with Azure Functions.&nbsp;\nI toyed around with PowerShell based Azure Functions for a while, but\ncouldn\u2019t find a good example to get started.&nbsp;\nA couple of weeks ago I started preparing a video that uses Event Grid and\nAzure Automation to send a message to Teams when a new Resource Group is\ncreated in Azure.&nbsp; This is based on\ninformation Microsoft has posted on using PowerShell to post to Teams.&nbsp; The video is listed below.<\/p>\n\n\n\n<!--more-->\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"ast-oembed-container\" style=\"height: 100%;\"><iframe loading=\"lazy\" title=\"Teams Alert of New Resource Group using Event Grid and Azure Automation\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/fbLjaamJPb8?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<p>The Azure Automation example seemed like a perfect task to\nmove to Azure Functions.&nbsp; This gave me an\nopportunity to get an understanding of how Azure functions operate.&nbsp; I was able to create a working example of\nsending a message to Microsoft Teams when a new resource is created in an Azure\nsubscription.&nbsp; <\/p>\n\n\n\n<p>The code from the Azure Automation video was modified to support sending messages based on multiple types of resources added to Azure, not just Resource Groups.&nbsp; This was done by adding PowerShell IF statements for each resource type.&nbsp; Additional statements can be added as needed.&nbsp; I also included a link in the description of the video with a list of all ARM Resource Provider Operations.&nbsp; These are used to create advanced filters in Event Grid.&nbsp; <\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<div class=\"ast-oembed-container\" style=\"height: 100%;\"><iframe loading=\"lazy\" title=\"Azure Function Alert to Microsoft Teams on New Azure Resource Creation\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/MuNmXMWvjT0?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" allowfullscreen><\/iframe><\/div>\n<\/div><\/figure>\n\n\n\n<p>So far, I\u2019m off to a good start.&nbsp; My next video will move another Azure\nAutomation task to Azure Functions.&nbsp; This\nwill be a little more involved, but open a lot of potential for Azure\nFunctions.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well, I did it.&nbsp; I finally started working with Azure Functions.&nbsp; I toyed around with PowerShell based Azure Functions for a while, but couldn\u2019t find a good example to get started.&nbsp; A couple of weeks ago I started preparing a video that uses Event Grid and Azure Automation to send a message to Teams when &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/\"> <span class=\"screen-reader-text\">Azure Automation, Azure Functions, Teams, and Event Grid<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":3993,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[2,252,569],"tags":[9,570,456,573,20,571,572],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Azure Automation, Azure Functions, Teams, and Event Grid - ciraltos<\/title>\n<meta name=\"description\" content=\"Use Azure Functions or Azure Automation to send a message to teams when a new resource is created in an Azure Subscription\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Azure Automation, Azure Functions, Teams, and Event Grid - ciraltos\" \/>\n<meta property=\"og:description\" content=\"Use Azure Functions or Azure Automation to send a message to teams when a new resource is created in an Azure Subscription\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/\" \/>\n<meta property=\"og:site_name\" content=\"ciraltos\" \/>\n<meta property=\"article:published_time\" content=\"2019-09-17T00:19:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-24T03:56:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Azure-Function-Automation.png\" \/>\n\t<meta property=\"og:image:width\" content=\"136\" \/>\n\t<meta property=\"og:image:height\" content=\"127\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Travis Roberts\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ciraltos\" \/>\n<meta name=\"twitter:site\" content=\"@ciraltos\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Travis Roberts\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/\"},\"author\":{\"name\":\"Travis Roberts\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\"},\"headline\":\"Azure Automation, Azure Functions, Teams, and Event Grid\",\"datePublished\":\"2019-09-17T00:19:13+00:00\",\"dateModified\":\"2023-03-24T03:56:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/\"},\"wordCount\":280,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\"},\"keywords\":[\"Azure\",\"Azure Functions\",\"Event Grid\",\"Microsoft Teams\",\"Powershell\",\"PowerShell Runbooks\",\"Teams\"],\"articleSection\":[\"Azure\",\"Azure Automation\",\"Azure Functions\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/\",\"url\":\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/\",\"name\":\"Azure Automation, Azure Functions, Teams, and Event Grid - ciraltos\",\"isPartOf\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#website\"},\"datePublished\":\"2019-09-17T00:19:13+00:00\",\"dateModified\":\"2023-03-24T03:56:26+00:00\",\"description\":\"Use Azure Functions or Azure Automation to send a message to teams when a new resource is created in an Azure Subscription\",\"breadcrumb\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.ciraltos.com\/staging2\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Azure Automation, Azure Functions, Teams, and Event Grid\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#website\",\"url\":\"https:\/\/www.ciraltos.com\/staging2\/\",\"name\":\"ciraltos\",\"description\":\"cloud, technology and trends\",\"publisher\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.ciraltos.com\/staging2\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a\",\"name\":\"Travis Roberts\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png\",\"contentUrl\":\"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png\",\"width\":5657,\"height\":3563,\"caption\":\"Travis Roberts\"},\"logo\":{\"@id\":\"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/www.ciraltos.com\",\"https:\/\/twitter.com\/ciraltos\"],\"url\":\"https:\/\/www.ciraltos.com\/staging2\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Azure Automation, Azure Functions, Teams, and Event Grid - ciraltos","description":"Use Azure Functions or Azure Automation to send a message to teams when a new resource is created in an Azure Subscription","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/","og_locale":"en_US","og_type":"article","og_title":"Azure Automation, Azure Functions, Teams, and Event Grid - ciraltos","og_description":"Use Azure Functions or Azure Automation to send a message to teams when a new resource is created in an Azure Subscription","og_url":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/","og_site_name":"ciraltos","article_published_time":"2019-09-17T00:19:13+00:00","article_modified_time":"2023-03-24T03:56:26+00:00","og_image":[{"width":136,"height":127,"url":"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Azure-Function-Automation.png","type":"image\/png"}],"author":"Travis Roberts","twitter_card":"summary_large_image","twitter_creator":"@ciraltos","twitter_site":"@ciraltos","twitter_misc":{"Written by":"Travis Roberts","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/#article","isPartOf":{"@id":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/"},"author":{"name":"Travis Roberts","@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a"},"headline":"Azure Automation, Azure Functions, Teams, and Event Grid","datePublished":"2019-09-17T00:19:13+00:00","dateModified":"2023-03-24T03:56:26+00:00","mainEntityOfPage":{"@id":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/"},"wordCount":280,"commentCount":2,"publisher":{"@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a"},"keywords":["Azure","Azure Functions","Event Grid","Microsoft Teams","Powershell","PowerShell Runbooks","Teams"],"articleSection":["Azure","Azure Automation","Azure Functions"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/","url":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/","name":"Azure Automation, Azure Functions, Teams, and Event Grid - ciraltos","isPartOf":{"@id":"https:\/\/www.ciraltos.com\/staging2\/#website"},"datePublished":"2019-09-17T00:19:13+00:00","dateModified":"2023-03-24T03:56:26+00:00","description":"Use Azure Functions or Azure Automation to send a message to teams when a new resource is created in an Azure Subscription","breadcrumb":{"@id":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.ciraltos.com\/staging2\/azure-automation-azure-functions-teams-and-event-grid\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.ciraltos.com\/staging2\/"},{"@type":"ListItem","position":2,"name":"Azure Automation, Azure Functions, Teams, and Event Grid"}]},{"@type":"WebSite","@id":"https:\/\/www.ciraltos.com\/staging2\/#website","url":"https:\/\/www.ciraltos.com\/staging2\/","name":"ciraltos","description":"cloud, technology and trends","publisher":{"@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.ciraltos.com\/staging2\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/25391996d6cddfecd4d257162b7e373a","name":"Travis Roberts","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/","url":"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png","contentUrl":"https:\/\/www.ciraltos.com\/staging2\/wp-content\/uploads\/2023\/03\/Logo-1.png","width":5657,"height":3563,"caption":"Travis Roberts"},"logo":{"@id":"https:\/\/www.ciraltos.com\/staging2\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.ciraltos.com","https:\/\/twitter.com\/ciraltos"],"url":"https:\/\/www.ciraltos.com\/staging2\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts\/1352"}],"collection":[{"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/comments?post=1352"}],"version-history":[{"count":1,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts\/1352\/revisions"}],"predecessor-version":[{"id":3999,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/posts\/1352\/revisions\/3999"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/media\/3993"}],"wp:attachment":[{"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/media?parent=1352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/categories?post=1352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ciraltos.com\/staging2\/wp-json\/wp\/v2\/tags?post=1352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}