Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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();
            }
        }
    }
}
like image 876
Jarem Avatar asked Jul 11 '14 15:07

Jarem


People also ask

What is azure SignalR service?

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.

What is Azure Web job storage?

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.


1 Answers

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.

like image 200
Jarem Avatar answered Oct 11 '22 15:10

Jarem