SlideShare a Scribd company logo
Azure for SharePoint Developers - Workshop - Part 2: Azure Functions
Azure Functions
w/SharePoint Online
Common Use Cases
• Elevate permissions
• Timer job
• Hiding API keys
• Extending Site Designs/
Scripts
• Custom code in Flow
…if cloud computing was transportation
Azure for SharePoint Developers - Workshop - Part 2: Azure Functions
Azure Functions
Process events with Serverless code.
Make composing Cloud Apps insanely easy
Develop Functions in C#, Node.js, F#, Python, PHP, Batch and more
Easily schedule event-driven tasks across services
Expose Functions as HTTP API endpoints
Scale Functions based on customer demand
Easily integrate with Logic Apps
Azure for SharePoint Developers - Workshop - Part 2: Azure Functions
1
Azure for SharePoint Developers - Workshop - Part 2: Azure Functions
Functions
Runtime
Functions
Programming
Interface
App Service
App Hosting Plans
Triggers
Input Bindings
Output Bindings
Functions
1.x
Functions
2.x
C# (script) GA GA
C# (precompiled) GA GA
JavaScript GA GA
F# GA GA
Java GA GA
PowerShell Experimental
Python Experimental
PHP Experimental
TypeScript Experimental
Batch (.cnd,
.bat)
Experimental
Bash Experimental
Trigger
• Invokes the function
• Always exactly 1
Input binding
• Handles incoming
data
• Optional
Output binding
• Handles outgoing
data
• Optional
Type 1.x 2.x Trigger Input Output
Blob Storage ✔ ✔
1
✔ ✔ ✔
Cosmos DB ✔ ✔ ✔ ✔ ✔
Event Grid ✔ ✔ ✔
Event Hubs ✔ ✔ ✔ ✔
External File
2
✔ ✔ ✔
External Table
2
✔ ✔ ✔
HTTP ✔ ✔
1
✔ ✔
Microsoft Graph
Excel tables
✔ ✔ ✔
Microsoft Graph
OneDrive files
✔ ✔ ✔
Type 1.x 2.x Trigger Input Output
Microsoft Graph
Outlook email
✔ ✔
MS Graph Events ✔ ✔ ✔ ✔
MS Graph Auth
tokens
✔ ✔
Mobile Apps ✔ ✔ ✔ ✔
Notification Hubs ✔ ✔
Queue storage ✔ ✔
1
✔ ✔
SendGrid ✔ ✔ ✔
Service Bus ✔ ✔ ✔ ✔
Table storage ✔ ✔
1
✔ ✔
Timer ✔ ✔ ✔
Twilio ✔ ✔ ✔
Webhooks ✔ ✔ ✔
Function (pass a
function key)
Admin (pass
function app’s host
key)
System (pass
function app’s
master key)
Anonymous (can
be used in
conjunction with
App Service authN)
Coming soon: User
– this will be token
based
Azure for SharePoint Developers - Workshop - Part 2: Azure Functions
Azure for SharePoint Developers - Workshop - Part 2: Azure Functions
public static void Run(byte[] image, string filename,
Stream outputBlob, TraceWriter log)
{
log.Info($"Processing image: {filename}");
var imageBuilder = ImageResizer.ImageBuilder.Current;
imageBuilder.Build(
image, outputBlob,
new ResizeSettings(640, 400, FitMode.Max, null), false);
}
{
"bindings": [
{
"name": "image",
"type": "blobTrigger",
"direction": "in",
"path": "card-input/{filename}.jpg",
"connection": "AzureWebJobsStorage"
},
{
"type": "blob",
"name": "outputBlob",
"path": "card-output/{filename}.jpg",
"connection": "AzureWebJobsStorage",
"direction": "out"
}
]
}
C#
Azure for SharePoint Developers - Workshop - Part 2: Azure Functions
Do try this at home!
http://bit.ly/AzFuncTools
Want to not elevate permissions? See this great blog series
by Vardhaman Deshpande
http://bit.ly/AzFuncOnBehalfOf
• Light-weight API management
• Change URL, manipulate request and
response
• Inherits the configuration of your Function
App
(e.g. authentication)
Azure Function Proxies
Azure for SharePoint Developers - Workshop - Part 2: Azure Functions
var listRecipe = {
"$schema": "schema.json",
"actions": [
{
"primary_verb": "List.CreateOrOpen",
"target": "Customer Tracking",
"templateType": 100,
"verbs": [
{
"verb": "SetDescription",
"description": "List of Customers and Orders"
},
{
"verb": "AddFieldIfNotExist",
"fieldType": "Text",
"displayName": "Customer Name",
"isRequired": false,
"addToDefaultView": true
},
{
"verb": "AddFieldIfNotExist",
"fieldType": "DateTime",
"displayName": "Date of Delivery",
"isRequired": true
},
]
},
{
primary_verb: "Theme.Apply",
target: "Contoso Travel Green"
}
],
"bindata": {},
"version": 1
};
Idempotent syntax of
common site configuration
actions
Script actions can be
concatenated in single file or
multiple files can be used (and
reused)
RestRequest("/_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.Script
Utility.CreateFormula", {info:{Title:"Contoso Travel - Legal Case Book",
Description:"Restricted site design to create a legal case book site",
ScriptGuids:["b432a1cd-7e1f-4fb1-9829-633d8MaG1C”],
Targets:["CN=GUID,OU=GUID,OU=Tenants,OU=MSOnline,DC=<value>,DC=ms
oprd,DC=msft,DC=net"], IsDefault:true, WebTemplate:"68"}});
Site Design attributes
designate display
characteristics and target
template
Azure for SharePoint Developers - Workshop - Part 2: Azure Functions
var flowRecipe = {
"$schema": "schema.json",
"actions": [{
"primary_verb": "Flow.Trigger",
"target": “<<http post url>>",
"name": “contoso hr additions",
"parameters": {
"department": "HR",
"cost center": "1023"
}
}
],
"bindata": {},
"version": 1
};
SharePoint
Online
Storage
Queue
Azure Function
Microsoft Flow
Business logic will handle the message
processing. Site URL is used as a parameter to
connect to site using remote APIs. Applies
needed customization using remote
provisioning techniques, for example with PnP
remote provisioning template model.
Script configured to start
previously configured flow,
which will receive the newly
created site URL as parameter.
Flow includes a step to pass
site URL to Azure storage
queue for delegating
processing to Azure side
1 2
3
4
Azure for SharePoint Developers - Workshop - Part 2: Azure Functions
Azure for SharePoint Developers - Workshop - Part 2: Azure Functions
Azure for SharePoint Developers - Workshop - Part 2: Azure Functions
 http://bit.ly/AzFuncTools
http://bit.ly/AzureSPC-FuncJS
http://bit.ly/AzureSPC-FuncCS
 On Behalf Of Flow
http://bit.ly/AzFuncOnBehalfOf
http://bit.ly/AzureSPC-FuncCSOM
http://bit.ly/AzureSPC-FuncSPFx
http://bit.ly/AzureSPC-SiteScripts

More Related Content

PPTX
Azure for SharePoint Developers - Workshop - Part 3: Web Services
PPTX
Azure for SharePoint Developers - Workshop - Part 5: Logic Apps
PPTX
Get Some Rest - Taking Advantage of the SharePoint 2013 REST API
PPTX
PDF
Introduction to share point 2010 development
PPTX
Knowledge of web ui for automation testing
PPTX
Rest api and-crud-api
Azure for SharePoint Developers - Workshop - Part 3: Web Services
Azure for SharePoint Developers - Workshop - Part 5: Logic Apps
Get Some Rest - Taking Advantage of the SharePoint 2013 REST API
Introduction to share point 2010 development
Knowledge of web ui for automation testing
Rest api and-crud-api

What's hot (20)

PPT
Document Databases & RavenDB
PPTX
Intro to RavenDB
PPTX
API Design- Best Practices
PPTX
Working with LoopBack Models
PPTX
Deploying your static web app to the Cloud
PPTX
Adding Rules on Existing Hypermedia APIs
PDF
Picking the Right Node.js Framework for Your Use Case
PPTX
introduction about REST API
PDF
2019 -04-23 Austin, TX Tableau Users Group - Deployment: The Final Mile
PPTX
RavenDB Presentation
PDF
Representational State Transfer (REST)
PPTX
Dev show september 8th 2020 power platform - not just a simple toy
PPT
Cross-Lingual Web API Classification
PDF
Deep Dive on ArangoDB
PPTX
REST API Design & Development
PPSX
Rest api standards and best practices
PPTX
03 net saturday anton samarskyy ''document oriented databases for the .net pl...
PPTX
REST and ASP.NET Web API (Tunisia)
PPT
Introduction to the Web API
PPTX
Build intelligent solutions using ms azure
Document Databases & RavenDB
Intro to RavenDB
API Design- Best Practices
Working with LoopBack Models
Deploying your static web app to the Cloud
Adding Rules on Existing Hypermedia APIs
Picking the Right Node.js Framework for Your Use Case
introduction about REST API
2019 -04-23 Austin, TX Tableau Users Group - Deployment: The Final Mile
RavenDB Presentation
Representational State Transfer (REST)
Dev show september 8th 2020 power platform - not just a simple toy
Cross-Lingual Web API Classification
Deep Dive on ArangoDB
REST API Design & Development
Rest api standards and best practices
03 net saturday anton samarskyy ''document oriented databases for the .net pl...
REST and ASP.NET Web API (Tunisia)
Introduction to the Web API
Build intelligent solutions using ms azure
Ad

Similar to Azure for SharePoint Developers - Workshop - Part 2: Azure Functions (20)

PDF
[Serverless Meetup Tokyo #3] Serverless in Azure (Azure Functionsのアップデート、事例、デ...
PPTX
Going Serverless with Azure Functions
PPTX
Mastering Azure Functions
PDF
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
PPTX
FP - Découverte de Play Framework Scala
PPTX
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
PDF
Forge - DevCon 2016: Introduction to Forge 3D Print API Through Sample Applic...
KEY
An Introduction to webOS
PPTX
TDC2017 | São Paulo - Trilha Cloud Computing How we figured out we had a SRE ...
PPTX
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...
PDF
Everything is Awesome - Cutting the Corners off the Web
PPT
Going Offline with Gears And GWT
PDF
Future of Web Apps: Google Gears
PPTX
Silicon Valley JUG - How to generate customized java 8 code from your database
PPTX
How to generate customized java 8 code from your database
PDF
FOXX - a Javascript application framework on top of ArangoDB
PDF
VBA API for scriptDB primer
PDF
Pulsar Architectural Patterns for CI/CD Automation and Self-Service_Devin Bost
PDF
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
PDF
Serverless - Developers.IO 2019
[Serverless Meetup Tokyo #3] Serverless in Azure (Azure Functionsのアップデート、事例、デ...
Going Serverless with Azure Functions
Mastering Azure Functions
Beyond Cookies, Persistent Storage For Web Applications Web Directions North ...
FP - Découverte de Play Framework Scala
Chris O'Brien - Best bits of Azure for Office 365/SharePoint developers
Forge - DevCon 2016: Introduction to Forge 3D Print API Through Sample Applic...
An Introduction to webOS
TDC2017 | São Paulo - Trilha Cloud Computing How we figured out we had a SRE ...
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...
Everything is Awesome - Cutting the Corners off the Web
Going Offline with Gears And GWT
Future of Web Apps: Google Gears
Silicon Valley JUG - How to generate customized java 8 code from your database
How to generate customized java 8 code from your database
FOXX - a Javascript application framework on top of ArangoDB
VBA API for scriptDB primer
Pulsar Architectural Patterns for CI/CD Automation and Self-Service_Devin Bost
IVS CTO Night And Day 2018 Winter - [re:Cap] Serverless & Mobile
Serverless - Developers.IO 2019
Ad

More from Bob German (19)

PPTX
Introduction to the Microsoft Bot Framework v4
PPTX
Adaptive cards 101
PPTX
Introduction to Teams Development - North American Collaboration Summit
PPTX
Future-proof Development for Classic SharePoint
PPTX
Azure for SharePoint Developers - Workshop - Part 4: Bots
PPTX
Azure for SharePoint Developers - Workshop - Part 1: Azure AD
PPTX
Azure AD for browser-based application developers
PPTX
Going with the Flow: Rationalizing the workflow options in SharePoint Online
PPTX
Modern SharePoint, the Good, the Bad, and the Ugly
PPTX
Developing JavaScript Widgets
PPTX
Introduction to TypeScript
PPTX
Developing JavaScript Widgets
PPTX
TypeScript and SharePoint Framework
PPTX
German introduction to sp framework
PPTX
SPSNYC - Next Generation Portals
PPTX
Typescript 102 angular and type script
PPTX
Typescript 101 introduction
PPTX
Search First Migration - Using SharePoint 2013 Search for SharePoint 2010
PPTX
Enterprise Content Management + SharePoint 2013 - SPSNH
Introduction to the Microsoft Bot Framework v4
Adaptive cards 101
Introduction to Teams Development - North American Collaboration Summit
Future-proof Development for Classic SharePoint
Azure for SharePoint Developers - Workshop - Part 4: Bots
Azure for SharePoint Developers - Workshop - Part 1: Azure AD
Azure AD for browser-based application developers
Going with the Flow: Rationalizing the workflow options in SharePoint Online
Modern SharePoint, the Good, the Bad, and the Ugly
Developing JavaScript Widgets
Introduction to TypeScript
Developing JavaScript Widgets
TypeScript and SharePoint Framework
German introduction to sp framework
SPSNYC - Next Generation Portals
Typescript 102 angular and type script
Typescript 101 introduction
Search First Migration - Using SharePoint 2013 Search for SharePoint 2010
Enterprise Content Management + SharePoint 2013 - SPSNH

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PPTX
A Presentation on Artificial Intelligence
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Modernizing your data center with Dell and AMD
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Approach and Philosophy of On baking technology
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Network Security Unit 5.pdf for BCA BBA.
PPT
Teaching material agriculture food technology
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Big Data Technologies - Introduction.pptx
A Presentation on Artificial Intelligence
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Modernizing your data center with Dell and AMD
“AI and Expert System Decision Support & Business Intelligence Systems”
20250228 LYD VKU AI Blended-Learning.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Machine learning based COVID-19 study performance prediction
Unlocking AI with Model Context Protocol (MCP)
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Approach and Philosophy of On baking technology
Per capita expenditure prediction using model stacking based on satellite ima...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
NewMind AI Weekly Chronicles - August'25 Week I
Network Security Unit 5.pdf for BCA BBA.
Teaching material agriculture food technology
The AUB Centre for AI in Media Proposal.docx
Chapter 3 Spatial Domain Image Processing.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

Azure for SharePoint Developers - Workshop - Part 2: Azure Functions

  • 2. Azure Functions w/SharePoint Online Common Use Cases • Elevate permissions • Timer job • Hiding API keys • Extending Site Designs/ Scripts • Custom code in Flow
  • 3. …if cloud computing was transportation
  • 5. Azure Functions Process events with Serverless code. Make composing Cloud Apps insanely easy Develop Functions in C#, Node.js, F#, Python, PHP, Batch and more Easily schedule event-driven tasks across services Expose Functions as HTTP API endpoints Scale Functions based on customer demand Easily integrate with Logic Apps
  • 7. 1
  • 10. Functions 1.x Functions 2.x C# (script) GA GA C# (precompiled) GA GA JavaScript GA GA F# GA GA Java GA GA PowerShell Experimental Python Experimental PHP Experimental TypeScript Experimental Batch (.cnd, .bat) Experimental Bash Experimental
  • 11. Trigger • Invokes the function • Always exactly 1 Input binding • Handles incoming data • Optional Output binding • Handles outgoing data • Optional
  • 12. Type 1.x 2.x Trigger Input Output Blob Storage ✔ ✔ 1 ✔ ✔ ✔ Cosmos DB ✔ ✔ ✔ ✔ ✔ Event Grid ✔ ✔ ✔ Event Hubs ✔ ✔ ✔ ✔ External File 2 ✔ ✔ ✔ External Table 2 ✔ ✔ ✔ HTTP ✔ ✔ 1 ✔ ✔ Microsoft Graph Excel tables ✔ ✔ ✔ Microsoft Graph OneDrive files ✔ ✔ ✔ Type 1.x 2.x Trigger Input Output Microsoft Graph Outlook email ✔ ✔ MS Graph Events ✔ ✔ ✔ ✔ MS Graph Auth tokens ✔ ✔ Mobile Apps ✔ ✔ ✔ ✔ Notification Hubs ✔ ✔ Queue storage ✔ ✔ 1 ✔ ✔ SendGrid ✔ ✔ ✔ Service Bus ✔ ✔ ✔ ✔ Table storage ✔ ✔ 1 ✔ ✔ Timer ✔ ✔ ✔ Twilio ✔ ✔ ✔ Webhooks ✔ ✔ ✔
  • 13. Function (pass a function key) Admin (pass function app’s host key) System (pass function app’s master key) Anonymous (can be used in conjunction with App Service authN) Coming soon: User – this will be token based
  • 16. public static void Run(byte[] image, string filename, Stream outputBlob, TraceWriter log) { log.Info($"Processing image: {filename}"); var imageBuilder = ImageResizer.ImageBuilder.Current; imageBuilder.Build( image, outputBlob, new ResizeSettings(640, 400, FitMode.Max, null), false); } { "bindings": [ { "name": "image", "type": "blobTrigger", "direction": "in", "path": "card-input/{filename}.jpg", "connection": "AzureWebJobsStorage" }, { "type": "blob", "name": "outputBlob", "path": "card-output/{filename}.jpg", "connection": "AzureWebJobsStorage", "direction": "out" } ] }
  • 17. C#
  • 19. Do try this at home! http://bit.ly/AzFuncTools Want to not elevate permissions? See this great blog series by Vardhaman Deshpande http://bit.ly/AzFuncOnBehalfOf
  • 20. • Light-weight API management • Change URL, manipulate request and response • Inherits the configuration of your Function App (e.g. authentication) Azure Function Proxies
  • 22. var listRecipe = { "$schema": "schema.json", "actions": [ { "primary_verb": "List.CreateOrOpen", "target": "Customer Tracking", "templateType": 100, "verbs": [ { "verb": "SetDescription", "description": "List of Customers and Orders" }, { "verb": "AddFieldIfNotExist", "fieldType": "Text", "displayName": "Customer Name", "isRequired": false, "addToDefaultView": true }, { "verb": "AddFieldIfNotExist", "fieldType": "DateTime", "displayName": "Date of Delivery", "isRequired": true }, ] }, { primary_verb: "Theme.Apply", target: "Contoso Travel Green" } ], "bindata": {}, "version": 1 }; Idempotent syntax of common site configuration actions Script actions can be concatenated in single file or multiple files can be used (and reused) RestRequest("/_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.Script Utility.CreateFormula", {info:{Title:"Contoso Travel - Legal Case Book", Description:"Restricted site design to create a legal case book site", ScriptGuids:["b432a1cd-7e1f-4fb1-9829-633d8MaG1C”], Targets:["CN=GUID,OU=GUID,OU=Tenants,OU=MSOnline,DC=<value>,DC=ms oprd,DC=msft,DC=net"], IsDefault:true, WebTemplate:"68"}}); Site Design attributes designate display characteristics and target template
  • 24. var flowRecipe = { "$schema": "schema.json", "actions": [{ "primary_verb": "Flow.Trigger", "target": “<<http post url>>", "name": “contoso hr additions", "parameters": { "department": "HR", "cost center": "1023" } } ], "bindata": {}, "version": 1 }; SharePoint Online Storage Queue Azure Function Microsoft Flow Business logic will handle the message processing. Site URL is used as a parameter to connect to site using remote APIs. Applies needed customization using remote provisioning techniques, for example with PnP remote provisioning template model. Script configured to start previously configured flow, which will receive the newly created site URL as parameter. Flow includes a step to pass site URL to Azure storage queue for delegating processing to Azure side 1 2 3 4
  • 28.  http://bit.ly/AzFuncTools http://bit.ly/AzureSPC-FuncJS http://bit.ly/AzureSPC-FuncCS  On Behalf Of Flow http://bit.ly/AzFuncOnBehalfOf http://bit.ly/AzureSPC-FuncCSOM http://bit.ly/AzureSPC-FuncSPFx http://bit.ly/AzureSPC-SiteScripts

Editor's Notes

  • #2: WRK403 - What Every SharePoint Developer should know about Microsoft Azure While the SharePoint Framework is the new place to customize the SharePoint UI, it runs completely within the web browser, and does nothing to help with background processing or other server-side work, including situations where you need to elevate permissions beyond what the end user is allowed to do. Both sandboxed and farm solutions are off the table in SharePoint Online, leaving few SharePoint-based options for this kind of work. Fortunately, Microsoft Azure is well positioned to handle these situations and many more, and should be part of every SharePoint developer's tool set. This workshop will introduce Azure platform services including Azure Active Directory, web apps, logic apps, Azure Functions, and more. You will learn practical approaches to integrate these with SharePoint. Scenarios will include: • Surfacing line of business data in SharePoint via Azure web apps and functions • Elevating permission in a SharePoint web part • Using Azure functions as timer jobs and web services • Implementing workflows and business orchestration with Azure Logic Apps • Storing and querying large data sets (beyond 5,000 rows) in SQL Azure • Safely managing security and secrets in your Azure code with Managed Service Identities and Key Vault Attendees should have a working knowledge of C# development and familiarity with SharePoint Online. Don't miss this opportunity to upgrade your development skills for modern SharePoint!
  • #4: 3