question

JuanJosCampillo-6430 avatar image
0 Votes"
JuanJosCampillo-6430 asked ·

Content-type header not being sent from web activity in ADF v2

Hi everyone,

We use a web activity in ADF v2 to interact with the Azure Automation Account API (Job creation) based on this specification https://docs.microsoft.com/en-us/rest/api/automation/job/create


Since 09-04-2020 the PUT web call isn't working because the header "Content-Type : application/json" is not being sent. The pipeline that contain the activity hasn't changed in months, just stopped working suddenly with the error:

  • Operation on target Automation - AAS Processing failed: {"code":"UnsupportedMediaType","message":"{\"Message\":\"The request entity's media type 'text/plain' is not supported for this resource.\"}"}

But the input request for the pipeline, does include the header:

{
"url": "https://management.azure.com/subscriptions/xxxxx/resourceGroups/xxxxx/providers/Microsoft.Automation/automationAccounts/xxxxx/jobs/55a1bfa2-340c-4120-ba42-43df9e9f4e14?api-version=2017-05-15-preview",
"method": "PUT",
"headers": {
"Content-type": "application/json"
},
"body": "{\"properties\":{\"runbook\":{\"name\":\"aas-masterdata-management\"},\"parameters\":{\"Masterdata_Table\":\"RLS\"},\"runOn\":\"\"}}",
"authentication": {
"type": "MSI",
"resource": "https://management.azure.com"
}
}


I've tried so far:

  • Recreate the pipeline

  • Test in a different ADF instance

  • Delete and redeploy all the pipelines

  • Delete the header

  • Change the header to lowercase, uppercase, etc.

  • Add the header twice

  • Use a self-hosted integration runtime

  • Test in Debug mode

Any of these tests have been successful. Just for confirmation, I've run the same call from Postman and from the rest api debug tool included within the Api documentation, both worked perfectly, if I set the content header to text/plain in postman or in the web tool I get exactly the same error than in ADF v2. It seems that something has changed in the web call activity of ADF v2 that hardcodes the content header as "text/plain" somehow.

Is someone facing this same issue ? As I said, pipeline definition hasn't changed in months, just stopped working few days ago.

22959-adf-error.png

Thanks,
Juanjo.




azure-data-factory
adf-error.png (80.6 KiB)
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

HarithaMaddi-MSFT avatar image
0 Votes"
HarithaMaddi-MSFT answered ·

Hi @JuanJosCampillo-6430,

Thanks for the patience. I got update from Product team that using "Content-Type" instead of "Content-type" will resolve this issue. This can be referred in the documentation. Please let us know if this is helping to fix the issue. If issue persists, we will be glad to assist further.


· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for the support @HarithaMaddi-MSFT , it worked :)

IIt seems that before "Content-type" was accepted but not anymore, good to know.

Thanks again,
Juanjo.

0 Votes 0 ·
EvgeniyG avatar image
0 Votes"
EvgeniyG answered ·

Have you tried to add the header Accept?

"Accept": "application/json"


· 4 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I've just did based on your recommendation, it fails.

Just for double check, I've tested sending both headers:

"headers": {
"Content-type": "application/json",
"Accept": "application/json"
}

(In this test the error is the same:

 Operation on target Automation - AAS Processing failed: {"code":"UnsupportedMediaType","message":"{\"Message\":\"The request entity's media type 'text/plain' is not supported for this resource.\"}"}


And just the one you've recommended

"headers": {
"Accept": "application/json"
}

Just with the accept header, the error is different:

 Operation on target Automation - AAS Processing failed: {"code":"BadRequest","message":"{\"Message\":\"Model cannot be null.\"}"}

I guess because it is expecting the Content-type header




0 Votes 0 ·

Hi @JuanJosCampillo-6430,

Welcome to Microsoft Q&A Platform. Sorry that you are experiencing this issue.

I have reached out to our internal teams to understand the root cause of it and will get back to you once I hear back from them. Thanks for your patience!

1 Vote 1 ·

Thanks for the support @HarithaMaddi-MSFT

0 Votes 0 ·
Show more comments