{"id":6123,"date":"2016-01-30T16:02:36","date_gmt":"2016-01-30T16:02:36","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/webdev\/2016\/01\/30\/sending-asp-net-webhooks-from-azure-webjobs\/"},"modified":"2023-09-21T11:44:37","modified_gmt":"2023-09-21T18:44:37","slug":"sending-asp-net-webhooks-from-azure-webjobs","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/sending-asp-net-webhooks-from-azure-webjobs\/","title":{"rendered":"Sending ASP.NET WebHooks from Azure WebJobs"},"content":{"rendered":"<p><a href=\"http:\/\/www.hanselman.com\/blog\/IntroducingWindowsAzureWebJobs.aspx\">Azure WebJobs<\/a> is a great way for running any kind of script or executable as a background process in connection with an <a href=\"https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/app-service-value-prop-what-is\/\">Azure App Service Web Site or App<\/a>. You can upload an executable or script as a WebJob and run it either on a schedule or continuously. The WebJob can perform any function you can stick into a command line script or program and using the Azure WebJobs SDK, you can trigger actions to happen as a result of <a href=\"https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/websites-webjobs-resources\/\">inputs from a number of sources<\/a>, for example:<\/p>\n<ol>\n<li>A <a href=\"https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/websites-dotnet-webjobs-sdk-storage-queues-how-to\/\">message arriving on an Azure Storage queue<\/a>; <\/li>\n<li>An <a href=\"https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/websites-dotnet-webjobs-sdk-storage-blobs-how-to\/\">Azure Storage blob being created or updated<\/a>; <\/li>\n<li>A <a href=\"https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/websites-dotnet-webjobs-sdk-service-bus\/\">message arriving on an Azure Service Bus queue<\/a>. <\/li>\n<\/ol>\n<p>WebHooks provide a simple mechanism for sending event notification across web applications and external services. For example, you can receive a WebHook when someone sends money to your PayPal account, or when a message is posted to Slack, or a picture is posted to Instagram. The opportunities for integrating services using WebHooks are endless. ASP.NET WebHooks provide support for both sending and receiving WebHooks allowing your ASP.NET applications to easily integrate with other services. <\/p>\n<p>If you are new to ASP.NET WebHooks, then check out the blog <a href=\"http:\/\/blogs.msdn.com\/b\/webdev\/archive\/2015\/09\/04\/introducing-microsoft-asp-net-webhooks-preview.aspx\">Introducing Microsoft ASP.NET WebHooks Preview<\/a>. For an introduction for how to use ASP.NET WebHooks for sending WebHooks, please see <a href=\"http:\/\/blogs.msdn.com\/b\/webdev\/archive\/2015\/09\/15\/sending-webhooks-with-asp-net-webhooks-preview.aspx\">Sending WebHooks with ASP.NET WebHooks Preview<\/a>. For scaling up and out when sending WebHooks, please see the blog <a href=\"http:\/\/blogs.msdn.com\/b\/webdev\/archive\/2015\/12\/31\/new-year-updates-to-asp-net-webhooks-preview.aspx\">New Year Updates to ASP.NET WebHooks Preview<\/a>.<\/p>\n<p>In this blog we will describe how to send ASP.NET WebHooks from inside an Azure WebJob as a result of a message arriving on an Azure Storage Queue. However, there are many more possibilities for using these two technologies together.<\/p>\n<p>The functionality described in this blog is available in the <a href=\"https:\/\/www.nuget.org\/packages?q=microsoft.aspnet.webhooks\">Microsoft ASP.NET WebHooks Nuget packages version 1.2.0-beta6a<\/a> \u2013 remember to set the preview flag when looking for them in Visual Studio.<\/p>\n<h3>Sending WebHooks from Web Server<\/h3>\n<p>As described in the blog <a href=\"http:\/\/blogs.msdn.com\/b\/webdev\/archive\/2015\/09\/15\/sending-webhooks-with-asp-net-webhooks-preview.aspx\">Sending WebHooks with ASP.NET WebHooks Preview<\/a>, the basic model for sending WebHooks works as illustrated in this diagram:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/7635.WebHooksSender_thumb_1CA3CB64.png\"><img decoding=\"async\" title=\"WebHooksSender\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;float: none;padding-top: 0px;padding-left: 0px;margin: 0px auto;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"WebHooksSender\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/7635.WebHooksSender_thumb_1CA3CB64.png\" width=\"600\" height=\"228\" \/><\/a><\/p>\n<p>Here we have a regular Web site (for example deployed in Azure) with support for registering WebHooks. WebHooks are triggered as a result of incoming HTTP requests, typically through an MVC controller or a WebAPI controller. The orange blocks are the core abstractions provided by ASP.NET WebHooks:<\/p>\n<ol>\n<li><a href=\"https:\/\/github.com\/aspnet\/\">IWebHookStore<\/a>: An abstraction for storing WebHook registrations persistently. Out of the box we provide support for <a href=\"http:\/\/blogs.msdn.com\/b\/webdev\/archive\/2015\/09\/15\/sending-webhooks-with-asp-net-webhooks-preview.aspx\">Azure Table Storage<\/a> and <a href=\"http:\/\/blogs.msdn.com\/b\/webdev\/archive\/2015\/11\/07\/updates-to-microsoft-asp-net-webhooks-preview.aspx\">SQL<\/a> but the list is open-ended. <\/li>\n<li><a href=\"https:\/\/github.com\/aspnet\/\">IWebHookManager<\/a>: An abstraction for determining which WebHooks should be sent as a result of an event notification being generated. The manager can match event notifications with registered WebHooks as well as applying filters. <\/li>\n<li><a href=\"https:\/\/github.com\/aspnet\/\">IWebHookSender<\/a>: An abstraction for sending WebHooks determining the retry policy and error handling as well as the actual shape of the WebHook HTTP requests. Out of the box we provide support for immediate transmission of WebHooks as well as a queuing model which can be used for scaling up and out, see the blog <a href=\"http:\/\/blogs.msdn.com\/b\/webdev\/archive\/2015\/12\/31\/new-year-updates-to-asp-net-webhooks-preview.aspx\">New Year Updates to ASP.NET WebHooks Preview<\/a> for details. <\/li>\n<\/ol>\n<p>The registration process can happen through any number of mechanisms as well. Out of the box we support registering WebHooks through a REST API but you can also build registration support as an MVC controller or anything else you like.<\/p>\n<h3>Sending WebHooks From WebJobs<\/h3>\n<p>The WebHook abstractions for the WebJob are the same as for the Web site allowing you to manage and send WebHooks in an identical manner. The difference is that you can now send WebHooks not just as a result of incoming HTTP requests but also as a result of messages being sent on a queue, a blob being created, or anything else that can trigger a WebJob:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/6683.WebHooksWebJobsSender_thumb_5C017EF4.png\"><img decoding=\"async\" title=\"WebHooksWebJobsSender\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;float: none;padding-top: 0px;padding-left: 0px;margin: 0px auto;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"WebHooksWebJobsSender\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/6683.WebHooksWebJobsSender_thumb_5C017EF4.png\" width=\"600\" height=\"311\" \/><\/a><\/p>\n<h3>Creating an Azure WebJob<\/h3>\n<p>In the blog <a href=\"http:\/\/blogs.msdn.com\/b\/webdev\/archive\/2014\/11\/12\/new-developer-and-debugging-features-for-azure-webjobs-in-visual-studio.aspx\">New Developer and Debugging Features for Azure WebJobs in Visual Studio<\/a>, you will find a great overview of how to create an Azure WebJob using Visual Studio. This can be used to set up a Command Line project including the <a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.Azure.WebJobs\/\">Microsoft.Azure.WebJobs Nuget package<\/a>. Alternatively you can see <a href=\"https:\/\/github.com\/aspnet\/WebHooks\/tree\/dev\/samples\/CustomSender.WebJob\">this sample project<\/a> which contains the code below:<\/p>\n<p>The project contains three pieces:<\/p>\n<ol>\n<li>An App.config file where we configure the WebJob; <\/li>\n<li>The usual Program static class with a Main entry method to the application; <\/li>\n<li>A Function class where we will add a method to be invoked when a message arrives on a given Azure Storage Queue. <\/li>\n<\/ol>\n<p>To configure the WebJob, we set three connection strings in the App.config file:<\/p>\n<div id=\"codeSnippetWrapper\">\n<pre id=\"codeSnippet\"><span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #800000\">connectionStrings<\/span><span style=\"color: #0000ff\">&gt;<\/span><br \/>  <span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #800000\">add<\/span> <span style=\"color: #ff0000\">name<\/span><span style=\"color: #0000ff\">=&quot;AzureWebJobsDashboard&quot;<\/span> <span style=\"color: #ff0000\">connectionString<\/span><span style=\"color: #0000ff\">=&quot;DefaultEndpointsProtocol=https;\u2026&quot;<\/span> <span style=\"color: #0000ff\">\/&gt;<\/span><br \/>  <span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #800000\">add<\/span> <span style=\"color: #ff0000\">name<\/span><span style=\"color: #0000ff\">=&quot;WebHookListener&quot;<\/span> <span style=\"color: #ff0000\">connectionString<\/span><span style=\"color: #0000ff\">=&quot;DefaultEndpointsProtocol=https;\u2026&quot;<\/span> <span style=\"color: #0000ff\">\/&gt;<\/span><br \/>  <span style=\"color: #0000ff\">&lt;<\/span><span style=\"color: #800000\">add<\/span> <span style=\"color: #ff0000\">name<\/span><span style=\"color: #0000ff\">=&quot;MS_AzureStoreConnectionString&quot;<\/span> <span style=\"color: #ff0000\">connectionString<\/span><span style=\"color: #0000ff\">=&quot;UseDevelopmentStorage=true;&quot;<\/span> <span style=\"color: #0000ff\">\/&gt;<\/span><br \/><span style=\"color: #0000ff\">&lt;\/<\/span><span style=\"color: #800000\">connectionStrings<\/span><span style=\"color: #0000ff\">&gt;<\/span><br \/><\/pre>\n<p><\/div>\n<div>The first two must be pointing to an actual Azure Storage Account, not the local storage emulator. If you don\u2019t already have an Azure Storage Account, then create one through the <a href=\"https:\/\/portal.azure.com\">Azure Portal<\/a>. Once created you can find the connection string under the <strong>Settings\/Keys<\/strong> menu for the Azure Storage Account in the portal:<\/div>\n<div>&#160;<\/div>\n<div><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/0005.AzureStorageConnectionString_thumb_5828586C.png\"><img decoding=\"async\" title=\"AzureStorageConnectionString\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;float: none;padding-top: 0px;padding-left: 0px;margin: 0px auto;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"AzureStorageConnectionString\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/0005.AzureStorageConnectionString_thumb_5828586C.png\" width=\"600\" height=\"329\" \/><\/a><\/div>\n<div>&#160;<\/div>\n<div>The <strong>AzureWebJobsDashboard<\/strong> connection string is used by WebJobs to communicate with the WebJobs Dashboard where you can see what the WebJob is doing. You can find the link to the dashboard in the <a href=\"https:\/\/portal.azure.com\">Azure Portal<\/a> once you have deployed the WebJob. <\/div>\n<div>&#160;<\/div>\n<div>The <strong>WebHookListener<\/strong> connection string is where the WebJob will listen for trigger messages. This also must be an actual Azure Storage Account but it can be the same as for the dashboard.<\/div>\n<div>&#160;<\/div>\n<div>The <strong>MS_AzureStoreConnectionString<\/strong> connection string is where WebHook registrations are stored \u2013 this can just be the local storage emulator as indicated above.<\/div>\n<div>&#160;<\/div>\n<div>The <strong>Main<\/strong> method is used to initialize the WebJob and the WebHookManager so that we can send WebHooks from the WebJob:<\/div>\n<div>&#160;<\/div>\n<div id=\"codeSnippetWrapper\">\n<pre id=\"codeSnippet\"><span style=\"color: #0000ff\">internal<\/span> <span style=\"color: #0000ff\">class<\/span> Program<br \/>{<br \/>    <span style=\"color: #008000\">\/\/\/ &lt;summary&gt;<\/span><br \/>    <span style=\"color: #008000\">\/\/\/ Gets or sets the &lt;see cref=&quot;IWebHookManager&quot;\/&gt; instance to use.<\/span><br \/>    <span style=\"color: #008000\">\/\/\/ &lt;\/summary&gt;<\/span><br \/>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">static<\/span> IWebHookManager Manager { get; set; }<br \/> <br \/>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">static<\/span> <span style=\"color: #0000ff\">void<\/span> Main(<span style=\"color: #0000ff\">string<\/span>[] args)<br \/>    {<br \/>        <span style=\"color: #008000\">\/\/ Set up default WebHook logger<\/span><br \/>        ILogger logger = <span style=\"color: #0000ff\">new<\/span> TraceLogger();<br \/> <br \/>        <span style=\"color: #008000\">\/\/ Set the WebHook Store we want to get WebHook subscriptions from. Azure store requires<\/span><br \/>        <span style=\"color: #008000\">\/\/ a valid Azure Storage connection string named MS_AzureStoreConnectionString.<\/span><br \/>        IWebHookStore store = AzureWebHookStore.CreateStore(logger);<br \/> <br \/>        <span style=\"color: #008000\">\/\/ Set the sender we want to actually send out the WebHooks. We could also <\/span><br \/>        <span style=\"color: #008000\">\/\/ enqueue messages for scale out.<\/span><br \/>        IWebHookSender sender = <span style=\"color: #0000ff\">new<\/span> DataflowWebHookSender(logger);<br \/> <br \/>        <span style=\"color: #008000\">\/\/ Set up WebHook manager which we use for creating notifications.<\/span><br \/>        Manager = <span style=\"color: #0000ff\">new<\/span> WebHookManager(store, sender, logger);<br \/> <br \/>        <span style=\"color: #008000\">\/\/ Initialize WebJob<\/span><br \/>        var listener = ConfigurationManager.ConnectionStrings[<span style=\"color: #006080\">&quot;WebHookListener&quot;<\/span>].ConnectionString;<br \/>        JobHostConfiguration config = <span style=\"color: #0000ff\">new<\/span> JobHostConfiguration<br \/>        {<br \/>            StorageConnectionString = listener<br \/>        };<br \/>        JobHost host = <span style=\"color: #0000ff\">new<\/span> JobHost(config);<br \/>        host.RunAndBlock();<br \/>    }<br \/>}<br \/><\/pre>\n<p><\/div>\n<div>To facilitate running WebJobs in development mode, you can enable the <strong>JobHostConfiguration.UseDevelopmentSettings<\/strong> flag which sets polling frequency and other properties. For more information about running WebJobs in development mode, please see the documentation on <a href=\"https:\/\/github.com\/Azure\/azure-webjobs-sdk\/wiki\/Running-Locally\">Development Settings<\/a>.<\/div>\n<div>&#160;<\/div>\n<div>Last step is to define a method that is triggered when a message arrives on the <strong>listener<\/strong> queue on the <strong>WebHookListener<\/strong> connection string:<\/div>\n<div>&#160;<\/div>\n<div id=\"codeSnippetWrapper\">\n<pre id=\"codeSnippet\"><span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">class<\/span> Functions<br \/>{<br \/>    <span style=\"color: #008000\">\/\/\/ &lt;summary&gt;<\/span><br \/>    <span style=\"color: #008000\">\/\/\/ This method is triggered when a message arrives on the 'listener' queue on the<\/span><br \/>    <span style=\"color: #008000\">\/\/\/ the 'WebHookListener' Azure Storage Account. <\/span><br \/>    <span style=\"color: #008000\">\/\/\/ &lt;\/summary&gt;<\/span><br \/>    <span style=\"color: #0000ff\">public<\/span> <span style=\"color: #0000ff\">static<\/span> async Task ProcessAsync([QueueTrigger(<span style=\"color: #006080\">&quot;listener&quot;<\/span>)] <span style=\"color: #0000ff\">string<\/span> message, TextWriter logger)<br \/>    {<br \/>        await logger.WriteLineAsync(message);<br \/> <br \/>        <span style=\"color: #008000\">\/\/ Send message to all subscribers as WebHooks. Use a predicate to filter<\/span><br \/>        <span style=\"color: #008000\">\/\/ which receivers should get a WebHook request.<\/span><br \/>        await Program.Manager.NotifyAllAsync(<span style=\"color: #006080\">&quot;event1&quot;<\/span>, <span style=\"color: #0000ff\">new<\/span> { Message = message });<br \/>    }<br \/>}<\/pre>\n<p><\/div>\n<h3>Trying It Out<\/h3>\n<p>As there are several moving parts in getting this up and running, we will focus on the already existing sample code that you can find in the <a href=\"https:\/\/github.com\/aspnet\/WebHooks\">Microsoft ASP.NET WebHooks GitHub repository<\/a>:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/aspnet\/WebHooks\/tree\/dev\/samples\/CustomSender.WebJob\">CustomSender.WebJob<\/a>: The WebJob project described above. <\/li>\n<li><a href=\"https:\/\/github.com\/aspnet\/WebHooks\/tree\/dev\/samples\/CustomSender\">CustomSender<\/a>: A Web project having been set up to register and generate WebHooks as described in <a href=\"http:\/\/blogs.msdn.com\/b\/webdev\/archive\/2015\/09\/15\/sending-webhooks-with-asp-net-webhooks-preview.aspx\">Sending WebHooks with ASP.NET WebHooks Preview<\/a>. <\/li>\n<li><a href=\"https:\/\/github.com\/aspnet\/WebHooks\/tree\/dev\/samples\/CustomReceiver\">CustomReceiver<\/a>: A WebHooks receiver project which can receive WebHooks sent by the WebJob and the Web Application. <\/li>\n<\/ul>\n<p>To get the pieces put together, clone the <a href=\"https:\/\/github.com\/aspnet\/WebHooks\">ASP.NET WebHooks repository<\/a> and open the <strong>WebHooks<\/strong> solution in Visual Studio. Configure the connection string settings for the WebJob as described above by editing the <strong>App.config<\/strong> file.<\/p>\n<p>Now right-click on the solution in the <strong>Solution Explorer<\/strong>, select <strong>Set Startup Projects<\/strong> to include all three projects like this:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/6014.WebJobsStartupProjects_thumb_299DAB75.png\"><img decoding=\"async\" title=\"WebJobsStartupProjects\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;float: none;padding-top: 0px;padding-left: 0px;margin: 0px auto;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"WebJobsStartupProjects\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/6014.WebJobsStartupProjects_thumb_299DAB75.png\" width=\"500\" height=\"363\" \/><\/a><\/p>\n<p>Now hit F5 to start the projects. You should see the WebJob starting up in a command line shell:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/7178.WebJobConsole_thumb_0C2B5A69.png\"><img decoding=\"async\" title=\"WebJobConsole\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;float: none;padding-top: 0px;padding-left: 0px;margin: 0px auto;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"WebJobConsole\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/7178.WebJobConsole_thumb_0C2B5A69.png\" width=\"500\" height=\"260\" \/><\/a><\/p>\n<p>To verify that you receive WebHooks in the <strong>CustomReceiver<\/strong> project, set a breakpoint in the <strong>CustomWebHookHandler<\/strong> class like this:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/1738.WebHookHandler_thumb_0BBF2774.png\"><img decoding=\"async\" title=\"WebHookHandler\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;float: none;padding-top: 0px;padding-left: 0px;margin: 0px auto;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"WebHookHandler\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/1738.WebHookHandler_thumb_0BBF2774.png\" width=\"500\" height=\"276\" \/><\/a><\/p>\n<p>Similarly you should see <strong>CustomSender<\/strong> project starting up with a Web page like this. Click on the buttons marked in red in the order illustrated here:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/3225.WebJobsRegister_thumb_204476F2.png\"><img decoding=\"async\" title=\"WebJobsRegister\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;float: none;padding-top: 0px;padding-left: 0px;margin: 0px auto;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"WebJobsRegister\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/3225.WebJobsRegister_thumb_204476F2.png\" width=\"600\" height=\"408\" \/><\/a><\/p>\n<p>If everything is working OK, then the debugger should hit the breakpoint in the WebHook handler. This means that sending WebHooks from the Web Application works. Next, let\u2019s try and generate a WebHook from the WebJob. First we need to create a queue called <strong>listener<\/strong> in the Azure Storage Account we provided in the <strong>App.config<\/strong> file. You can do that from the <strong>Cloud Explorer<\/strong> in Visual Studio by right-clicking on the Azure Storage Account and create a queue:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/3731.QueueCloudExplorer_thumb_62B71928.png\"><img decoding=\"async\" title=\"QueueCloudExplorer\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;float: none;padding-top: 0px;padding-left: 0px;margin: 0px auto;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"QueueCloudExplorer\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/3731.QueueCloudExplorer_thumb_62B71928.png\" width=\"233\" height=\"390\" \/><\/a><\/p>\n<p>With the queue in place we can submit a message by double clicking on it and then add a message:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/8105.ListenerQueue_thumb_696A22AB.png\"><img decoding=\"async\" title=\"ListenerQueue\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;float: none;padding-top: 0px;padding-left: 0px;margin: 0px auto;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"ListenerQueue\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/8105.ListenerQueue_thumb_696A22AB.png\" width=\"600\" height=\"331\" \/><\/a><\/p>\n<p>Once added, it will take some seconds but then you should see the message being sent to the WebHook receiver:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/5305.WebJobWebHookMessage_thumb_16EB426F.png\"><img decoding=\"async\" title=\"WebJobWebHookMessage\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;float: none;padding-top: 0px;padding-left: 0px;margin: 0px auto;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"WebJobWebHookMessage\" src=\"https:\/\/devblogs.microsoft.com\/aspnet\/wp-content\/uploads\/sites\/16\/2016\/01\/5305.WebJobWebHookMessage_thumb_16EB426F.png\" width=\"600\" height=\"330\" \/><\/a><\/p>\n<p>That is, now you can send WebHooks from WebJobs as well as from Web Applications!<\/p>\n<p>Have fun!<\/p>\n<p>Henrik<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Azure WebJobs is a great way for running any kind of script or executable as a background process in connection with an Azure App Service Web Site or App. You can upload an executable or script as a WebJob and run it either on a schedule or continuously. The WebJob can perform any function you [&hellip;]<\/p>\n","protected":false},"author":403,"featured_media":58792,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[34,7505,7506,7508],"class_list":["post-6123","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspnet","tag-asp-net-web-api","tag-asp-net-webhooks","tag-webhooks","tag-webjobs"],"acf":[],"blog_post_summary":"<p>Azure WebJobs is a great way for running any kind of script or executable as a background process in connection with an Azure App Service Web Site or App. You can upload an executable or script as a WebJob and run it either on a schedule or continuously. The WebJob can perform any function you [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/6123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/403"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=6123"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/6123\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=6123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=6123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=6123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}