Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

SharePoint Large File Downloader & Uploader Toolkit for the Modern Workplace #216

Open
codewired opened this issue Mar 16, 2023 · 4 comments
Labels
hack Hackathon project submitted by participants

Comments

@codewired
Copy link

Project name

OfficeTookit

Description

In modern workplaces, business owners and executives working in a Microsoft Shop environment are always working with spreadsheets. More specifically, in Financial Services and investment banking, executives handle large amounts of sensitive data in different excel formats and in most cases generate files that are over 100mb in size.

Most modern workplaces tend to automate the process of interacting with these large files, processing and manipulating data in a secure way while minimizing human errors. Most times business development staff use low code tools like Azure Logic Apps to extract large business files from a SharePoint site and move them to storage containers where Scripts that were written to process them with adequate permissions gain access to interact and execute business logic on them.

The problem today on Microsoft Azure with Low Code tools like Azure Logic Apps is that they cannot move files that are over a 100mb in size, there is a hard limit. Today, I have decided to share an ASP.NET function app that solves this problem for many modern workplaces and businesses running a Microsoft Shop!

The solution I have today is an Azure HTTP triggered function app which accepts three parameters in the POST request BODY.

  1. sitePath (The Absolute Path to the SharePoint Site's folder where the file was saved)
  2. siteId (The site Id for the SharePoint Site hosting the file)
  3. fileName (The filename of the file to download)

Once the right payload is passed to the invocation of the HTTP Service, it processes the request and uses the Microsoft Graph SDK to download the large file (this was tested with a file of 250mb) from the SharePoint folder and uploads it to an Azure blob storage whose URI settings should be supplied in the app configuration file explained below.

To run this function app successfully in your Tennant, you will need to supply specific values to your local.appsetting.json file. The Keys the app is expecting for these values are listed below and quite self-explanatory.

"Values": {
"AzureWebJobsStorage__blobServerUri": "",
"CwdToolBox:KeyVaultUri": "https://",
"CwdToolBox:SharePoint:ApiSettings:KeyvaultSecret_TenantId": "",
"CwdToolBox:SharePoint:ApiSettings:KeyvaultSecret_ClientId": "",
"CwdToolBox:SharePoint:ApiSettings:KeyvaultSecret_CllientSecret": ""
}

The above details are basically your Azure Blob Storage URI, Azure KeyVault URI, The Azure Tenant ID, Client Id and Client Secret for OAuth token retrieval used to access the Graph API. You should add the Tenant ID, Client Id and Client Secret to your Azure Key Vault with these keys:

  1. KeyvaultSecret_TenantId
  2. KeyvaultSecret_ClientId
  3. KeyvaultSecret_ClientSecret

The function app uses Azure.Identity.DefaultAzureCredentail to provide default TokenCredential authentication flow for Azure Blob Service Client when connected to an Azure Subscription or when deployed to Azure.

I hope this toolkit will help millions of businesses who cannot automate past the hard limits that low code tools are facing today on Azure.

Repo URL

https://github.com/codewired/OfficeToolkit

Team members

Codewired

@waldekmastykarz
Copy link
Collaborator

Thank you for your submission @codewired! Would you be willing to record a short video to demonstrate the app? It's not required for the hackathon but it would help us showcase your work internally at Microsoft and publicly in the community 😊

@waldekmastykarz waldekmastykarz added the hack Hackathon project submitted by participants label Mar 16, 2023
@codewired
Copy link
Author

Hello @waldekmastykarz, I would love to record this short video but unfortunately, I am a very busy person and might not have any free time until Sunday if all things stay equal. With that said, my submission is more of an API service which does background work and can't really be demonstrated without a Client App (Azure Logic App, Web Client App, ETC).

Best Regards.

@waldekmastykarz
Copy link
Collaborator

Understood. All good 👍

@OzBob
Copy link

OzBob commented Mar 24, 2023

@codewired large file upload and download sounds interesting to me.

May i see the code?

I am having challenges on my hack, to write an Abstraction of common File and Folder tasks for my Daemon Console app to manage Sharepoint files, folders and subfolders between our client website.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
hack Hackathon project submitted by participants
Projects
None yet
Development

No branches or pull requests

3 participants