3. @ME
•20 years of industry experience
•Both Dutch and Swedish nationality
•Living in Stockholm, Sweden
•MCSM, MCM, MCT, MCSE, MCSD, MCSA, MCPD, MCITP, MCTS certifications
•Knowit AB
erwin.van.hunen@knowit.se
@erwinvanhunen
se.linkedin.com/in/erwinvanhunen
5. ACS
Users
External System
Custom Web Service
SharePoint
1. User updates SharePoint list
3. Registered event receiver called
2. SharePoint requests a token from ACS
4. Line of business system is updated
5. Event receiver returns
https://github.com/OfficeDev/PnP/blob/master/Documentation/O365DevPnP%20-%20Site%20Provisioning.pptx
6. ACS
Users
External System
Custom Web Service
SharePoint
1. User updates SharePoint list
3. Registered event receiver called
2. SharePoint requests a token from ACS
4. Line of business system is updated
6. Event receiver calls back into SharePoint
5. Event receiver requests a token from ACS
https://github.com/OfficeDev/PnP/blob/master/Documentation/O365DevPnP%20-%20Site%20Provisioning.pptx
7. A BIT OF THEORY
ASYNCHRONOUS
SYNCHRONOUS
•‘Before’ events
•ItemAdding
•ItemUpdating
•ItemDeleting
•‘After’ events
•ItemAdded
•ItemUpdated
•ItemDeleted
8. SYNCHRONOUS EVENTS
CAN BE CANCELLED
NOT FOR LONG RUNNING TASKS
•Cancel with no error
•Cancel with error
•Cancel with redirect
9. ASYNCHRONOUS EVENTS
CANNOT BE CANCELLED
NOT FOR LONG RUNNING TASKS
•At least not with a way to inform the user
11. APP EVENTS
APPINSTALLED
APPUPGRADED
APPUNINSTALLING
•Executed when the app is installed in a site
•Caveat: when using push installations the event will only run once!
•Executed when the user decides to upgrade the app
•Executed when the user decides to uninstall the app
•While debugging, make sure that the webservice/app is up and running
12. GOOD TO KNOW!
Events might be called several times
App events need to respondwithin a certain timeout. If no answer, the server will retry.
You have to handle that in your code, e.g. keep state, check if artifacts already exist before trying to create them, etc.
19. SharePoint Online
LIST
Developer Machine
https://tenant.sharepoint.com
https://localhost:44300
X
Azure
ServiceBus
20. Azure ServiceBus
LOCALHOST
EVENT RECEIVER URLS ARE BEING REPLACED DURING DEPLOYMENT
•Localhost is a different server to SharePoint Online
•Make sure to disable the usage of Azure ServiceBusto debug when going live.
21. Azure ServiceBus
ACS AUTHENTICATIONNEEDED
ONLY DEFAULT ON SB INSTANCES CREATED BEFORE AUGUST 2014
Create new Azure SB instance:
New-AzureSPNamespace–Name <yoursbname> –Location “<location>” –CreateACSNamespace
Location = Northern Europe, Western Europe etc.