1

I have an Azure Data Factory pipeline that includes a Web activity. The Web activity sends a request to an Azure Function App. ADF automatically adds an 'Expect' request header. The function app is not designed to handle the 'Expect' request header and subsequently returns an internal failure message (code 500).

I wrote another function app that logs the header values to prove that ADF is adding the 'Expect' request header even for simple requests where the content-type=text/plain and the body="test".

How do I tell ADF not to send the 'Expect' request header?

sartoris
  • 634
  • 6
  • 19
  • Is the answer provided by SwethaKandikonda-MT was helpful for you ? if so could you please accept the answer ( click on the check mark beside the answer to toggle it from greyed out to filled in.) as solution for your ask. This could be beneficial to other community members. – MadhurajVadde-MT Jun 25 '21 at 11:36

1 Answers1

0

If the Expect100Continue property is true, the request headers are sent to the server. If the server has not rejected the request, it sends a 100-Continue response signaling that the data can be transmitted.

So, try adding this

_request.ServicePoint.Expect100Continue = false;

This will disable the Expect: 100-continue for a particular HttpWebRequest instance.

For further reference you can refer the thread attached : c# - Expect: 100-continue - Stack Overflow

SwethaKandikonda-MT
  • 3,427
  • 1
  • 3
  • 14
  • I am using the ADF designer in the Azure Portal. I do not see this property. – sartoris Jun 28 '21 at 16:04
  • @sartoris Try this way, Go to your function -> On the left pane click on **Functions** -> Click on your function -> then add `req.ServicePointManager.Expect100Continue=false;` in **Code + Test** . – SwethaKandikonda-MT Jun 29 '21 at 13:18
  • I was hoping to find a way to turn it off on the client (ADF) side without requiring changes to the Function App running on the server side. We wound up changing the Function to fix the problem but it does not address the issue with ADF. I was hoping to avoid having to rewrite any other Function App in the future because we may not be able to rewrite a 3rd party web app. – sartoris Jun 29 '21 at 17:50