Shared secret authorization with Azure SignalR Service
[FunctionName("negotiate")]
public SignalRConnectionInfo Negotiate([HttpTrigger(AuthorizationLevel.Anonymous)]HttpRequest req)[FunctionName("negotiate")]
public IActionResult Negotiate(
[HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequest req,
[SignalRConnectionInfo(HubName = "events")] SignalRConnectionInfo connectionInfo)
{
var expectedKey = Environment.GetEnvironmentVariable("AccessKey");
if (string.IsNullOrEmpty(expectedKey))
return new OkObjectResult(connectionInfo);
var accessKey = req.Query["accessKey"];
if (StringValues.IsNullOrEmpty(accessKey) ||
!StringValues.Equals(expectedKey, accessKey))
return new UnauthorizedResult();
return new OkObjectResult(connectionInfo);
}PreviousExploring Azure Data with Kusto and DashboardsNextUsing Azure File Copy from DevOps yaml pipeline
Last updated