SlideShare uma empresa Scribd logo
1 de 26
Baixar para ler offline
Debugging Remote Event Receivers 
#SPCon14
@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
HANDS UP! 
Who is using event receivers today?
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
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
A BIT OF THEORY 
ASYNCHRONOUS 
SYNCHRONOUS 
•‘Before’ events 
•ItemAdding 
•ItemUpdating 
•ItemDeleting 
•‘After’ events 
•ItemAdded 
•ItemUpdated 
•ItemDeleted
SYNCHRONOUS EVENTS 
CAN BE CANCELLED 
NOT FOR LONG RUNNING TASKS 
•Cancel with no error 
•Cancel with error 
•Cancel with redirect
ASYNCHRONOUS EVENTS 
CANNOT BE CANCELLED 
NOT FOR LONG RUNNING TASKS 
•At least not with a way to inform the user
EVENTS 
ItemAddingItemUpdatingItemDeletingItemCheckingInItemCheckingOutItemUncheckingOutItemAttachmentAddingItemAttachmentDeletingItemFileMovingItemVersionDeleting 
FieldAdding 
FieldUpdating 
FieldDeleting 
ListAdding 
ListDeleting 
SiteDeleting 
WebDeleting 
WebMoving 
WebAdding 
GroupAdding 
GroupUpdating 
GroupDeleting 
GroupUserAdding 
GroupUserDeleting 
RoleDefinitionAdding 
RoleDefinitionUpdating 
RoleDefinitionDeleting 
RoleAssignmentAdding 
RoleAssignmentDeleting 
InheritanceBreaking 
InheritanceResetting 
ItemAdded 
ItemUpdated 
ItemDeleted 
ItemCheckedIn 
ItemCheckedOut 
ItemUncheckedOut 
ItemAttachmentAdded 
ItemAttachmentDeleted 
ItemFileMoved 
ItemFileConverted 
ItemVersionDeleted 
FieldAdded 
FieldUpdated 
FieldDeleted 
ListAdded 
ListDeleted 
SiteDeleted 
WebDeleted 
WebMoved 
WebProvisioned 
WebRestored 
GroupAdded 
GroupUpdated 
GroupDeleted 
GroupUserAdded 
GroupUserDeleted 
RoleDefinitionAdded 
RoleDefinitionUpdated 
RoleDefinitionDeleted 
RoleAssignmentAdded 
RoleAssignmentDeleted 
InheritanceBroken 
InheritanceReset 
EntityInstanceAdded 
EntityInstanceUpdated 
EntityInstanceDeleted 
AppInstalled 
AppUpgraded 
AppUninstalling
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
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.
DEMO 
SITE MODIFIER
PATTERN 
APP INSTALLATION PATTERN
APP INSTALLATION PATTERN 
APP HANDLES APPINSTALLED EVENT 
APP REGISTERS ADDITIONAL EVEN RECEIVERS 
SAME WEBSERVICE THAT HANDLES ALL EVENTS
DEMO 
APP INSTALLATION PATTERN
CAVEAT 
Custom events registered through the object model that do not reside in an app will not receive a context 
•Create an App Only context
DEBUGGING
SharePoint Online 
LIST 
Developer Machine 
https://tenant.sharepoint.com 
https://localhost:44300 
X 
Azure 
ServiceBus
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.
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.
https://github.com/officedev/pnp
CMDLETS 
Get-SPOEventReceiver 
[-List [<ListPipeBind>]] 
[-Identity [<GuidPipeBind>]] 
[-Web [<WebPipeBind>]]
CMDLETS 
Add-SPOEventReceiver 
-List [<ListPipeBind>] 
-Name [<String>] -Url[<String>] 
-EventReceiverType[<EventReceiverType>] 
-Synchronization [<EventReceiverSynchronization>] 
[-SequenceNumber[<Int32>]] 
[-Force [<SwitchParameter>]] 
[-Web [<WebPipeBind>]]
CMDLETS 
Remove-SPOEventReceiver 
[-List [<ListPipeBind>]] 
-Identity [<GuidPipeBind>] 
[-Force [<SwitchParameter>]] 
[-Web [<WebPipeBind>]]
Spca2014 debugging remote event receivers van hunen

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Sauce Labs for Visual Studio Team Services & TFS
Sauce Labs for Visual Studio Team Services & TFSSauce Labs for Visual Studio Team Services & TFS
Sauce Labs for Visual Studio Team Services & TFS
 
