Introduction

 I have a Scenario where i should Upload hundreds of Images into One Drive. if I Copy them manually it used to take a Lot of time. So, I thought of using BizTalk in Combination with Logic Apps to Achieve it.

Since the Images are present in my Local Folder, I could easily use BizTalk to pick those Files and Logic Apps has One Drive Connector so it can Push Images to it. I Used the Storage Container so that BizTalk Can store my Images into it from which Logic App can Pick up the images and Push it to One Drive.

This is my First Attempt. Please share your feedback.

Creation of Azure Storage Account

The first Prerequisite Step is to create a Storage Account in Azure.

  • Login to Azure Portal with your valid Subscription.
  • Search for Storage Accounts and Specify a name, deployment model, account kind (general purpose, which include tables, queues and blobs), replication, resource group and location. Subsequently click Create.

  • With In the Storage Account Chose Blobs and the then Click on Add Container. Specify the Name and Access Level to Private.

Creation of BizTalk Artifacts:

  • Navigate to BizTalk Administration Console and Create a new application.
  • Within the Newly Created Application, create a New Receive Port and its Associated Receive Location. Specify Name, Type as File Adapter, Receive Pipeline as Pass thru Transmit and appropriate Receive Handler.
  • Configure the File Adapter with Location you have the Images stored in it.

  • Create a New Send Port and use the Adapter WCF-WebHttp and Click on Configure.
  • In the General Tab of the WCF-WebHttp Transport properties,Specify the Address of the Storage Account which you Created Earlier.
  • specify the HTTP Method and URL MappingURL Mapping will be applied to dynamically have the file name, that is the name of the file being offered to BizTalk Receive Port. The method is going to be PUT as we will create (place) the file in the container.

  • Click on Variable Mapping and give the Properties like below

  • In the Security tab specify the security mode to transport and in the Behavior Tab right click EndPointBehaviour and click Add Extension. Select Azure Storage Behavior  and specify the Azure Account Key and Name.
  • You can find the details, when you go to your Storage Account and in the blade, select under Settings, click Access Keys.
  • Click on OK and go to Filters Section in the Send Port and Create a Subscription on Receive Port.

File Name will be containing the path of the folder and the file name. Something like C:\foldername\filename. To prevent that from happening in a message based solution you will need a simple custom pipeline component that will strip off the path name.

More Details on Creating the Send Port and  the Pipeline Can be found in the below Article from  Steef-Jan Wiggers.(Very Useful helped me in Configuring WCF-WebHttp Adapter)

https://blogs.biztalk360.com/push-documents-window-azure-blob-storage-using-biztalk-server/

Creating a Logic App:

  • Create a Polling Logic App which will poll the Storage Container when any blobs were added or modified. specify the storage account and create the appropriate connection.

  • Select Get Blob Content Using Path and Pass the FileName from above.

  • Select One Drive Connector-Create File and Create a Connection to your OneDrive Account and Pass the Parameters Like below

  • Save the Logic App so that it can run on Scheduled Basis. Final Logic App Looks Like below.

  • Now you can Test the whole Scenario and Find the Files in your One Drive and Storage Account Container.