Signalr self-hosted Hub in an Azure Web Job requires elevation?

azure, azure-webjobs, signalr, signalr-hub

Solution

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.

Problem

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(); } } } } ```

Original source