Selenium and Appium Training from Sauce Labs
Selenium and Appium Training from Sauce LabsSelenium and Appium Training from Sauce Labs
Selenium and Appium Training from Sauce Labs
 
Continuous Testing in the Cloud
Continuous Testing in the CloudContinuous Testing in the Cloud
Continuous Testing in the Cloud
 
Automation Best Practices
Automation Best PracticesAutomation Best Practices
Automation Best Practices
 
PuppetConf 2016: Site Launch Automation: From Days to Minutes – Kristen Crawf...
PuppetConf 2016: Site Launch Automation: From Days to Minutes – Kristen Crawf...PuppetConf 2016: Site Launch Automation: From Days to Minutes – Kristen Crawf...
PuppetConf 2016: Site Launch Automation: From Days to Minutes – Kristen Crawf...
 
Zero to Test Driven Infrastructure
Zero to Test Driven Infrastructure Zero to Test Driven Infrastructure
Zero to Test Driven Infrastructure
 
Frail & Cast Iron tools - a Postman Case Study
Frail & Cast Iron tools - a Postman Case StudyFrail & Cast Iron tools - a Postman Case Study
Frail & Cast Iron tools - a Postman Case Study
 
Cloud Networking
Cloud NetworkingCloud Networking
Cloud Networking
 
Cloud Platforms for Java
Cloud Platforms for JavaCloud Platforms for Java
Cloud Platforms for Java
 
Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk
Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic BeanstalkDeploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk
Deploy, Manage, and Scale Your Apps with OpsWorks and Elastic Beanstalk
 
What is Sauce Labs?
What is Sauce Labs? What is Sauce Labs?
What is Sauce Labs?
 
Terraform Testing with InSpec Demo
Terraform Testing with InSpec DemoTerraform Testing with InSpec Demo
Terraform Testing with InSpec Demo
 
Accelerating DevOps Collaboration with Sauce Labs and JIRA
Accelerating DevOps Collaboration with Sauce Labs and JIRAAccelerating DevOps Collaboration with Sauce Labs and JIRA
Accelerating DevOps Collaboration with Sauce Labs and JIRA
 
Alexandre Roman - How Pivotal Cloud Foundry can help you run Spring at scale ...
Alexandre Roman - How Pivotal Cloud Foundry can help you run Spring at scale ...Alexandre Roman - How Pivotal Cloud Foundry can help you run Spring at scale ...
Alexandre Roman - How Pivotal Cloud Foundry can help you run Spring at scale ...
 
Ruby on Rails and AWS Elastic Beanstalk
Ruby on Rails and AWS Elastic BeanstalkRuby on Rails and AWS Elastic Beanstalk
Ruby on Rails and AWS Elastic Beanstalk
 
Monitoring As Code: How to Integrate App Monitoring Into Your Developer Cycle
Monitoring As Code: How to Integrate App Monitoring Into Your Developer CycleMonitoring As Code: How to Integrate App Monitoring Into Your Developer Cycle
Monitoring As Code: How to Integrate App Monitoring Into Your Developer Cycle
 
Update Smart: Use a Staging Site!
Update Smart: Use a Staging Site!Update Smart: Use a Staging Site!
Update Smart: Use a Staging Site!
 
Using Postman to Automate API On-Boarding
Using Postman to Automate API On-BoardingUsing Postman to Automate API On-Boarding
Using Postman to Automate API On-Boarding
 
Testing & Troubleshooting Modern Apps with AWS Device Farm: Mobile Week SF
Testing & Troubleshooting Modern Apps with AWS Device Farm: Mobile Week SFTesting & Troubleshooting Modern Apps with AWS Device Farm: Mobile Week SF
Testing & Troubleshooting Modern Apps with AWS Device Farm: Mobile Week SF
 
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
POST/CON 2019 Workshop: Testing, Automated Testing, and Reporting APIs with P...
 

Semelhante a Spca2014 debugging remote event receivers van hunen

Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity APIBuilding SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
SharePointRadi
 

Semelhante a Spca2014 debugging remote event receivers van hunen (20)

AWS Summit Stockholm 2014 – T4 – Continuous integration on AWS
AWS Summit Stockholm 2014 – T4 – Continuous integration on AWSAWS Summit Stockholm 2014 – T4 – Continuous integration on AWS
AWS Summit Stockholm 2014 – T4 – Continuous integration on AWS
 
What IT professionals need to know about SharePoint 2013 Apps
What IT professionals need to know about SharePoint 2013 AppsWhat IT professionals need to know about SharePoint 2013 Apps
What IT professionals need to know about SharePoint 2013 Apps
 
