According to your logs, the problem appears to be caused by a missing SignalR Service connection string or endpoints. When running locally, you had a file called local.settings.json that contained your connection settings. However, because this file was not deployed when you moved to Azure, your Azure Function does not know how to connect to the SignalR Service.
Here are some points that might help you to resolve the issue:
Azure Functions and SignalR Service Setup: Your Azure Function app needs to be configured correctly to use Azure SignalR Service.
- Azure SignalR Service needs to be configured in Serverless mode when used with Azure Functions.
- Azure Functions should have a negotiate function that the client calls to obtain a valid SignalR Service access token and endpoint URL.
- Your Azure Functions app should have one or more functions that handle messages sent from SignalR Service to clients. These functions use the SignalRTrigger binding to handle messages sent from the SignalR Service.
- Use the SignalR output binding to send messages to clients connected to Azure SignalR Service.
- SignalR has a concept of hubs, which are logical namespaces that separate connections and messages. Each client connection and each message sent from Azure Functions is scoped to a specific hub.
- If you're using C#, you can use the class-based model, which simplifies many aspects of the setup. For instance, you don't need the SignalRConnectionInfo input binding and can add custom claims more easily.
Ensure the correct connection settings are used for your Azure SignalR service. This seems to be the primary issue you're encountering. When you were running locally, your Azure Functions app was able to connect to your SignalR service using settings from the local.settings.json file. However, when you deploy your Azure Functions app to Azure, the local.settings.json file does not get deployed, so your app doesn't have the connection settings it needs. To resolve this, you need to set up the necessary connection settings in the Azure portal. Go to your Azure Functions app in the portal, and under the 'Settings' section, click on 'Configuration'. Here, you can add new application settings that match the ones you had in your local.settings.json file. These settings will then be available to your Azure Functions app when it's running in Azure.
Ensure that your client application is correctly configured to connect to the Azure SignalR service. The client must make a request to the negotiate HTTP endpoint to obtain valid connection information and then connect to SignalR Service using the service endpoint URL and access token obtained from the negotiate endpoint.