0
votes

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.

1
Is there a specific reason you dont use a webhook? I never had problems using webhooks to run Automation jobs - Martin Esteban Zurita
Thanks for your answer, we've use webhooks in the past but they require extra configuration in the automation account side. Interacting directly with the Automation Account API gives you much more control and flexibility. Jobs are monitored during the run, pipeline keeps running because an "until" activity that checks the status of the job, we can easily retry from Data Factory... So yes, Webhook are an option that we have already tested and discarded. Can a webhook fix this issue? Yes it can, because we avoid using the content-type header, but that doesn't solve the overall issue. - Juanjo Campillo
I know its a workaround, thats why I asked as a comment and not as an answer. Just a FYI, you can use a webhook Activity to get that pipeline running until it the script finishes. mrpaulandrew.com/2019/06/18/… I'll try to investigate on this content-type issue now - Martin Esteban Zurita
I wasn't aware about that functionality (ADF Callback url) using webhooks, for sure something I'll consider if this issue can't be fix in a timely manner. I guess if all people is facing the same issue next step will be get in contact with Microsoft. Thanks for the link, it will be very useful. - Juanjo Campillo

1 Answers

0
votes

Answer from the ADF platform team:

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

It seems that they accepted "Content-type" before, as it was working several months with that config, but not anymore. So if someone experiences the same problem, here is the answer.

Thanks.