Developer’s Independence Day: Introducing the SharePoint App Model
Developer’s Independence Day:Introducing the SharePoint App ModelDeveloper’s Independence Day:Introducing the SharePoint App Model
Developer’s Independence Day: Introducing the SharePoint App Model
 
Office Track: SharePoint Apps for the IT Pro - Thomas Vochten
Office Track: SharePoint Apps for the IT Pro - Thomas VochtenOffice Track: SharePoint Apps for the IT Pro - Thomas Vochten
Office Track: SharePoint Apps for the IT Pro - Thomas Vochten
 
Exercising and Scaling Up Mobile DevOps in the Enterprise
Exercising and Scaling Up Mobile DevOps in the EnterpriseExercising and Scaling Up Mobile DevOps in the Enterprise
Exercising and Scaling Up Mobile DevOps in the Enterprise
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples
 
Azure functions
Azure functionsAzure functions
Azure functions
 
Set up an SharePoint On-Premises environment for developing provider-hosted a...
Set up an SharePoint On-Premises environment for developing provider-hosted a...Set up an SharePoint On-Premises environment for developing provider-hosted a...
Set up an SharePoint On-Premises environment for developing provider-hosted a...
 
Uncovering breaking changes behind UI on mobile applications
Uncovering breaking changes behind UI on mobile applicationsUncovering breaking changes behind UI on mobile applications
Uncovering breaking changes behind UI on mobile applications
 
.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric
 
IOT328_Building an AWS IoT-Enabled Drink Dispenser
IOT328_Building an AWS IoT-Enabled Drink DispenserIOT328_Building an AWS IoT-Enabled Drink Dispenser
IOT328_Building an AWS IoT-Enabled Drink Dispenser
 
Building an AWS IoT-Enabled Drink Dispenser - IOT328 - re:Invent 2017
Building an AWS IoT-Enabled Drink Dispenser - IOT328 - re:Invent 2017Building an AWS IoT-Enabled Drink Dispenser - IOT328 - re:Invent 2017
Building an AWS IoT-Enabled Drink Dispenser - IOT328 - re:Invent 2017
 
IOT328_Building an AWS IoT-Enabled Drink Dispenser
IOT328_Building an AWS IoT-Enabled Drink DispenserIOT328_Building an AWS IoT-Enabled Drink Dispenser
IOT328_Building an AWS IoT-Enabled Drink Dispenser
 
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity APIBuilding SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity API
 
Taking AppSec to 11 - BSides Austin 2016
Taking AppSec to 11 - BSides Austin 2016Taking AppSec to 11 - BSides Austin 2016
Taking AppSec to 11 - BSides Austin 2016
 
DevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
DevOps on AWS: Accelerating Software Delivery with the AWS Developer ToolsDevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
DevOps on AWS: Accelerating Software Delivery with the AWS Developer Tools
 
Continuous Delivery Agiles 2014 Medellin
Continuous Delivery Agiles 2014 MedellinContinuous Delivery Agiles 2014 Medellin
Continuous Delivery Agiles 2014 Medellin
 
Heading to the Cloud : Introduction to deploying a Provider-Hosted App in Azure
Heading to the Cloud : Introduction to deploying a Provider-Hosted App in AzureHeading to the Cloud : Introduction to deploying a Provider-Hosted App in Azure
Heading to the Cloud : Introduction to deploying a Provider-Hosted App in Azure
 
Prepararsi a spostare le proprie applicazioni share point su office 365
Prepararsi a spostare le proprie applicazioni share point su office 365Prepararsi a spostare le proprie applicazioni share point su office 365
Prepararsi a spostare le proprie applicazioni share point su office 365
 
DevOps and Application Delivery for Hybrid Cloud - DevOpsSummit session
DevOps and Application Delivery for Hybrid Cloud  - DevOpsSummit sessionDevOps and Application Delivery for Hybrid Cloud  - DevOpsSummit session
DevOps and Application Delivery for Hybrid Cloud - DevOpsSummit session
 

Mais de NCCOMMS

Mais de NCCOMMS (20)

O365Con19 - UI:UX 101 Learn How to Design Custom Experiences for SharePoint -...
O365Con19 - UI:UX 101 Learn How to Design Custom Experiences for SharePoint -...O365Con19 - UI:UX 101 Learn How to Design Custom Experiences for SharePoint -...
O365Con19 - UI:UX 101 Learn How to Design Custom Experiences for SharePoint -...
 
