Read SharePoint online lists from Azure Data Factory - azure

I'm trying to read data from a list in the SharePoint online, using Azure Data Factory. It should be possible using OData. I'm struggling to authenticate from ADF.
From Chrome I can access the list data without problems using URL like this:
https://mycompany.sharepoint.com/_vti_bin/listdata.svc/MyListName
I have account name that can read the list, and its password. I'm struggling with authentication in ADF. I tried basic and windows, with no success. For the others, I do not know what to set...
Short step by step instructions of how to read a SharePoint online list in ADF is highly welcome.

I am in the process of writing out how to do so in a MSDN thread:
https://social.msdn.microsoft.com/Forums/en-US/85ab91ef-0336-4832-b750-2ed007b030a9/access-sharepoint-list-data-using-adf?forum=AzureDataFactory

Related

ARM template for logic App to PowerBi with API connection

I would like to understand if it possible to automate (or partially automate) the creation of a Logic App connector to Power BI.
basically I would like to automate, as far as it is possible, the connector as described on this tutorial:
https://learn.microsoft.com/en-us/azure/iot-central/retail/tutorial-in-store-analytics-export-data-visualize-insights
Power Bi is using an OAUTH authentication hence I am not sure what is like the correct procedure to automate the full process.
I have been looking those resources but I have not found anything related to PowerBi
https://www.bruttin.com/2017/06/13/deploy-logic-app-with-arm.html
https://github.com/logicappsio/LogicAppConnectionAuth
Thank you in advance
Marco

Code to connect to Sharepoint from PySpark

I want to extract SharePoint List data using PySpark. I am not sure about the Sharepoint list data and storage. I want to read the SharePoint list data as a PySpark data frame.
I have tried Python Libraies:
Sharepy
Slum
Sharepoint and many others
Assuming you are using pyspark from databricks, I am using a different approach. I am using office 365 powerautomate flows to store the sharepoint lists in azure data storage as csv files. These flows can be called from databricks via calling the http triggers of power automate in python or you can have power automate automatically update when data change occurs. The csv files can then be mounted as tables in sql analytics and used easily in databricks. The benefit is microsoft offers and easy to use no code solution to exporting sharpoint to azure storage and it also handles all of the security nuances.
You can download the file/list that you want from Sharepoint first using one of the following packages, then you can use PySpark to ingest and process it.
https://pypi.org/project/sharepoint/
https://pypi.org/project/sharepy/
Here is a tutorial using Sharepy package: https://www.mydatahack.com/how-to-get-data-from-sharepoint-with-python/
I hope it helps.

Azure Data Factory and SharePoint

I have some Excel files stored in SharePoint online. I want copy files stored in SharePoint folders to Azure Blob storage.
To achieve this, I am creating a new pipeline in Azure Data factory using Azure Portal. What are possible ways to copy files from SharePoint to Azure blob store using Azure Data Factory pipelines?
I have looked at all linked services types in Azure data factory pipeline but couldn't find any suitable type to connect to SharePoint.
Rather than directly accessing the file in SharePoint from Data Factory, you might have to use an intermediate technology and have Data Factory call that. You have a few of options:
Use a Logic App to move the file
Use an Azure Function
Use a custom activity and write your own C# to copy the file.
To call a Logic App from ADF, you use a web activity.
You can directly call an Azure Function now.
We can create a linked service of type 'File system' by providing the directory URL as 'Host' value. To authenticate the user, provide username and password/AKV details.
Note: Use Self-hosted IR
You can use the logic app to fetch data from Sharepoint and load it to azure blob storage and now you can use azure data factory to fetch data from blob even we can set an event trigger so that if any file comes into blob container the azure pipeline will automatically trigger.
You can use Power Automate (https://make.powerautomate.com/) to do this task automatically:
Create an Automated cloud flow trigger whenever a new file is dropped in a SharePoint
Use any mentioned trigger as per your requirement and fill in the SharePoint details
Add an action to create a blob and fill in the details as per your use case
By using this you will be pasting all the SharePoint details to the BLOB without even using ADF.
My previous answer was true at the time, but in the last few years, Microsoft has published guidance on how to copy documents from a SharePoint library. You can copy file from SharePoint Online by using Web activity to authenticate and grab access token from SPO, then passing to subsequent Copy activity to copy data with HTTP connector as source.
I ran into some issues with large files and Logic Apps. It turned out there were some extremely large files to be copied from that SharePoint library. SharePoint has a default limit of 100 MB buffer size, and the Get File Content action doesn’t natively support chunking.
I successfully pulled the files with the web activity and copy activity. But I found the SharePoint permissions configuration to be a bit tricky. I blogged my process here.
You can use a binary dataset if you just want to copy the full file rather than read the data.
If my file is located at https://mytenant.sharepoint.com/sites/site1/libraryname/folder1/folder2/folder3/myfile.CSV, the URL I need to retrieve the file is https://mytenant.sharepoint.com/sites/site1/libraryname/folder1/folder2/folder3/myfile.CSV')/$value.
Be careful about when you get your auth token. Your auth token is valid for 1 hour. If you copy a bunch of files sequentially, and it takes longer than that, you might get a timeout error.

How to execute multiple rows in web service Azure Machine Learning Studio

I create a model in Azure ML studio.
I deployed the web service.
Now, I know how to check one record at a time, but how can I load a csv file and made the algorithm go through all records ?
If I click on Batch Execution - it will ask me to create an account for Azure storage.
Is any way to execute multiple records from csv file without creating any other accounts?
Yes, there is a way and it is simple. What you need is an excel add-in. You need not create any other account.
You can either read Excel Add-in for Azure Machine Learning web services doc or you can watch Azure ML Excel Add-in video.
If you search for videos on excel add in for azure ml, you get other useful videos too.
I hope this is the solution you are looking for.

How to get data from Azure Table Storage to SharePoint Online

I need to get data from Azure table storage and populate in SharePoint O365 site as a list. I found a way to achieve if it's from SQL Azure but couldn't able to find for Azure Tables. Kindly share your inputs.
Azure Table and SharePoint both have APIs, so in the base case you can import from one and export to others using their APIs. However, it seems you are looking for a tool, not to write code.
To export from Azure Tables you can use the AzCopy Tool (http://aka.ms/azcopy) to export the contents into a Json-formatted local file. Then, you can use whatever tool you use to import into SharePoint, as long as it understands Json files.

Resources