0

I wanted to use an Azure HTTP function combined with a MailChimp Webhook.

Azure expects a security token to be sent with requests to the function as a header.

I am unable to see how to specify headers when creating the MailChimp Webhook.

Does anyone know if it's possible?

The other option is to somehow configure the function not to expect a security token?

4
  • Can't it be just passed as HTTP query parameter (so, as part of webhook URL)? Commented Mar 7, 2018 at 13:20
  • I cannot find any azure documentation to say that can be done. It appears it needs to be a header :( Commented Mar 7, 2018 at 13:25
  • You can call HTTP with https://<yourapp>.azurewebsites.net/api/<function>?code=<ApiKey> Commented Mar 7, 2018 at 13:27
  • @Mikhail you are correct! Thank you so much. Please suggest this as answer so I can give you points! Commented Mar 7, 2018 at 13:36

2 Answers 2

2

Azure Function Webhook is essentially an HTTP triggered Azure Function. It can accept the secret code as HTTP query parameter:

  1. Create an HTTP triggered function.
  2. Set authentication to Function
  3. Click on Get function URL button to get your URL in format https://<yourapp>.azurewebsites.net/api/<function>?code=<ApiKey>
  4. Put this URL into Mailchimp's webhook Callback URL
Sign up to request clarification or add additional context in comments.

Comments

0

I have disabled the security on the function using AuthorizationLevel.Anonymous

[FunctionName("Unsubscribe")]
public static HttpResponseMessage Unsubscribe([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)]HttpRequestMessage req, TraceWriter log)
{
    return req.CreateResponse(HttpStatusCode.OK);
}

SEE THE ACCEPTED ANSWER ABOVE. THIS IS NOT ADVISABLE

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.