SlideShare a Scribd company logo
Automating Provisioning For Your
Digital Workplace: With Azure Durable
Functions & Microsoft Graph
SharePoint Saturday Toronto 2019
Vincent Biret
PLATINUM
Thank You Sponsors!
SILVERGOLD
3
SharePint
SharePint
The Drake & Firkin
6982 Financial Dr, Mississauga, ON L5N 8J4
SharePoint Saturday
Toronto #SPSToronto
Passionate about technologies, development and community
Vincent Biret
@baywet
bit.ly/vince365
Microsoft Office Dev MVP
Azure and Office 365 developer @ 2toLead
Audience?
Agenda
Introduction
User Interface choices
Automation choices
Azure Durable Functions
SharePoint specifics
Microsoft Graph
Conclusion
Ready?
Context
2017201620152014
Over the last years Microsoft focused on delivering more specialized tools
Microsoft 365 Ecosystem
201820132012
Different tools for boundaries
Internal
External
Public
It’s important to consider the right tool for the right boundary, and your automation options must account
for it as well.
Overall users are happier with better tools, but it added stress on IT and power users.
The effects of more specialized tools
Pros
More efficient
Better capabilities
Faster releases
Cons
Context Switching
Licensing complexity
Managing multiple API’s
Administrative lifecycle
tasks
The first rule of licensing is we
don’t talk about licensing
Provisioning processes can be quite complex and often require to integrate many
technologies together. Thankfully the Microsoft Graph provides most of the APIs.
What do we want to automate?
Create Office 365 group
Enable Teams on the group
Update the logo
Set security
Create Channels for each project
Create a templated NoteBook for
each project
Create a Planner Plan for each
project
Add a welcome message
Add all the tabs
Create extranet site collection &
sites
Apply a template to it
…
Building custom User
Interfaces in
Microsoft 365
When building custom user interfaces for Office 365, the trick is to find the right balance.
Available choices when building custom UI
COMPLEXITY
C
O
N
T
R
O
L
Bots
Custom
Teams Tabs/SPFx
PowerApps
Forms
Benefits of going SPFx/Teams
Modern technologies (react, typescript…)
Open source libraries (PnP & more)
Integrated AuthN & AuthZ
Integrated hosting
Discoverable
High flexibility/control
UI of the provisioning solution
Demo
Automating in
Office 365
Azure Functions is a good complement to Flow/Logic App. Logic App good transition
from Microsoft Flow to move from user centric to entreprise grade
Available choices when automating O365
COMPLEXITY
C
O
N
T
R
O
L
App Service
Environment
Automation
RunBooks
Custom
WebJobs
WebApps
Functions
Logic Apps
Flow
ASE is a great tool to automate things for Office 365, especially if you’re a dev, with
almost no limitations
Benefits of App Service Environment
Built-in auth (Easy-Auth)
Built-in security (SSL…)
Autoscale
API driven (CORS…)
Built-in connectivity (vnet, vpns…)
Proven technology (6+ years)
Easy to get started
Cheap
Easy auth, CORS setup, CORS for dev
Demo
Azure Durable
Functions
Implementing complex workflows was complex with Azure Functions which are designed
for quick and simple activities
Value proposition of Azure Functions
Pros
Cheap
Fast
Simple
Scale extensively
Cons
Stateless
Coordination nightmare!
10/15 min limit run time
A common pattern to chain Azure Function was to use queues
Coordinating Azure Functions: Chaining
A common pattern to chain Azure Function was to use a state repository, each function
triggering the next one
Coordinating Azure Functions: State Repo
The pain of coordinating Azure Functions grows exponentially with the number of
functions.
TRYING TO
COORDINATE MANY
FUNCTIONS
Durable Functions remove a lot of pain introduced with regular functions
Introducing Durable Functions
All the benefits of « regular » Functions
Code defined workflow
Automates state management
Reports status
Enables new design patterns
Fan out/Fan-in
Chaining
Monitoring
The Orchestrator leverages a decorator design pattern to « work it’s magic »
High level overview
Orchestration
client
State persistence
Orchestrator
ActivitiesTrigger
Always remember these key principles toi avoid strange behavior
Important things about Orchestrator
Orchestrator WILL run multiple time
Orchestrator ONLY coordinates activities
No random
No time
No async calls
Idem potent logic
Use orchestrator methods to call activities
Activities input/output MUST be serializable
Azure Durable Functions Orchestrator and Activities, Graph Beta Client
Demo
SharePoint Specifics
Authentication & Authorization
Use Azure Active Directory, not ACS anymore
Most of ACS retired a year ago, which is not a good sign for
auth part
Use certificate (not secret) authentication
Otherwise, for some endpoints, you’ll get a token, and a
403…
¯_(ツ)_/¯
The situation is currently painful if you want to leverage Azure Functions and work with
SharePoint’s CSOM
Laggy SDK/CSOM
CSOM still does not support dot net standard
Azure Functions are now on dot net core 2.x
Most libraries moved to dot net standard
Painful transition ADAL/MSAL on top of that
Functions/Activities can only run for 10/15 minutes
It is possible to synchronize a webjob and Durable Functions using queues or events.
Either to the same orchestrator or a separate one.
Laggy SDK/CSOM - solutions
• Talk to SharePoint REST APIs & split the code
• This
Orchestration
client
State persistence
Orchestrator
Activities
Trigger
Events
WebJob
The WebJob for SharePoint and Synchronisation
Demo
Conclusion
Conclusion
Lot of time saved
Consistency of environments
Self-Service
Deep integration
Money saved
Bit.ly/vince365 @baywet slideshare.net/VincentBIRET
Thanks!/Questions?
Vincent Biret
Office 365 and Azure
Developer, 2toLead
@baywet
Bit.ly/vince365

