azure-data-factory

Data Factory Webhook and Audience


I am trying to call an API within a Foreach Activity and I am struggling to configure the webhook. Pipeline in summary:

I initially tried to configure a Linked Service for a REST connection and I get the following error: enter image description here

Failed to get access token from your token endpoint. Error returned from your authorization server: {"error":"access_denied","error_description":"No audience parameter was provided, and no default audience has been configured"}.
Processed HTTP request failed.

Reviewing the webhook, there isn't an obvious way to connect it to the Linked Service, even if the Linked Service worked and from what I can see, the Webhook works independently, from a Linked Service. I can't see an obvious like for like in the Webhook to use a ClientID, Client secret, URL and Audience i.e. OAuth. Frustratingly it wants me to create a Key Vault just to store the Client Secret which is a huge constraints for anyone developing or PoC work!

I can't see much on the net that covers the setup for this, so in summary:


Solution

  • AFAIK, the linked service is not needed for the webhook activity. You can directly use the authentication options that are given the webhook activity.

    As you have the client id and client secret of the service principal, you can use the Service principal authentication in the webhook activity.

    enter image description here

    Inside the for-each activity, you can directly give the service principal id and secret value and give https://management.azure.com for the Resource.

    If you want to avoid hardcoding the secret values, you can make use of the Azure Key vault here.

    You can also use Bearer token for the authentication. Use a web activity to generate the bearer token before the webhook activity using your client id and client secret.

    You can go through this documentation for more information about the authentication types of the webhook activity.