I am trying to call an API within a Foreach Activity and I am struggling to configure the webhook. Pipeline in summary:
- Mapping Data Flow reads a file and constructs a JSON object array in the desired format. The output is set to Cache and Write to activity output.
- Foreach Activity iterates over the Cache object and within that I am trying to setup a webhook activity
I initially tried to configure a Linked Service for a REST connection and I get the following error:
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:
- Do I need a Linked Service and if so, how should the Audience be configured?
- How do I set up the webhook to pass in the JSON message per iteration along with client secrets and Audience?
I am trying to call an API within a Foreach Activity and I am struggling to configure the webhook. Pipeline in summary:
- Mapping Data Flow reads a file and constructs a JSON object array in the desired format. The output is set to Cache and Write to activity output.
- Foreach Activity iterates over the Cache object and within that I am trying to setup a webhook activity
I initially tried to configure a Linked Service for a REST connection and I get the following error:
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:
- Do I need a Linked Service and if so, how should the Audience be configured?
- How do I set up the webhook to pass in the JSON message per iteration along with client secrets and Audience?
- Can you provide the webhook activity configurations? – Rakesh Govindula Commented Nov 18, 2024 at 14:33
- No I cannot Rakesh as that is part of my question, I don't know how to configure it – Raymondo Commented Nov 18, 2024 at 14:35
1 Answer
Reset to default 1AFAIK, 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.
Inside the for-each activity, you can directly give the service principal id and secret value and give https://management.azure
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.