Search code examples
azure-data-factoryrbacazure-eventgridazure-managed-identity

Send Events to Event Grid Topic from ADF Web activity with MSI authentication


I wish to send an event from ADF "Web" Activity to event grid topic. I managed to do it with sending "aeg-sas-key" from web activity as documented here. However, I tried to achieve the same through ADF Web activity without using "aeg-sas-key" but Authentication as managed identity

enter image description here

But it gives me below error:

{ "error": { "code": "Unauthorized", "message": "Request has an unsupported Authorization scheme:Bearer. Authorization scheme must be SharedAccessSignature. Report 'a2af905c-e3ca-401a-be09-3f0b3c6b7d4e:8:5/20/2021 2:00:24 PM (UTC)' to our forums for assistance or raise a support ticket."

I have added the managed Identity Application of ADF to Event Grid topic with contributor role, but it still does not work. Am I missing something?

enter image description here

To be short, I need to know how to send events to Event Grid topic from ADF Web Activity using Managed Identity Authentication?


Solution

  • Not all the APIs in Azure support MSI auth, just the APIs secured by Azure AD support that, essentially the MSI auth uses the Azure AD client credential flow to get the token, then use the token to call the API.

    In this case, as mentioned in the error message, to send an event to your topic, it uses aeg-sas-key to auth, i.e. Basic auth, it does not support the Azure AD auth which means it also could not use MSI to auth.