Post file from Blob to Web Activity in Azure Data Factory

DannyV-2978 6 Reputation points
2020-11-18T18:07:29.137+00:00

Hi,
I have been working on this problem for days, weeks and I can't seem to get it right.
What I am trying to do is send a file from a blob storage to a website using Web activity on ADF.
Attached is what I have so far. I can't figure out what should go in the body and how do I reference the blob.

Thanks in advance
Danny V

40857-image.png

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,991 questions
0 comments No comments
{count} votes

6 answers

Sort by: Most helpful
  1. MartinJaffer-MSFT 26,106 Reputation points
    2020-11-19T19:18:54.54+00:00

    Hello @Anonymous and welcome to Microsoft Q&A. Thank you for your question.

    I will inquire internally as to how the linked service and dataset features of the web activity are supposed to be used.

    In the meantime, I will provide you with a solution I am certain will work.

    Use 2 Web activities. The first fetches the data from the blob. The second web activity takes the output of the first activity, and uses it as body.

    In the below example I use another blob to stand in for the website. (It effectively copies the blob).
    Here for fetching the blob the URL takes the form of :

    https://<storageAccountName>.blob.core.windows.net/<containerName>/<folder>/<file>

    I also use MSI authentication. For this to work, you will need to go to the storage account (or container) access control and assign the Data Factory permissions (Blob reader at minimum. I use blob contributor).
    41007-image.png
    41192-image.png

    1 person found this answer helpful.
    0 comments No comments

  2. DannyV-2978 6 Reputation points
    2020-11-23T14:29:16.057+00:00

    Thanks for the great tip. I tried various variation of your method and keep getting this error:
    <?xml version="1.0" encoding="utf-8"?> <Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:55403b3b-001e-009a-44a1-c19684000000 Time:2020-11-23T14:02:22.0447390Z</Message></Error>
    It seems that my issue is related on how I am authenticating. I can't seem to figure out the best way or how to do it effectivily.

    D


  3. DannyV-2978 6 Reputation points
    2020-11-24T03:19:11.323+00:00

    Hi, I am about to give up. This is impossible. I have been on this for hours and days. It's not working. How do you get the MSI Authentication to work.
    I am very new at this, so I don't understand. What URL am I typing in under the resource? HTTPS://stroage.azure.com does not work.

    Thanks
    Danny

    0 comments No comments

  4. MartinJaffer-MSFT 26,106 Reputation points
    2020-11-24T22:38:27.88+00:00

    @Anonymous I am sorry this has been a frustrating process. I hope the below has the missing piece.

    If you are getting error like pictured below, saying

    Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature ... Authentication scheme Bearer is not supported in this version.

    42293-image.png

    Then you need to add the header x-ms-version and value 2017-11-09 . (this is shown in picture of earlier solution)

    The resource should be https://storage.azure.com/

    If you are getting error saying

    AuthorizationPermissionMismatch</Code><Message>This request is not authorized to perform this operation using this permission.

    Then you may need to go to storage account and give more permissions, like pictured below. Wait several minutes for the permissions to propagate, otherwise you might get a false negative.
    42258-image.png

    0 comments No comments

  5. DannyV-2978 6 Reputation points
    2020-11-26T19:56:02.267+00:00

    Hi Martin, Thanks, I figure that out and was able to get that part to work. However, now I get an error message when I am trying to post a word doc to a website. The error message is not much help

    43029-image.png

    The input is as follows. It seems to show the Word doc in it's binary format. I believe.

    43019-image.png

    And the Web activity I have set up is as follows.

    43113-image.png

    Any ides as to what I am missing?

    Thanks


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.