Event Grid Può essere usato in modo estremamente pervasivo e versatile per costruire architetture serverless reattive, ad esempio nel mondo IoT delle Smart Things, a costo “quasi zero”. Con Event GRid è possibile creare sistemi potenzialmente giganteschi (e impossibili da ricreare on premises), che si autogovernano, espandono (e cambiano!!!) sulla base delle logiche di campo.
5. True or not? «I Govern My VMs so I’ll never change»
Telemathics WTF – why not serverless
You Don’t know how WHO is that really? You’re scared about lose control….. It hurts …..
HOW ABOUT TO «GOVERN» WITH SERVERLESS?
9. Azure Serverless Ecosystem
“EG” Completes the vision, giving serverless
dynamic messaging capability
• Azure Functions – Serverless compute
• Logic Apps – Serverless connectivity and workflows
• Service Bus – Serverless messaging
• Event Grid – Serverless Events
10. 1. Why should I use Serverless?
2. When Should I consider the Serverless way?
3. Can I mix serverless with Traditional?
Thre questions about YOUR maturity
12. What is Event grid?
Backbone of event-driven computing
• Cloud service that provides Infrastructure
for Event driven computing
• EG focus on events that say «Something is
happened»
• It enables NRT delivery ( x < 1sec) at scale
(> 1000ev/sec)
• Based on Publish Subscribe pattern
• Language Agnostic
13. • DEFINITION of INTERNET BACKBONE: An Internet backbone refers to one
of the principal data routes between large, strategically interconnected
networks and core routers on the Internet.
• DEFINITION OF EG BACKBONE: An EventGrid backbone refers to one of
the principal data routes between large, strategically interconnected
FLOWS and core routers on the Grid.
• How I can program within a backbone?
WTF? Is it a Backbone?
GBB in FLOWCHARTING
14. What is the GOAL of Event Grid?
1. Handling Webhooks events
15. What is the GOAL of Event Grid?
2. Managing Events in one place
16. • DECOUPLING: The producer is not aware of the no. of consumers.
• EFFICIENCY FLOW: Multiple streams can be filtered and sent to the
consumers that are registered for that specific data stream.
• IMPROVED CAPABILITIES: Temporary consumers; Batch support;
managed delivery
Differences with the past
WHY NOT AN ESB?
17. • Event grid supports Push model
• Never ask or Poll
• No costs due to poll overheading
• Native integrations
• Enables fan out
• Reliable delivery (24H retry policy)
• DLQ support
• Event grid support RBAC based Event Domain security
• «Wild» subscription is under control
• Security via AAD is totally supported
• Event grid is REALLY Production ready
• Recovery point objective (RPO): Metadata=0m, Data=5m
• Recovery time objective (RTO): Metadata=60m, Data=60m
Why Event grid?
18. • How many time have we searched for a Fanout Component?
• … What do you mean with SECURE FANOUT?
• …. And WHAT ABOUT REDELIVERY? And DLQ?
The Fanout dream
The problem
about
Function
FANOUT?
1.Deployment
necessary
2. Recovery
partial failures
The problem
about
EVENTHUB
FANOUT?
1.Filtering
2.$$
Storage blob Event Grid Logic App/FlowImage
Cognitive Services
Function
Outlook email
Notification
Analysis
WebHook
Test
Request Bin
Computer Vision API
Function
Cognitive Services
Analysis
Face API
19. Event grid features
• HTTP response code to Ackowledge receipt of events
• Exponential back off retry (es: 10s, 30s, ecc)
• Retry duration expires after 24hr
• Configuarable DLQ destination
20. Think ONLY about detailed
logic patterns in order to
guarantee delivery
My world without EG
• 1 WEBJOB CONSUMER => 1 QUEUE
• 1 QUEUE +Recovery Job
• 1QUEUE = DLQ
• 1 retryJob
• 1 storage Container with faults
• 1 AI exception per fault
You see only 2 job … but there were tons on them
21. How to use it
Two usage types:
ENVIRONMENT EVENTS/REACTIONS
1. Azure services can send events to EG natively
2. Azure service can react to EG events natively
ACTIVE/REACTIVE ENDPOINTS
1. EG support WebHook forwarding
2. EG expose Web API to inject data into Event ecosystem
22. Concepts
• Event : what happened
• Event Publisher : where it took place
• Topic: where publishers send events
• Event Subscriptions: routes & filters events
• Filters: EventTypes, SubjectBeginsWith, SubjectEndsWith
• Event Handlers: app or service reacting to the event
24. Identity and Authentication
• Azure Active Directory
• Identity fabric of Azure Resources and Microsoft Graph Entities
• Managed identity authentication
• Service principal authentication
• User-based authentication
• Non-Azure AD
• API Keys
• Anonymous
25. • Event are sent to Azure Event Grid in an array (!!!!), which can contain
multiple event objects
• The array can have a total size of up to 1 MB. Each event in the array is
limited to 64Kb
Events in EG
Which is the schema?
EventGridSchema?
or Cloud Events 1.0 ??
30. Event Grid Filtering
Advanced Filters
String
In/Not in
Beings with/Ends with
Contains
Numerical
In/Not In
Greater than/Less than
Greater than or equal/Less than or equal
Boolean
String usage:
- PRIORITY|value|FLOWID
- CORR-ID|value|ASPECT
Number:
- CLUSTERING
- POSITIONBASED (1001,2001,3001)
Boolean:
….. True or false? :D
USE THEM, WITH «SALT IN THE HEAD»
31. Limits & Tricks
Resource Limit
Topics per event domain 100,000
Event subscriptions per topic within a domain 500
Domain scope event subscriptions 50
Publish rate for an event domain (ingress) 5,000 events per second
Publish requests 250 per second
Event Domains per Azure Subscription 100
Resource Limit
Custom topics per Azure subscription 100
Event subscriptions per topic 500
Publish rate for a custom topic (ingress) 5,000 events per second per topic
Publish requests 250 per second
Event size Support for 64 KB in General Availability (GA). Support for 1 MB is currently in preview.
Event grid
Event grid with Event domains
32. • More complete Event viewer
• A standard Json2EventHub2TSI to view timeseries
• A standard Json2SQL2PowerBI in order to view «Facts»
• A standard script to deploy subscription + functions + data into
Management DBs
Do you need more? yes
35. Typical Italian situation…
1. Il commerciale ha venduto una cosa
1. Di cui non aveva idea, ha detto si per prendere il cliente. E ora tocca a noi sbrogliare la matassa
2. Senza rendersi conto dei costi cloud che porterà, e non li ha messi in conto al cliente. Ora
fioccheranno le VM e «ciao ciao cloud FICO»
3. Che pensava che avessimo già fatto, ma non è proprio la stessa cosa, inutile spiegargliela perché
non capirebbe.
2. Il dev a Novembre spesso dice … AAAH VORREI AVERE IL TEMPO PER ….. e dopo a Luglio….. «SI MA CHI SI
METTE ADESSO A ROMPERE TUTTO? … ORMAI STA IN PIEDI COSI’ e amen. ..BIRRETTA?»
From «ITALIANSSS»
Apologize for ITALIAN LANGUAGE.. But it was better this way :D
36. The Less Simple Demo
This is the unique
swiss knife if you
have a problem
called
COMMERCIAL
CREATIVITY
Don’t worry. July will be the «PHI Variable» month, with no regrets about architecture design.
37. My example about Iterative Maturity
EG
COMMAND
QUEUE
REAL
EXECUTOR
EXECUTION
REGISTRY
PENDING
CONTENT
EG
OPERATION
DOSSIER
Cambio fase
Op.
completata
Pulirà il DB Execution registry
Pulirà il Pending content CACHE
ALERT MONITOR
FEEDER
Op. Iniziata
DLQ
monitorata
• Which is the MVP?
• What are the necessary improvements?
• What are the common parts?
• Are the personalization decoupled?
38. • Redis Edge: K,v [status], Sorted set [TimeSeries]
• Functions: everything
• Stream Analytics Edge: Circular buffer
• Storage Edge: cold data daily preparation place
• SQL Edge: matched events
• NOW there is the BACKBONE !!!!!!!!
• Capture events (es: stoppages, run, product.change)
• Capture PLC alarms
• Capture maintenance operational modes
• When Shift change, change local Registry for a better Edge enrichment
Event grid and & Iot Edge
39. Event Grid & IoT Edge
Nome: eventgridmodule
URI immagine: mcr.microsoft.com/azure-event-grid/iotedge:latest
Binding: 4438
How to create EG-EDGE
Nome: Sottoscrittore
URI immagine: mcr.microsoft.com/azure-event-grid/iotedge-samplesubscriber-azfunc:latest
Binding: 8080
How to communicate with EG-EDGE
curl -k -H "Content-Type: application/json" -X PUT -g -d @topic.json https://<your-edge-device-public-ip-here>:4438/topics/sampleTopic1?api-version=2019-01-01-preview
How to create a topic
{ "name": "sampleTopic1", "properties": { "inputschema": "eventGridSchema" } }
And how to check it:
curl -k -H "Content-Type: application/json" -X GET -g https://<your-edge-device-public-ip-here>:4438/topics/sampleTopic1?api-version=2019-01-01-preview
curl -k -H "Content-Type: application/json" -X PUT -g -d @subscription.json https://<your-edge-device-public-ip-here>:4438/topics/sampleTopic1/eventSubscriptions/sampleSubscription1?api-version=2019-01-01-preview
How to create a subscription
And how to check it
curl -k -H "Content-Type: application/json" -X GET -g https://<your-edge-device-public-ip-here>:4438/topics/sampleTopic1/eventSubscriptions/sampleSubscription1?api-version=2019-01-01-preview
{ "properties": { "destination": { "endpointType": "WebHook", "properties": { "endpointUrl": "http://subscriber:80/api/subscriber" } } } }
curl -k -H "Content-Type: application/json" -X POST -g -d @event.json https://<your-edge-device-public-ip-here>:4438/topics/sampleTopic1/events?api-version=2019-01-01-preview
How to publish an event
And remember the Schema!!!!!
41. EG fits with Everything. USE IT!
Storage blob Event Grid Logic App/FlowImage
Cognitive Services
Function
Outlook email
Notification
Analysis
WebHook
Test
Request Bin
Computer Vision API
Function
Cognitive Services
Analysis
Face API
Service
Fabric Event Grid
Azure
Function
Storage table
Office 365
logging
events
Filter:
error events
allevents
all
events
Logic
App
email
alert
Storage blob
Event Grid
storage
event
storage
event
Webhook
EG
COMMAND
QUEUE
REAL
EXECUTOR
EXECUTION
REGISTRY
PENDING
CONTENT
EG
OPERATION
DOSSIER
Cambio fase
Op.
completata
Pulirà il DB Execution registry
Pulirà il Pending content CACHE
ALERT MONITOR
FEEDER
Op. Iniziata
DLQ
monitorata
PLACE HOLDER FOR
YOUR
EXAMPLE