Signalr gives 405 Method Not Allowed

OrenA 21 Reputation points
2022-04-12T13:08:26.77+00:00

Trying to deploy my website to Azure, Signalr gives the following errors on the browser:

Failed to load resource: the server responded with a status of 405 (Method Not Allowed)
For this call:

hubs/presence/negotiate?negotiateVersion=1:1
Followed by:

Error: Failed to complete negotiation with the server: Error: The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used.: Status code '405'
Here are the endpoints:

app
                .UseEndpoints(endpoints =>
                {
                    endpoints.MapControllers();
                    endpoints.MapHub<PresenceHub>("hubs/presence");
                });

The website works on https, and the urls are defined as follows:

export const environment = {
  production: true,
  apiUrl:'https://vidcallme.azurewebsites.net/api/',
  hubUrl:'https://vidcallme.com/hubs/',
  baseUrl:'/'
};

The api works, the hub doesn't.

Here's the Api web.config

<system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath="dotnet" arguments=".\API.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
    </system.webServer>

The client is written with Angular

Related: SignalR Error 405 (method not allowed) - Negotiate.

I'm Using .net Core 5.0

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,188 questions
Azure SignalR Service
Azure SignalR Service
An Azure service that is used for adding real-time communications to web applications.
120 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,909 questions
{count} votes