More Related Content

#SPSToronto Digital Workplace provisioning with #MicrosoftGraph and #Azure functions

  • 1. Automating Provisioning For Your Digital Workplace: With Azure Durable Functions & Microsoft Graph SharePoint Saturday Toronto 2019 Vincent Biret
  • 3. 3 SharePint SharePint The Drake & Firkin 6982 Financial Dr, Mississauga, ON L5N 8J4 SharePoint Saturday Toronto #SPSToronto
  • 4. Passionate about technologies, development and community Vincent Biret @baywet bit.ly/vince365 Microsoft Office Dev MVP Azure and Office 365 developer @ 2toLead
  • 6. Agenda Introduction User Interface choices Automation choices Azure Durable Functions SharePoint specifics Microsoft Graph Conclusion
  • 9. 2017201620152014 Over the last years Microsoft focused on delivering more specialized tools Microsoft 365 Ecosystem 201820132012
  • 10. Different tools for boundaries Internal External Public It’s important to consider the right tool for the right boundary, and your automation options must account for it as well.
  • 11. Overall users are happier with better tools, but it added stress on IT and power users. The effects of more specialized tools Pros More efficient Better capabilities Faster releases Cons Context Switching Licensing complexity Managing multiple API’s Administrative lifecycle tasks The first rule of licensing is we don’t talk about licensing
  • 12. Provisioning processes can be quite complex and often require to integrate many technologies together. Thankfully the Microsoft Graph provides most of the APIs. What do we want to automate? Create Office 365 group Enable Teams on the group Update the logo Set security Create Channels for each project Create a templated NoteBook for each project Create a Planner Plan for each project Add a welcome message Add all the tabs Create extranet site collection & sites Apply a template to it …
  • 14. When building custom user interfaces for Office 365, the trick is to find the right balance. Available choices when building custom UI COMPLEXITY C O N T R O L Bots Custom Teams Tabs/SPFx PowerApps Forms
  • 15. Benefits of going SPFx/Teams Modern technologies (react, typescript…) Open source libraries (PnP & more) Integrated AuthN & AuthZ Integrated hosting Discoverable High flexibility/control
  • 16. UI of the provisioning solution Demo
  • 18. Azure Functions is a good complement to Flow/Logic App. Logic App good transition from Microsoft Flow to move from user centric to entreprise grade Available choices when automating O365 COMPLEXITY C O N T R O L App Service Environment Automation RunBooks Custom WebJobs WebApps Functions Logic Apps Flow
  • 19. ASE is a great tool to automate things for Office 365, especially if you’re a dev, with almost no limitations Benefits of App Service Environment Built-in auth (Easy-Auth) Built-in security (SSL…) Autoscale API driven (CORS…) Built-in connectivity (vnet, vpns…) Proven technology (6+ years) Easy to get started Cheap
  • 20. Easy auth, CORS setup, CORS for dev Demo
  • 22. Implementing complex workflows was complex with Azure Functions which are designed for quick and simple activities Value proposition of Azure Functions Pros Cheap Fast Simple Scale extensively Cons Stateless Coordination nightmare! 10/15 min limit run time
  • 23. A common pattern to chain Azure Function was to use queues Coordinating Azure Functions: Chaining
  • 24. A common pattern to chain Azure Function was to use a state repository, each function triggering the next one Coordinating Azure Functions: State Repo
  • 25. The pain of coordinating Azure Functions grows exponentially with the number of functions. TRYING TO COORDINATE MANY FUNCTIONS
  • 26. Durable Functions remove a lot of pain introduced with regular functions Introducing Durable Functions All the benefits of « regular » Functions Code defined workflow Automates state management Reports status Enables new design patterns Fan out/Fan-in Chaining Monitoring
  • 27. The Orchestrator leverages a decorator design pattern to « work it’s magic » High level overview Orchestration client State persistence Orchestrator ActivitiesTrigger
  • 28. Always remember these key principles toi avoid strange behavior Important things about Orchestrator Orchestrator WILL run multiple time Orchestrator ONLY coordinates activities No random No time No async calls Idem potent logic Use orchestrator methods to call activities Activities input/output MUST be serializable
  • 29. Azure Durable Functions Orchestrator and Activities, Graph Beta Client Demo
  • 31. Authentication & Authorization Use Azure Active Directory, not ACS anymore Most of ACS retired a year ago, which is not a good sign for auth part Use certificate (not secret) authentication Otherwise, for some endpoints, you’ll get a token, and a 403… ¯_(ツ)_/¯
  • 32. The situation is currently painful if you want to leverage Azure Functions and work with SharePoint’s CSOM Laggy SDK/CSOM CSOM still does not support dot net standard Azure Functions are now on dot net core 2.x Most libraries moved to dot net standard Painful transition ADAL/MSAL on top of that Functions/Activities can only run for 10/15 minutes
  • 33. It is possible to synchronize a webjob and Durable Functions using queues or events. Either to the same orchestrator or a separate one. Laggy SDK/CSOM - solutions • Talk to SharePoint REST APIs & split the code • This Orchestration client State persistence Orchestrator Activities Trigger Events WebJob
  • 34. The WebJob for SharePoint and Synchronisation Demo
  • 36. Conclusion Lot of time saved Consistency of environments Self-Service Deep integration Money saved
  • 37. Bit.ly/vince365 @baywet slideshare.net/VincentBIRET Thanks!/Questions? Vincent Biret Office 365 and Azure Developer, 2toLead @baywet Bit.ly/vince365

Editor's Notes

  1. Mostly Devs and architects that want to know how to implement it. PMO and PMs who want to know how it’s done. Questions: XP with functions XP with SPFx XP with MS Graph
  2. Gestion des questions, interaction, ok avec ce programme?
  3. Timing: Just talk about the releases, do not explain what the products do
  4. Discoverable: Teams Tabs, SharePoint App Pages, Webpart gallery, already in tools users leverage
  5. Show the application page (create a PMO team and embed as a tab?), show all the controls (pnp), show the SPFx project and react components
  6. Tip: flows are in fact Azure logic Apps behind the scenes
  7. Not using event because passing data back (SharePoint) and renewing token (OneNote)
  8. Money save = dev time saved, less support to provide, better product/service