title: SignalR HubConnection not receiving messages from serverless Azure SignalR service
body: <p>I have created an Azure SignalR service in serverless mode. I have a suite of functions in an Azure Function App to manage a chat service which must include groups. When publishing the Function App I set the AzureSignalRConnectionString to that set under the Keys setting in the SignalR service. I have double checked in the Azure Portal that the connectionstring is present and correct.</p>
  
  <p>I can use Postman to call the individual functions in Azure successfully and can monitor this in the Azure Portal and see logging messages etc.</p>
  
  <p>However, if I use HubConnection in the client to attempt to call a function, it does not get there. Also, messages sent successfully by Postman do not cause the hub to fire receipt.</p>
  
  <p>So the following call using the REST interface can be seen to execute from the Azure Portal:</p>
  
  <pre><code>await client.PostAsync($"{baseUrl}/api/{group}/add/{userName}", new StringContent(string.Empty));
  </code></pre>
  
  <p>however the following call using HubConnection does not trigger the same Azure Function:</p>
  
  <pre><code>await hubConnection.SendAsync("AddToGroup", group, userName);
  </code></pre>
  
  <p>The function bindings for this are:</p>
  
  <pre><code>[FunctionName("AddToGroup")]
  public static async Task&lt;IActionResult&gt; Run(
      [HttpTrigger(
      AuthorizationLevel.Anonymous, 
      "post", 
      Route = "{groupName}/add/{userId}")] 
      HttpRequest req,
      string groupName,
      string userId,
      [SignalR(HubName = Constants.HubName)]
      IAsyncCollector&lt;SignalRGroupAction&gt; signalRGroupActions,
      ILogger log)
  {
      log.LogInformation("AddToGroup invoked");
  
      await signalRGroupActions.AddAsync(
      new SignalRGroupAction
      {
          UserId = userId,
          GroupName = groupName,
          Action = GroupAction.Add
      });
  
      return new OkObjectResult("All done");
  }
  </code></pre>
  
  <p>The Function App contains a Negotiate function which is used to initialise the Hub Connection like this:</p>
  
  <pre><code>var negotiateJson = await client.GetStringAsync($"{baseUrl}/api/negotiate");
  var info = JsonConvert.DeserializeObject&lt;NegotiateInfo&gt;(negotiateJson);
  hubConnection = new HubConnectionBuilder()
      .WithUrl(info.Url, options =&gt;
      {
          options.AccessTokenProvider = () =&gt; Task.FromResult(info.AccessToken);
      })
      .Build();
  </code></pre>
  
  <p>Debugging this shows the Url to be correct and the Access Token is present.</p>
  
  <p>I am using Microsoft.AspNetCore.SignalR.Client V3.0.0 and have followed through a number of guides and samples but cannot get the Azure SignalR hub to work.</p>
  
  <p>(I have worked with hosted SignalR in the past and found it pretty straight forward but have not worked with the Azure service or Azure Functions before).</p>
  
  <p>I would be eternally grateful for any assistance or guidance.</p>
  
  <p>Thank you</p>