Hey Folks,
In this article, we will cover the connection between SharePoint and .NET, including all required details.
In this article, we will see a demonstration where we will fetch data from a SharePoint list using ASP.NET Core API. Also, we will take a short look at Azure Functions, like how to create, and we will see a demo.
So, before we jump into details, let's check out the prerequisites for our Demo.
Prerequisites
Microsoft Azure AD Subscription
ASP.NET Core V8 is installed in your system
SharePoint latest version installed (current version is 1.22 but in this, we will use 1.21)
M365 Subscription to use SharePoint
Access to the Azure function to upload certificates.
SharePoint provides access to create sites and lists to access data.
Require admin consent to grant the Azure function the required permissions to access SharePoint.
Now, above we have checked out the prerequisites, and it’s time to jump into our detailed article.
First, in SharePoint, create a List in your desired SharePoint site. Add some data to that list so we can access it via an Azure Function.
Once you complete the SharePoint list creation with data, we need to create an Azure Function in ASP.NET Core.
To create an Azure function, we will use the command given below.
func init MyFunctionAPP --worker-runtime dotnet-isolated
Note - there are mainly two types of functions one is Isolated worker model and second one is In-Process. We are not covering In-Process. We will cover that in another article.
Then run below command
cd MyFunctionAPP
go into your project folder.
func new --name GetSharePointListItems --template "HTTP trigger"
Once your ran this command it would create a file with extension .cs in your current project.