Closed Vikas252 closed 1 year ago
https://
.service.signalr.net/negotiate?negotiateVersion=1
It looks like you're trying to connect directly to the Azure SignalR Service which generally doesn't work. In serverless mode you usually setup an Azure Functions endpoint to connect your client to: https://learn.microsoft.com/azure/azure-signalr/signalr-quickstart-azure-functions-csharp?tabs=in-process
@BrennanConroy thank you for the quick reply i followed the steps mentioned on the above tutorial the connection string is giving and error now
The error:
Executed 'Functions.negotiate' (Failed, Id=<invocationID_Function_App>, Duration=41ms)
[2023-06-15T11:51:14.860Z] System.Private.CoreLib: Exception while executing function: Functions.negotiate. Microsoft.Azure.SignalR.Common: Connection string missing required properties endpoint. (Parameter 'connectionString').
fucntion.json:
{
"disabled": false,
"bindings": [
{
"type": "httpTrigger",
"direction": "in",
"name": "req",
"route": "negotiate",
"authLevel": "function",
"methods": ["post"]
},
{
"type": "http",
"direction": "out",
"name": "res"
},
{
"type": "signalRConnectionInfo",
"name": "connectionInfo",
"hubName": "serverless",
"direction": "in",
"connectionStringSetting": "AzureSignalRConnectionString",
}
],
"entryPoint": "negotiate",
"scriptFile": "../dist/server.js"
}
The environment is serverless framework with the yml file
negotiate:
handler: dist/server.negotiate
events:
- http: true
route: negotiate{any}
methods: ANY
outputs:
connectionInfo:
type: signalRConnectionInfo
name: connectionInfo
hubName: serverless
connectionStringSetting: AzureSignalRConnectionString
direction: in
local.settings.json
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "",
"FUNCTIONS_WORKER_RUNTIME": "node",
"AzureSignalRConnectionString": "Endpoint=https://<base_url>;AccessKey=<access_key_in_azure>=;Version=1.0;"
},
"Host": {
"CORS": "http://localhost:4200",
"CORSCredentials": true
}
}
Please file an issue at https://github.com/Azure/azure-signalr/issues.
Is there an existing issue for this?
Describe the bug
I have an instance of signalR hosted on azure with the free tier, for development purpose with the help of @microsoft/signalr package i have created a basic implementation to connect to the hub with the instance in typescript that is in the azure but it fails saying the following error when the skipNegotiation is not given The error:
If i add the flag of skipNegotation the error:
Expected Behavior
Should connect to the endpoint of signalR provided in the serverless websocket mode.
Steps To Reproduce
basic code
package.json:
Exceptions (if any)
I think i might be missing something very basic. Thank you in advance.
.NET Version
6.0.408
Anything else?
No response