O365Con19 - Model-driven Apps or Canvas Apps? - Rick Bakker
O365Con19 - Model-driven Apps or Canvas Apps? - Rick BakkerO365Con19 - Model-driven Apps or Canvas Apps? - Rick Bakker
O365Con19 - Model-driven Apps or Canvas Apps? - Rick Bakker
 
O365Con19 - Office 365 Groups Surviving the Real World - Jasper Oosterveld
O365Con19 - Office 365 Groups Surviving the Real World - Jasper OosterveldO365Con19 - Office 365 Groups Surviving the Real World - Jasper Oosterveld
O365Con19 - Office 365 Groups Surviving the Real World - Jasper Oosterveld
 
O365Con19 - Developing Timerjob and Eventhandler Equivalents - Adis Jugo
O365Con19 - Developing Timerjob and Eventhandler Equivalents - Adis JugoO365Con19 - Developing Timerjob and Eventhandler Equivalents - Adis Jugo
O365Con19 - Developing Timerjob and Eventhandler Equivalents - Adis Jugo
 
O365Con19 - Sharepoint with (Artificial) Intelligence - Adis Jugo
O365Con19 - Sharepoint with (Artificial) Intelligence - Adis JugoO365Con19 - Sharepoint with (Artificial) Intelligence - Adis Jugo
O365Con19 - Sharepoint with (Artificial) Intelligence - Adis Jugo
 
O365Con19 - What Do You Mean 90 days Isn't Enough - Paul Hunt
O365Con19 - What Do You Mean 90 days Isn't Enough - Paul HuntO365Con19 - What Do You Mean 90 days Isn't Enough - Paul Hunt
O365Con19 - What Do You Mean 90 days Isn't Enough - Paul Hunt
 
O365Con19 - Tips and Tricks for Complex Migrations to SharePoint Online - And...
O365Con19 - Tips and Tricks for Complex Migrations to SharePoint Online - And...O365Con19 - Tips and Tricks for Complex Migrations to SharePoint Online - And...
O365Con19 - Tips and Tricks for Complex Migrations to SharePoint Online - And...
 
O365Con19 - Start Developing Teams Tabs and SharePoint Webparts with SPFX - O...
O365Con19 - Start Developing Teams Tabs and SharePoint Webparts with SPFX - O...O365Con19 - Start Developing Teams Tabs and SharePoint Webparts with SPFX - O...
O365Con19 - Start Developing Teams Tabs and SharePoint Webparts with SPFX - O...
 
O365Con19 - Start Your Journey from Skype for Business to Teams - Sasja Beere...
O365Con19 - Start Your Journey from Skype for Business to Teams - Sasja Beere...O365Con19 - Start Your Journey from Skype for Business to Teams - Sasja Beere...
O365Con19 - Start Your Journey from Skype for Business to Teams - Sasja Beere...
 
O365Con19 - Lets Get Started with Azure Container Instances - Jussi Roine
O365Con19 - Lets Get Started with Azure Container Instances - Jussi RoineO365Con19 - Lets Get Started with Azure Container Instances - Jussi Roine
O365Con19 - Lets Get Started with Azure Container Instances - Jussi Roine
 
O365Con19 - Azure Blackbelt - Jussi Roine
O365Con19 - Azure Blackbelt - Jussi RoineO365Con19 - Azure Blackbelt - Jussi Roine
O365Con19 - Azure Blackbelt - Jussi Roine
 
O365Con19 - Customise the UI in Modern SharePoint Workspaces - Corinna Lins
O365Con19 - Customise the UI in Modern SharePoint Workspaces - Corinna LinsO365Con19 - Customise the UI in Modern SharePoint Workspaces - Corinna Lins
O365Con19 - Customise the UI in Modern SharePoint Workspaces - Corinna Lins
 
O365Con19 - Be The Protagonist of Your Modern Workplace - Corinna Lins
O365Con19 - Be The Protagonist of Your Modern Workplace - Corinna LinsO365Con19 - Be The Protagonist of Your Modern Workplace - Corinna Lins
O365Con19 - Be The Protagonist of Your Modern Workplace - Corinna Lins
 
O365Con19 - How to Really Manage all your Tasks Across Microsoft 365 - Luise ...
O365Con19 - How to Really Manage all your Tasks Across Microsoft 365 - Luise ...O365Con19 - How to Really Manage all your Tasks Across Microsoft 365 - Luise ...
O365Con19 - How to Really Manage all your Tasks Across Microsoft 365 - Luise ...
 
