[英]Azure Function SignalR | negotiate function | Fails with 500 error code
[英]How to authenticate the connections made to Azure Function (negotiate) from angular application which in turn connects with Azure SignalR Service?
我有一個與 Azure Function (negotiate) 通信的 Angular 應用程序(Azure AD 認證),后者又與 Azure SignalR 服務連接。 Azure Function 和 Azure SignalR 服務之間的通信基於與 Azure SignalR 服務關聯的密鑰。 在這種情況下,我想知道如何驗證從 Angular 應用程序向 Azure Function (negotiate) 端點發出的請求。
任何人都可以幫助我指導如何實施它。
這里客戶端基本上會使用該函數連接到 Signalr 服務。
在我們可以首先廣播消息之前,我們需要建立與 Signalr 的連接,然后我們才能使用 Signalr 服務。
在客戶端:
const connection_to_signalR = new signalR.HubConnectionBuilder() .withUrl(function_url + '/api') .configureLogging(signalR.LogLevel.Information) .build();
connection_to_signalR.on('message',(message_to_be_send)=>{
// this is a callback function to send the message
});
connection_to_signalR.start() .catch(console.error);
請參閱 jason Roberts 的以下文章
請參閱以下文檔
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.