0
votes

Hi I have azure data factory which will be triggered by users which they are authenticated via azure ad implicit flow. ADF after the run will send events to service bus. Now I have to write azure function app based on the service bus trigger. In app function I want to send notification to users via signal r. But my problem is whoever triggered adf for them only I need to send notification. UI will trigger adf and adf will send events to service bus and in this flow UI will send user information to adf and adf will send user information to service bus event also. But In azure function app I want to send notification to only those user who triggered ADF.

public void BroadcastMessage(string message)
    {
        Clients.Caller.SendAsync("broadcastMessage", message);
    }

Currently above code I am using in my other application which will send notification to web app. When coming to azure function app how can I send notification to only specific user who triggered ADF. I have seen several example with azure app service authentication but not with azure ad. My front end is currently having azure ad authentication and deployed in app service but I do not have app service authentication.Can someone help me is it possible or what would be the correct approach? Any help would be greatly appreciated. Thank you

1

1 Answers

0
votes

The negotiate endpoint accepts a UserId parameter that could pass around to later identify the user to notify.

While the example is fetching the user identity for app service, you could leverage runtime binding if you are using C#. For non-C# languages, you could have an "internal" negotiate function that is called by the "external" negotiate function passing in the extracted user identity from the JWT token.

With this, you could extract the same user identity in the function that initiates the ADF pipeline passing this value, which ADF could include in the service bus messages it sends later on.