I'd like to use a SignalR self hosted project in a continuous Azure Web Job. But when I attempt to run it, I get the following error:
[07/11/2014 10:58:44 > cbec50: SYS INFO] Status changed to Running
[07/11/2014 10:58:45 > cbec50: ERR ] Unhandled Exception: System.Reflection.TargetInvocationException:
Exception has been thrown by the target of an invocation. ---> System.Net.HttpListenerException: Access is denied
I suppose the console app needs to run with elevated rights. Is there any way to get this to work?
Prerequisites:
Install-Package Microsoft.Azure.Jobs -pre
Install-Package Microsoft.AspNet.SignalR.SelfHost
Full source:
using System;
using Microsoft.Azure.Jobs;
using Microsoft.Owin.Hosting;
using Owin;
namespace ConsoleApplication2
{
class Startup
{
public void Configuration(IAppBuilder app)
{
app.MapSignalR();
}
}
class Program
{
static void Main(string[] args)
{
using (WebApp.Start<Startup>("http://localhost:8080/"))
{
Console.WriteLine("Server running at http://localhost:8080/");
var host = new JobHost();
host.RunAndBlock();
}
}
}
}
Azure SignalR Service simplifies the process of adding real-time web functionality to applications over HTTP. This real-time functionality allows the service to push content updates to connected clients, such as a single page web or mobile application.
An Azure storage account provides resources for storing queue and blob data in the cloud. It's also used by the WebJobs SDK to store logging data for the dashboard. Refer to the getting started guide and documentation for further information.
Got a response from David Ebbo (@davidebbo):
"...you can only listen on a port through IIS.
WebJobs are more to do work and not run services."
I had considered web jobs as a good way to host a Signalr Hub without the an entire website footprint, but I'll need to find an alternative.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With