1

In the below code snippet, which is actually an Azure function with a ServiceBus trigger, Can I specify the hubname dynamically in the SignalROutput attribute?

[Function("NewOrderSubmitted")]
    [SignalROutput(HubName = "irishub", ConnectionStringSetting = "AzureSignalRConnectionString")]
    public SignalRMessageAction NewOrderSubmitted
   (
       [Microsoft.Azure.Functions.Worker.ServiceBusTrigger("%QueueName%", Connection = "ServiceBusConnectionString")] 
        SignalRQueueItem order,
       IBinder binder
   )
    {
        _logger.LogInformation($"newMessage called");
        return new SignalRMessageAction("newMessage")
        {
            UserId=order.UserId,
            Arguments = new[] { order },

        };
    }

This function app is written in dot-net isolated process.

Masood Bhat
  • 74
  • 1
  • 9
  • Hope this helps [MSDOC](https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-signalr-service-output?tabs=isolated-process&pivots=programming-language-csharp) and [git](https://github.com/MicrosoftDocs/azure-docs/issues?utf8=%E2%9C%93&q=%225858135e-528b-81ba-84a9-a89e8f165c36%22&in=body) – Sampath Jun 22 '23 at 04:55
  • AFIK The SignalROutput attribute in the code snippet you provided is used to specify the SignalR hub name and connection string. According to the documentation[1], you can specify the hub name dynamically by using the EventHubOutputAttribute in an isolated process. However, this attribute is not applicable to SignalR output binding. Therefore, you cannot specify the hub name dynamically in the SignalROutput attribute. other method using [this](https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/azure-functions/functions-bindings-event-hubs-output.md) – Sampath Jun 22 '23 at 10:46

0 Answers0