Using CSOM from Azure Functions
I got back to active SharePoint and CSOM development some months ago and first thing to do was to port bunch of workflows from in-prem SharePoint to cloud. Where I live we don’t usually have any simple workflows. Most of them need some backing code due to custom logic. So, my only option was to go with Microsoft Flow or Azure Logic Apps and Azure Functions. Here’s the project with one dummy function to get started.
Are you new to Azure Functions? If yes, then you can read my posts Getting started with Azure Functions and Short introduction to serverless architecture to get better understanding of Azure Functions and serverless computing.
First of all – I was damn surprised to find out that CSOM doesn’t work with .NET Core and I have to use first generation of Azure Functions and .NET Framework 4.x (4.6.1 in my case). Here’s the project file that works for me.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net461</TargetFramework>
<AzureFunctionsVersion>v1</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<None Remove=".gitignore" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.24" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.SharePoint.Client">
<HintPath>C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Runtime">
<HintPath>C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
</ItemGroup>
</Project>
With .NET Framework come also .NET Framework classes and stuff that doesn’t work with .NET Core. Here’s the dummy function to use as a starting point for functions that talk to Office 365 SharePoint using CSOM.
[FunctionName("DummyFunction")]
public static async Task<HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)]HttpRequestMessage request, TraceWriter logger)
{
logger.Info("C# HTTP trigger function processed a request.");
foreach (var key in request.GetQueryNameValuePairs())
{
logger.Info(key.Key + ": " + key.Value);
}
return request.CreateResponse(HttpStatusCode.OK);
}
If you configure this function to use function key you can easily try it out directly from your browser. You can make this function synchronous if you don’t use asynchronous calls in CSOM.
Wrapping up
Not all revenue generating services are supported on .NET Core yet and it was big surprise to me to see that CSOM is not available for .NET Core yet. There are third-party NuGet paclages available to make CSOM work with .NET Core but if you prefer to go with officially supported libraries then full .NET Framework is your only choice today.
Pingback:Dew Drop – January 6, 2020 (#3105) | Morning Dew
Then begin a scrapbook of concepts, pictures, and product catalogs that will certainly aid the experts you work with comprehend your requirements and tastes. So, observe some suggestions from the specialists and from households that’ve done the job already: Take your time at the beginning to make sure each choice shows your tastes and satisfies your demands. Remodeling entails significant changes that may take your washroom in a whole brand-new direction. Renovation involves a total redesign of bathroom floor plans. Personalizing your primary restroom entails consideration of arrangement, size, and design. You might be called for to manage any type of upgrades with excellent regard for the existing style and framework if your home is traditionally significant. One of the best home improvement financial investments you can make is including a 2nd full bath to a one-bath home or renovating an existing master bathroom. A brand-new bath can relieve squabbles over early morning blockage, and a redesigned one can include a whole new dimension of comfort. Now, it is essential to keep in mind that Europe is made up of over forty countries which makes it extremely challenging to process the average prices of things throughout the continent. Even young kids can have good understandings, and the more engaged every person is, the even more they’ll purchase right into the procedure.
And do not fail to remember that substitute can suggest leaving the old tiled-in sink and bathtub undamaged yet placing in lovely brand-new fittings (e.g., taps, pop-up drains pipes, etc) or trading ugly old light for attractive brand-new ones. There’s also a bountiful supply of vintage-looking components and fittings to offer your bathroom classic style with modern performance. Spathaky, Mike. “Old Style and New Style Dates and the modification to the Gregorian Calendar”. Obviously, switching an old wall-hung bathroom for a brand-new one is mosting likely to be a whole lot simpler and much less messy than replacing an charmdate scam old integrated bathtub with a brand-new clawfoot bathtub, so be sure to match the scope of the job with the ability and experience of the employee. Unless you’re intending the extremely most basic redecoration, you’ll want to speak to bath style experts regarding what you need and want. When interviewing them, be prepared to answer a great deal of concerns concerning just how you and your family live and exactly how you’ll utilize the area. A restroom that all member of the family use will definitely feature various fixtures than those in a master bath. The site is home to even more than 200,000 participants and is 100 percent totally free. You can likewise collect concepts by checking out the many internet sites that offer bathroom style products or by investing time “just looking” in the regional bath layout center or division of your nearby home renovation shop.
Browse home design and enhancing magazines and publications, and tag or xerox pages revealing bathroom designs and products you like. Discover more about just how home windows and various other sources of light and ventilation include to the design of a bathroom. Find out more concerning these and various other operations in the next area. Since restrooms have altered a lot more radically over the past century than, state, bed rooms, renovation’s obstacle is to maintain the best of the past while offering you comfortable, convenient bathrooms for today’s way of life. From their traditional charm and distinct societies to their knowledge and solid values, there’s something regarding them that attract people all over the world. Jump right into the globe of restroom makeover, and get tips on exactly how to personalize your washroom layout. Learn exactly how to develop a shower room that’s functional yet fun. Texture and lines can additionally influence the layout of a shower room. But in new construction, you can compromise square feet and dollars between the washrooms and various other spaces for optimum versatility. Bathrooms have actually constantly been pretty sexy events.
Bear in mind that, relying on just how much your new components’ profiles differ from the old ones, you may need to fix or change wallcoverings, floor tile, flooring, and molding in surrounding areas. Do you desire all new fixtures or just a whirlpool instead of your old tub? Remodeling does not need to depend upon what your old bathroom looked like, just on what your demands and desires are and what your budget dictates. It makes sense to learn how to negotiate for prices and clarify your expectations because working with labor to remodel a shower room is most likely the most costly part of renovation. Veteran property owners who’ve been through any of these manufacturings concur: Even the utmost bath is only a little part of your life, so maintain points in perspective. Designer showhouses funded by neighborhood charities are particularly good locations to see bath redecorations, as developers rarely springtime for new fixtures or wall and floor surface areas. They normally really did not see themselves mosting likely to institution and getting approved for those occupations; they were always the appendages of the males who had their medical degree or their Juris Doctor level.