Quantcast
Channel: Terence Luk
Viewing all articles
Browse latest Browse all 836

Using a Logic App to copy files uploaded to a Storage Account to SharePoint Online

$
0
0
A common use case I’ve been asked frequently in the past is what would be the best way to automatically copy any files uploaded to an Azure Storage Account over to SharePoint Online. The Storage Account uploads could be from an application using the Storage Account APIs, enabling the SFTP feature, directly from the portal.azure.com portal, or Azure Storage Explorer. The use case I usually come across is via SFTP or Storage APIs and this blog post serves to demonstrate an example of how to configure this. 

Step #1 – Create a Logic App with a “When a HTTP request is received” trigger 

Begin by creating a Logic App with a When a HTTP request is received trigger:



Note that the HTTP URL is not generated until it is saved and we’ll need it for the next step so proceed to save the Logic App:


The URL will be displayed one saved. Proceed to copy the URL to notepad as we’ll be using in shortly:


Step #2 – Configure Logic App permissions to Storage Account

The Logic App will need to have permissions to read and edit the blob contents of the storage account and the best way to provide this is to use a System assigned managed identity. Proceed to navigate to the Identity blade of the newly created Logic App and turn on the feature:


Next, navigate to the storage account and grant the managed identity Storage Blob Data Contributor:




Step #3 – Configure an Event Grid Subscription

The next step is to configure an Event Subscription for the storage account that you want to monitor so any files uploaded/copied to the storage account will trigger an Event. The easiest way to do this is simply navigate to the storage account, select the Events blade, and click on +Event Subscription:


Fill out the following properties of the Event Subscription:

Name: Provide a name for the Event Subscription
Event Schema: Event Grid Schema

Topic Type: This should already pre-populated with Storage account
Source Resource: This should be pre-populated with the storage account name
System Topic Name: Provide a name for the System Topic


For the Filter to Event Types, select the type of events you want to trigger. For the purpose of this example, we’ll be using BlobCreated.


For the Endpoint Type, select Web Hook

The option to Configure an Endpoint will now be presented:

Click on the hyperlink and paste the Logic App HTTP URL we pasted into notepad:

Click on Confirm Selection:

















Viewing all articles
Browse latest Browse all 836

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>