{"id":4095,"date":"2018-05-22T12:04:56","date_gmt":"2018-05-22T17:04:56","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vsappcenter\/?p=4095"},"modified":"2019-07-23T11:03:18","modified_gmt":"2019-07-23T16:03:18","slug":"webhooks-and-email-notifications-in-visual-studio-app-center-build","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/appcenter\/webhooks-and-email-notifications-in-visual-studio-app-center-build\/","title":{"rendered":"Webhooks and Email Notifications in Visual Studio App Center Build"},"content":{"rendered":"<p>We\u2019re excited to announce the launch of build status notifications for Visual Studio App Center! Based on your feedback, we know some of you are customizing your build definitions to notify your team about the build status. Now you can say goodbye to these custom steps and simply use the email and webhook notifications feature in App Center to stay in the know.<\/p>\n<p>Our team&#8217;s mission is to make app development as easy as possible for you and your team. Build is a key step in your Continuous Integration and Continuous Delivery (CI\/CD) app development pipeline. As developers, you want to automatically be notified of your app&#8217;s build status and not have to continually log in to a portal for information. It&#8217;s useful to be able to notify multiple developers working on a project on the build&#8217;s status so that your team can quickly resolve issues before the problem escalates. For instance, as you continually build and make changes to your codebase, sometimes a build may work locally on one machine, but fail on the Build server. In this post, you&#8217;ll learn how to configure email and custom webhooks to get immediate updates on your builds in App Center.<\/p>\n<h2>Benefits of Setting up App Center Notifications<\/h2>\n<p>Email and custom webhook notifications give you continual real time updates of your build status, as well as the permanency and ability to search and be directed to your builds in App Center. This also enables faster collaboration, since you can forward the build status emails or @ mention collaborators in a chat or channel in a single workflow.<\/p>\n<p>You can choose to have email and webhook notifications automatically sent for the following events:<\/p>\n<ul>\n<li>\u25b6Build:\n<ul>\n<li>Build success:\n<ul>\n<li><b>Always<\/b>: When your app builds successfully<\/li>\n<li><b>Only if previously failed<\/b>: When your app has successfully built after one or more failed builds<\/li>\n<li><b>Never<\/b>: You will not receive notifications for build success<\/li>\n<\/ul>\n<\/li>\n<li>Build failure:\n<ul>\n<li><b>Always<\/b>: When your app fails to build<\/li>\n<li><b>Only if previously successful<\/b>: When your app has failed to build after one or more successful builds<\/li>\n<li><b>Never<\/b>: You will not receive notifications for build failure<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li><b>\u26a0 Crashes<\/b>: When a crash group is created<\/li>\n<li><b>\ud83d\udd31 Distribute<\/b>: When a new\u00a0version is released<\/li>\n<\/ul>\n<p>By default, email notifications are sent only when a new version is released. Whether you&#8217;re an admin, app developer, or tester, it&#8217;s important to be notified immediately when a new version is released to testers or to the store. For admins or app developers involved in the Continuous Integration, Delivery and Deployment process, it&#8217;s useful to set up email and custom webhook notifications for build and distribute.<\/p>\n<h2>Setting up App Center Notifications<\/h2>\n<p>To get started, you need to have App Center\u2019s Build service set up. I\u2019ve onboarded the <a href=\"https:\/\/github.com\/Microsoft\/SmartHotel360-mobile-desktop-apps\" target=\"_blank\" rel=\"noopener noreferrer\">SmartHotel360<\/a> mobile demo app to our Build service by connecting my Visual Studio Team Services source code repository and triggering a build on the `Release` branch on every push. You can read David Sanchez\u2019s blog post to <a href=\"https:\/\/blogs.msdn.microsoft.com\/dasanagu\/2018\/03\/19\/automateduitestsappcenter\/\" target=\"_blank\" rel=\"noopener noreferrer\">learn more about setting up a build for the SmartHotel360 app<\/a>.<\/p>\n<h3>Set up Build Status Notifications<\/h3>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>Go to the app for which you\u2019d like to configure email and webhook status notifications<\/li>\n<li>Navigate to the app\u2019s <strong style=\"font-size: 1rem;\">Settings<\/strong><span style=\"font-size: 1rem;\">, and:<\/span>\n<ol style=\"list-style-type: lower-alpha;\">\n<li>To configure your <strong style=\"font-size: 1rem;\">email notifications<\/strong><span style=\"font-size: 1rem;\">, click Email notifications and select the events to trigger an email notification. Personally, I&#8217;m interested in when my build has succeeded or failed and when a crash group has happened.<\/span><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-39205 size-large\" src=\"https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/1-emailNotifications-1024x657.gif\" alt=\"\" width=\"640\" height=\"411\" srcset=\"https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/1-emailNotifications-1024x657.gif 1024w, https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/1-emailNotifications-300x193.gif 300w, https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/1-emailNotifications-768x493.gif 768w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/>\n<img class=\"aligncenter size-full wp-image-4115\" alt=\"\" width=\"850\" \/>\nHere is the documentation on <a href=\"https:\/\/docs.microsoft.com\/en-us\/appcenter\/dashboard\/email-notifications\/\" target=\"_blank\" rel=\"noopener noreferrer\">how to configure your email notifications<\/a>.<\/p>\n<p>b. To configure a webhook, click <strong>New Webhook<\/strong> and enter your <strong>webhook name<\/strong>, <strong>URL<\/strong>, and select the <strong>events<\/strong> to trigger the\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0webhook alerts.<\/p>\n<p>In the example below, I\u2019ve configured a Slack webhook:<\/p>\n<p><img class=\"aligncenter size-full wp-image-4125\" alt=\"\" width=\"850\" \/><img decoding=\"async\" class=\"aligncenter wp-image-39206 size-large\" src=\"https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/2-createSlackWebhook-1024x653.gif\" alt=\"\" width=\"640\" height=\"408\" srcset=\"https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/2-createSlackWebhook-1024x653.gif 1024w, https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/2-createSlackWebhook-300x191.gif 300w, https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/2-createSlackWebhook-768x490.gif 768w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>Here is the documentation on <a href=\"https:\/\/docs.microsoft.com\/en-us\/appcenter\/dashboard\/webhooks\/\" target=\"_blank\" rel=\"noopener noreferrer\">how to set up a webhook<\/a> and how to obtain the <a href=\"https:\/\/get.slack.help\/hc\/en-us\/articles\/115005265063-Incoming-WebHooks-for-Slack\" target=\"_blank\" rel=\"noopener noreferrer\">Slack<\/a> and <a href=\"https:\/\/docs.microsoft.com\/en-us\/microsoftteams\/platform\/concepts\/connectors\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft Teams<\/a> webhook URL.<\/p>\n<p>3. Now, let\u2019s kick off a new build!\nClick <strong>Build<\/strong>, select the <strong>gear icon<\/strong> of the branch you\u2019d like to build, and click `Save &amp; Build`.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-39207 size-large\" src=\"https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/3-triggerBuild-1024x649.gif\" alt=\"\" width=\"640\" height=\"406\" srcset=\"https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/3-triggerBuild-1024x649.gif 1024w, https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/3-triggerBuild-300x190.gif 300w, https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/3-triggerBuild-768x487.gif 768w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/>\n<img class=\"aligncenter size-full wp-image-4135\" alt=\"\" width=\"850\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>4. After the build is completed, you&#8217;ll receive a build status email and webhook notification with the build details and a link to view the\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0build.\nHere&#8217;s an example of an email with a failed build:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-39208 size-large\" src=\"https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/4-buildFailed-1024x963.png\" alt=\"\" width=\"640\" height=\"602\" srcset=\"https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/4-buildFailed-1024x963.png 1024w, https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/4-buildFailed-300x282.png 300w, https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/4-buildFailed-768x723.png 768w, https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/4-buildFailed.png 1216w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p><img class=\"aligncenter size-full wp-image-4145\" alt=\"\" width=\"450\" \/>\nYou can click on the <strong>View<\/strong> link to view the build output details, distribute the app, and download the build or logs in App Center.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-39209 size-large\" src=\"https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/5-openEmailBuildLink-1024x654.gif\" alt=\"\" width=\"640\" height=\"409\" srcset=\"https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/5-openEmailBuildLink-1024x654.gif 1024w, https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/5-openEmailBuildLink-300x192.gif 300w, https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/5-openEmailBuildLink-768x491.gif 768w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/p>\n<p><img class=\"aligncenter size-full wp-image-4155\" alt=\"\" width=\"1000\" \/><span style=\"font-size: 1rem;\">You&#8217;ll now be notified of your build status and can @ mention or email your developers to quickly fix failed builds before they reach more users. Awesome, crisis averted!<\/span><\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Webhook Notification\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>In Slack\n<img decoding=\"async\" class=\"aligncenter wp-image-39210 size-large\" src=\"https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/6-openSlackWebhookBuildLink-1024x653.gif\" alt=\"\" width=\"640\" height=\"408\" srcset=\"https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/6-openSlackWebhookBuildLink-1024x653.gif 1024w, https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/6-openSlackWebhookBuildLink-300x191.gif 300w, https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/6-openSlackWebhookBuildLink-768x490.gif 768w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/>\n<img class=\"aligncenter size-full wp-image-4165\" alt=\"\" width=\"850\" \/><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul>\n<li>In Microsoft Teams\n<img decoding=\"async\" class=\"aligncenter wp-image-39211 size-large\" src=\"https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/7-openMSTeamsWebhookBuildLink-1024x651.gif\" alt=\"\" width=\"640\" height=\"407\" srcset=\"https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/7-openMSTeamsWebhookBuildLink-1024x651.gif 1024w, https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/7-openMSTeamsWebhookBuildLink-300x191.gif 300w, https:\/\/devblogs.microsoft.com\/appcenter\/wp-content\/uploads\/sites\/3\/2017\/10\/7-openMSTeamsWebhookBuildLink-768x488.gif 768w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/>\n<img class=\"aligncenter size-full wp-image-4175\" alt=\"\" width=\"850\" \/><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>Get started and send us your feedback!<\/h2>\n<p><a href=\"https:\/\/appcenter.ms\/login\/\" target=\"_blank\" rel=\"noopener noreferrer\">Log in to App Center<\/a>\u202f(or\u202f<a href=\"https:\/\/appcenter.ms\/signup?utm_source=AppCenter_blog&amp;utm_medium=Blog&amp;utm_campaign=webhooks-and-email-notifications-in-visual-studio-app-center-build\/\" target=\"_blank\" rel=\"noopener noreferrer\">create your free account\u202ftoday<\/a>) and start kicking off builds, toggling your email notification settings, and configuring webhooks. We\u2019re keen to hear what you\u2019d like to see next, so send us your feedback on what worked (and what didn\u2019t) for you.<\/p>\n<p>Enjoy, and let&#8217;s get building! \ud83d\ude0a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We\u2019re excited to announce the launch of build status notifications for Visual Studio App Center! Based on your feedback, we know some of you are customizing your build definitions to notify your team about the build status. Now you can say goodbye to these custom steps and simply use the email and webhook notifications feature [&hellip;]<\/p>\n","protected":false},"author":660,"featured_media":38034,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16],"tags":[],"class_list":["post-4095","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mobiledev"],"acf":[],"blog_post_summary":"<p>We\u2019re excited to announce the launch of build status notifications for Visual Studio App Center! Based on your feedback, we know some of you are customizing your build definitions to notify your team about the build status. Now you can say goodbye to these custom steps and simply use the email and webhook notifications feature [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/posts\/4095","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/users\/660"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/comments?post=4095"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/posts\/4095\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/media\/38034"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/media?parent=4095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/categories?post=4095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/appcenter\/wp-json\/wp\/v2\/tags?post=4095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}