O365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
O365Con19 - Sharing Code Efficiently in your Organisation - Elio StruyfO365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
O365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
 
O365Con19 - Things I've Learned While Building a Product on SharePoint Modern...
O365Con19 - Things I've Learned While Building a Product on SharePoint Modern...O365Con19 - Things I've Learned While Building a Product on SharePoint Modern...
O365Con19 - Things I've Learned While Building a Product on SharePoint Modern...
 
O365Con19 - Keep Control of Your Data with AIP and CA - Bram de Jager
O365Con19 - Keep Control of Your Data with AIP and CA - Bram de JagerO365Con19 - Keep Control of Your Data with AIP and CA - Bram de Jager
O365Con19 - Keep Control of Your Data with AIP and CA - Bram de Jager
 
O365Con19 - Kaizala a Dive Into the Unknown - Rick van Rousselt
O365Con19 - Kaizala a Dive Into the Unknown - Rick van RousseltO365Con19 - Kaizala a Dive Into the Unknown - Rick van Rousselt
O365Con19 - Kaizala a Dive Into the Unknown - Rick van Rousselt
 
O365Con19 - How to Inspire Users to Unstick from Email - Luise Freese
O365Con19 - How to Inspire Users to Unstick from Email - Luise FreeseO365Con19 - How to Inspire Users to Unstick from Email - Luise Freese
O365Con19 - How to Inspire Users to Unstick from Email - Luise Freese
 
O365Con19 - O365 Identity Management and The Golden Config - Chris Goosen
O365Con19 - O365 Identity Management and The Golden Config - Chris GoosenO365Con19 - O365 Identity Management and The Golden Config - Chris Goosen
O365Con19 - O365 Identity Management and The Golden Config - Chris Goosen
 

Spca2014 debugging remote event receivers van hunen

  • 1.
  • 2. Debugging Remote Event Receivers #SPCon14
  • 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
  • 4. HANDS UP! Who is using event receivers today?
  • 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
  • 10. EVENTS ItemAddingItemUpdatingItemDeletingItemCheckingInItemCheckingOutItemUncheckingOutItemAttachmentAddingItemAttachmentDeletingItemFileMovingItemVersionDeleting FieldAdding FieldUpdating FieldDeleting ListAdding ListDeleting SiteDeleting WebDeleting WebMoving WebAdding GroupAdding GroupUpdating GroupDeleting GroupUserAdding GroupUserDeleting RoleDefinitionAdding RoleDefinitionUpdating RoleDefinitionDeleting RoleAssignmentAdding RoleAssignmentDeleting InheritanceBreaking InheritanceResetting ItemAdded ItemUpdated ItemDeleted ItemCheckedIn ItemCheckedOut ItemUncheckedOut ItemAttachmentAdded ItemAttachmentDeleted ItemFileMoved ItemFileConverted ItemVersionDeleted FieldAdded FieldUpdated FieldDeleted ListAdded ListDeleted SiteDeleted WebDeleted WebMoved WebProvisioned WebRestored GroupAdded GroupUpdated GroupDeleted GroupUserAdded GroupUserDeleted RoleDefinitionAdded RoleDefinitionUpdated RoleDefinitionDeleted RoleAssignmentAdded RoleAssignmentDeleted InheritanceBroken InheritanceReset EntityInstanceAdded EntityInstanceUpdated EntityInstanceDeleted AppInstalled AppUpgraded AppUninstalling
  • 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.
  • 15. APP INSTALLATION PATTERN APP HANDLES APPINSTALLED EVENT APP REGISTERS ADDITIONAL EVEN RECEIVERS SAME WEBSERVICE THAT HANDLES ALL EVENTS
  • 17. CAVEAT Custom events registered through the object model that do not reside in an app will not receive a context •Create an App Only context
  • 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.
  • 23. CMDLETS Get-SPOEventReceiver [-List [<ListPipeBind>]] [-Identity [<GuidPipeBind>]] [-Web [<WebPipeBind>]]
  • 24. CMDLETS Add-SPOEventReceiver -List [<ListPipeBind>] -Name [<String>] -Url[<String>] -EventReceiverType[<EventReceiverType>] -Synchronization [<EventReceiverSynchronization>] [-SequenceNumber[<Int32>]] [-Force [<SwitchParameter>]] [-Web [<WebPipeBind>]]
  • 25. CMDLETS Remove-SPOEventReceiver [-List [<ListPipeBind>]] -Identity [<GuidPipeBind>] [-Force [<SwitchParameter>]] [-Web [<WebPipeBind>]]