0

I have a angular application (Azure AD authenticated) which communicates with Azure Function (negotiate) which in turns connects with Azure SignalR service. The communication between Azure Function and the Azure SignalR service happens based on the keys that are associated with the Azure SignalR service. In this case I wanted to know how to authenticate the requests that are made from angular app to the Azure Function (negotiate) endpoint.

Can anyone help me with their guidance on how to implement it.

santosh kumar patro
  • 7,231
  • 22
  • 71
  • 143

1 Answers1

-1

Here the client will basically use the function to connect to the Signalr service.

Before we can broadcast the messages first, we need to establish a connection to the SignaIr after that we can use the Signalr services.

On client side :

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);

Refer the following article by jason Roberts

Refer the following documentation

Mohit Ganorkar
  • 1,917
  • 2
  • 6
  • 11
  • Thanks @MohitGanorkar-MT for your response. In this implementation I want to limit the access requests only to this angular application only. Is there any other way to implement security restrictions apart from CORS settings at Azure Function app level. Any help on tis request is much appreciated. – santosh kumar patro Jul 01 '22 at 20:08