MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.31k stars 21.49k forks source link

C# examples are missing ConnectionStringSetting, thus are currently not working examples #88219

Open alteredtastes opened 2 years ago

alteredtastes commented 2 years ago

C# examples on this page are missing the `ConnectionStringSetting = parameter that should be passed alongside HubName. Other language examples show that the connection string reference is required but C#'s examples do not.

For example, SendToGroup should be

[FunctionName("SendMessage")]
public static Task SendMessage(
    [HttpTrigger(AuthorizationLevel.Anonymous, "post")]object message,
    [SignalR(ConnectionStringSetting = <SIGNAL_R_CONNECTION_STRING>, HubName = "chat")]IAsyncCollector<SignalRMessage> signalRMessages)
{
    return signalRMessages.AddAsync(
        new SignalRMessage
        {
            // the message will be sent to the group with this name
            GroupName = "myGroup",
            Target = "newMessage",
            Arguments = new [] { message }
        });
}

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

MayankBargali-MSFT commented 2 years ago

@alteredtastes Thank you for your feedback! We will review and update as appropriate.