際際滷

際際滷Share a Scribd company logo
Microsoft Azure IoT per l'IT Pro
Marco Parenzan
1nn0va
@siditconferencesiditconference WindowServer.itsiditconference
Conference: #sidrs18
Microsoft Azure per l'IT Pro
 NET, IoT and Azure Developer, Trainer and
Consultant
 Microsoft MVP 2017 for Azure
 Book Author @ Packt, LSWR
 Community Lead 1nn0va
(facebook.com/1nn0va)
 marco [dot] parenzan [at] 1nn0va [dot] it
 Realizzare uninfrastruttura IoT
 Sicurezza in una soluzione IoT
 Gestire dispositivi con IoT Hub
 Deployment di dispositivi con Azure IoT Hub
 Processare eventi con Azure Serverless
 Conclusioni
Realizzare una infrastruttura IoT
Affermazioni
 IoT 竪 reale
 IoT 竪 diventato un asset
 IoT contempla due scenari
 Dispositivi aziendali (di cui abbiamo il controllo)
 Dispositivi dei clienti (di cui non abbiamo il controllo)
 IoT 竪 un nuovo 束problema損 da gestire
Things
Pattern per lIoT
Insights ActionsInsights Actions
Cloud
Gateway
Pattern per lIoT explained [1]
 Insights
 Esplicitare cosa 竪 successo
 Actions
 Prendere delle decisioni su quanto 竪 successo
 ...e questo 竪 quanto facciamo gi
Azure e il set di servizi per lIoT
Azure Time Series
Insights
Azure Machine
Learning
Azure Stream
Analytics
Cosmos DB Azure Data Lake
Azure Data Lake
Analytics
Azure HD Insight
Spark, Storm,
Kafka
Azure Event Hubs
Microsoft Flow
Azure Logic Apps
Notification Hubs
Azure Websites
Microsoft Power
BI
Azure Active
Directory
Azure IoT Hub
Azure IoT Hub
Device Provisioning
Service
Azure IoT Edge
Azure Monitor
PaaSServices&
DeviceSupport
Edge Support
Device Support
Azure IoT Device
SDK
Certified Devices
Azure Certified for
IoT
Security Program
for Azure IoT
IoT Services Data & Analytics Services Visualization & Integration Services
IoTSolutions
(PaaS)
IoTSolutions
(SaaS)
Microsoft IoT Central
IoT SaaS
Microsoft Connected Field Service
Field Service SaaS
Remote Monitoring Predictive Maintenance Connected factory
Windows 10 IoT
Core
Azure IoT Suite
Pattern per lIoT explained [2]: Things (束Edge損)
 Non 竪 un PC o mobile
 Non c竪 un utente/Non c竪 un browser/Non c竪 una app
 Fa il suo lavoro e notifica il suo lavoro (eventi e
telemetria)
 Tanto pi湛 intelligente, tanto pi湛 竪 autonomo (e molto
束trendy損 ora  Edge processing)
 Si aspetta dei comandi
 Ragiona a messaggi
  asset aziendale (BE AWARE!)
Pattern per lIoT explained [3]: Cloud Gateway
 E l 束API損 dei servizi esposti
 Non 竪 Json/WebApi
 Non usa i protocolli canonici (Http(s))
  il valore dellofferta Cloud
 Farlo custom 竪 impegnativo
Azure IoT Hub
Bi-directional communication Enterprise scale &
integration
End-to-End Security
Funziona a messaggi
  uno stream di messaggi
 Compatibile EventHub
  uno store temporaneo di messaggi
 48 ore
  un router di messaggi
 Propriet nella 束busta損
 Contenuto opaco
Costi e scalabilit
 Unitsunit di scaling
 Messaggi
 limite 256Kb
 fatturati in chunks di 4Kb
(0,5Kb per il Free tier)
 Messaggi Twin
 Limite 8Kb
 fatturati in chunks di 0,5Kb
Usare IoT (ed Azure) dalla command line
 (everything is) Rest API
 .NET (JS, Python) SDKs
 PowerShell
 IoTHub Explorer
 Azure CLI 2.0+extension
Sviluppare devices
 Opzioni
 Microprocessore (ARM  Raspberry like)
 Microcontrollore (ATMEL  Arduino like)
 Custom
 Legacy
 Soluzioni moderne
 SDK
 Linguaggi
 Debugging e simulazione
Sicurezza in una soluzione IoT Hub
Protocolli
 AMQP
 nativo
 MQTT
 con protocol handler
 Completo per tutte le funzioni
 Nuova versione del protocollo appena uscita (V5)
 Http(s) solo se strettamente necessario
 Firewall?
 Tutti su IP/TLS
 AMQP (5671/5672)
 MQTT (1883/8883)
Device Connect Endpoints
Service Connect Endpoints
Registry Read/Registry Endpoints
Cos竪 una Shared Access Policy?
  una autorizzazione ad accedere a qualche endpoint
 Usa una chiave simmetrica (revocabile) per autorizzare
 Buona pratica:
 1 policy, 1 servizio
 Non usare le policy di default
 Per i deviceGateway
Registro dei devices
  un database No SQL (束eventualmente consistente損)
 Mantiene lidentit dei dispositivi che possono
comunicare
Create
identity
Update
identity
Retrieve
identity
Delete
identity
List
identities
Export
identities
Import
identities
Asymmetric Key encryption
 Utilizzato per ricevere dati protetti dalle parti
 Coppia di chiavi. Le chiavi private, tenute al
sicuro dal generatore delle chiavi, decifrano
ci嘆 che 竪 cifrato dalla chiave pubblica
 Certificati autofirmati o certificati CA
(anteprima)
 Pro
 Single point of failure
 Long keys (2 ^ 10 bit +) difficili da decifrare
 Contro
 pu嘆 crittografare piccoli blocchi di dati
 Utilizzato per crittografare una chiave simmetrica
in ogni comunicazione
Encrypt( , , )=
Decrypt( , , )=
Symmetric Key encryption
 Utilizzato per scambiare dati protetti dalle parti
 Chiave singola condivisa dalle parti
 professionista
 Pu嘆 crittografare grandi blocchi di dati
 Contro
 Non sicuro se una delle parti perde la chiave, pi湛 punti di
errore
Encrypt( , , )=
Decrypt( , , )=
Sicurezza fisica: Tampering
Information
Disclosure
Denial of
Service
Spoofing
Sicurezza fisica: Anti Tampering
Demo
Gestire dispositivi con IoT Hub
IoT Hub Device Management
Device
Twin
Queries Methods
Jobs
Device Twin
 Twin 竪 la rappresentazione logica del dispositivo.
  un documento JSON che memorizza le informazioni sullo
stato del dispositivo.
 Le informazioni sono propriet che 竪 possibile distinguere in
tag, desired properties e reported properties
 Il documento viene archiviato in IoT hub, in un db No SQl
simile a Cosmos Db eventually consistent
 In generale, tutte le propriet sono solo propriet JSON,
quindi 竪 possibile scrivere qualsiasi cosa che rispetti le regole
JSON.
  versionato e pu嘆 essere patchato (piccole dimensioni di
json trasmesse)
Device Twin Limitations
 Le propriet possono avere una profondit massima di
5.
 La dimensione dei valori della propriet non pu嘆 essere
maggiore di 8Kb
 Tipi JSON supportati: boolean, number, string, object.
Gli array non sono ammessi
 Il documento viene aggiornato e sincronizzato con la
gestione ottimistica della gestione dei dispositivi.
 8 KB (dimensioni di fatturazione: 16 messaggi)
Desired properties
 Dobbiamo configurare il dispositivo da remoto. Non 竪
economicamente conveniente eseguire localmente.
 La desired property 竪 un tipo di propriet configurata
sul twin. L'hub IoT gestisce le modifiche che accodano
l'aggiornamento sull'endpoint del dispositivo.
 Quindi quando si ricollega, aggiorner il suo stato.
 La dimensione massima delle propriet desiderate 竪
8Kb.
Reported properties
 Il dispositivo ha uno stato locale.
 Questo stato cambia perch辿 il dispositivo esegue alcune
attivit e vuoi che venga aggiornato
 Il dispositivo pu嘆 inviare aggiornamenti su questi
quando cambiano.
 IoTHub riceve un messaggio dall'endpoint del
dispositivo sull'aggiornamento e questo viene
modificato sul gemello.
 La dimensione massima delle propriet riportate 竪 8 KB.
Tags
 Le propriet desiderate e le propriet segnalate sono
funzionali per il dispositivo.
 Alcune propriet sono utili solo per il servizio e non per
i dispositivi.
  un dizionario di dati chiave / valore.
Querying Device Twins
FROM WHERE SELECT
GROUP
BY
Sample queries
 Devices located in the US configured to send telemetry less
often that every minute
 Devices which have wifi o wired connectivity
 Devices where reported and desired properties do not match
 Devices group by status
Device Management Lifetime Operations
Reboot Factory Reset
Firmware
Update
Configuration
Reporting
progress and
status
Direct Methods
Immediate
confirmation
Two-way
data flow
MQTT
8Kb request -
8Kb response
MQTT
Creare un portale per lutente
 Tutto questo 竪 accessibile da portale Azure o command
line
 Difficile, pericoloso e poco produttivo per
lamministratore finale
 Creare un portale per lutente
Demo
Deployment di dispositivi con Azure IoT Hub
IoT Device Lifecycle
PLAN
PROVISI
ON
CONFIG
URE
MONIT
OR
RETIRE
Cos竪 il provisioning?
Registrazione
Prima
configurazione
Provisioning
IoT Hub Device Provisioning Service
 I dispositivi sono collegati automaticamente e in modo
sicuro al servizio Hub IoT e vengono forniti con la
configurazione iniziale
 Un titolare di provisioning di dispositivo singolo pu嘆
fornire il servizio per pi湛 hub IoT (in pi湛 regioni)
 I clienti forniscono regole e logica per assicurare che il
dispositivo giusto sia collegato alla giusta soluzione IoT
(e all'endpoint hub IoT associato)
 L'abilit di provisioning dei dispositivi 竪 estensibile con
il supporto di diversi tipi di modelli di attestazione
dell'identit
Setup
 I dispositivi dispongono gi dell'URI per il servizio di
provisioning dei dispositivi al primo avvio
 Il servizio di provisioning dei dispositivi conosce gi gli
IoT Hub a cui connettere i dispositivi
 Il servizio di provisioning dei dispositivi conosce gi il
tipo di attestato di identit che sta utilizzando,
comprese le informazioni di connessione per ciascuno
 Il tutto viene fatto con una lista di enrollment
Demo
Processare eventi con Azure Serverless
Platform as a Service
 IoT Hub 竪 PaaS
 Non esiste un equivalente IaaS o On Premise
 Il processing 竪 adeguato allofferta PaaS
Dove memorizzare gli eventi?
Azure SQL
Database
Azure
CosmosDb
Azure
Storage
Azure
EventHub
Azure
Service Bus
Azure
Queue
Alternative per levent processing
Stream Analytics
Event Processor
Functions
Comparazione delle diverse opportunit
Data
streaming
Event
correlation
High
scalability
Single event
Performance
not critical
Custom
coding
Flexible
coding
Special
hosting
requirements
Special
performance
requirements
Cos竪 Azure Serverless
https://www.geekwire.com/2017/serverless-nirvana-microsoft-azure-cto-mark-russinovich-future-cloud/
https://www.geekwire.com/2017/interview-microsofts-mark-russinovich-intersection-serverless-edge-computing/
Serverless manifesto
 Una funzione 竪 l'unit di deployment e scaling
 Scalabilit in base alle richieste. Gli utenti non possono
causare overprovisioning o underprovisioning
 Non pagare mai per inattivit
 Il codice di una funzione viene scatenato da un trigger,
cio竪 un evento che 竪 avvenuto e che deve essere
gestito
Demo
Conclusioni
(Embedded vs. Web) developers
Embedded (Web) Apps
Cloud
IoT
Microsoft Azure per l'IT Pro
Cosa lIT pu嘆 dare all 束embedded損 world
 Pieno contributo lato cloud
 Un buon contributo lato embedded (metodologia,
modernit, strumenti, patterns)
IoT Hub come servizio
 Pro
 Soluzione moderna e allineata allo stile Azure
 Piena integrazione Portal/CLI/Visual Studio
 Completa/in completamento
 Soluzioni
 Sviluppo molto veloce
 Edge
 Cons
 LTSLong Term Support
IoT Hub per lIT Pro
 Millions of Devices
 HTTPS/AMQPS/MQTTS
 Receive Commands
 Device Management
 Device Twins
 Queries & Jobs
 Scale up and down
 Declarative Message Routes
 Azure Monitor
 Configuration Management
 Per Device Certificates
 Per Device Enable/Disable
 TLS Security
 X.509 Support
 IP Whitelisting/Blacklisting
 Shared Access Polices
 Firmware/Software Updates
Microsoft Azure per l'IT Pro
Microsoft Azure per l'IT Pro

More Related Content

Similar to Microsoft Azure per l'IT Pro (20)

Power BI Streaming Data Flow e Azure IoT Central
Power BI Streaming Data Flow e Azure IoT CentralPower BI Streaming Data Flow e Azure IoT Central
Power BI Streaming Data Flow e Azure IoT Central
Marco Parenzan
IoT Saturday 2019 - Custom Vision on Edge device
IoT Saturday 2019 - Custom Vision on Edge deviceIoT Saturday 2019 - Custom Vision on Edge device
IoT Saturday 2019 - Custom Vision on Edge device
Alessio Biasiutti
Custom vision on edge device
Custom vision on edge deviceCustom vision on edge device
Custom vision on edge device
Alessio Biasiutti
Blockchain e IoT: il binomio della trasformazione digitale
Blockchain e IoT: il binomio della trasformazione digitaleBlockchain e IoT: il binomio della trasformazione digitale
Blockchain e IoT: il binomio della trasformazione digitale
MongoDB
Azure IoTHub - Roboval 2018
Azure IoTHub - Roboval 2018Azure IoTHub - Roboval 2018
Azure IoTHub - Roboval 2018
Andrea Tosato
Industrial iot: dalle parole ai fatti
Industrial iot: dalle parole ai fatti Industrial iot: dalle parole ai fatti
Industrial iot: dalle parole ai fatti
Riccardo Zamana
Azure day 2019 - Custom Vision on Edge device
Azure day 2019 - Custom Vision on Edge deviceAzure day 2019 - Custom Vision on Edge device
Azure day 2019 - Custom Vision on Edge device
Alessio Biasiutti
Realizzare Accessori iOS con Bluetooth Low Energy e Arduino
Realizzare Accessori iOS con Bluetooth Low Energy e ArduinoRealizzare Accessori iOS con Bluetooth Low Energy e Arduino
Realizzare Accessori iOS con Bluetooth Low Energy e Arduino
fibasile
CQRS ed Event Sourcing su Windows Azure: Applicazioni Distribuite, Scalabilit...
CQRS ed Event Sourcing su Windows Azure: Applicazioni Distribuite, Scalabilit...CQRS ed Event Sourcing su Windows Azure: Applicazioni Distribuite, Scalabilit...
CQRS ed Event Sourcing su Windows Azure: Applicazioni Distribuite, Scalabilit...
DotNetMarche
Gam05 costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...
Gam05   costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...Gam05   costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...
Gam05 costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...
DotNetCampus
Predictive Maintenance per le aziende del nord-est con Azure e IoT
Predictive Maintenance per le aziende del nord-est con Azure e IoTPredictive Maintenance per le aziende del nord-est con Azure e IoT
Predictive Maintenance per le aziende del nord-est con Azure e IoT
Marco Parenzan
Bluetooth low energy & Lumia Sensor Core per Windows Phone 8.1
Bluetooth low energy & Lumia Sensor Core per Windows Phone 8.1Bluetooth low energy & Lumia Sensor Core per Windows Phone 8.1
Bluetooth low energy & Lumia Sensor Core per Windows Phone 8.1
Massimo Bonanni
iOS_Course_1
iOS_Course_1iOS_Course_1
iOS_Course_1
Dario Pizzuto
Laravel & Passport
Laravel & PassportLaravel & Passport
Laravel & Passport
Gabriele Cavigiolo
Win05 accesso ai dati in win 8
Win05   accesso ai dati in win 8Win05   accesso ai dati in win 8
Win05 accesso ai dati in win 8
DotNetCampus
Key management
Key managementKey management
Key management
Luigi Perrone
Design Patterns - Enterprise Patterns (part 2)
Design Patterns - Enterprise Patterns (part 2)Design Patterns - Enterprise Patterns (part 2)
Design Patterns - Enterprise Patterns (part 2)
Fabio Armani
Azure dayroma java, il lato oscuro del cloud
Azure dayroma   java, il lato oscuro del cloudAzure dayroma   java, il lato oscuro del cloud
Azure dayroma java, il lato oscuro del cloud
Riccardo Zamana
Fmdp Total System Monitor
Fmdp Total System MonitorFmdp Total System Monitor
Fmdp Total System Monitor
Filippo Maria Del Prete
Power BI Streaming Data Flow e Azure IoT Central
Power BI Streaming Data Flow e Azure IoT CentralPower BI Streaming Data Flow e Azure IoT Central
Power BI Streaming Data Flow e Azure IoT Central
Marco Parenzan
IoT Saturday 2019 - Custom Vision on Edge device
IoT Saturday 2019 - Custom Vision on Edge deviceIoT Saturday 2019 - Custom Vision on Edge device
IoT Saturday 2019 - Custom Vision on Edge device
Alessio Biasiutti
Custom vision on edge device
Custom vision on edge deviceCustom vision on edge device
Custom vision on edge device
Alessio Biasiutti
Blockchain e IoT: il binomio della trasformazione digitale
Blockchain e IoT: il binomio della trasformazione digitaleBlockchain e IoT: il binomio della trasformazione digitale
Blockchain e IoT: il binomio della trasformazione digitale
MongoDB
Azure IoTHub - Roboval 2018
Azure IoTHub - Roboval 2018Azure IoTHub - Roboval 2018
Azure IoTHub - Roboval 2018
Andrea Tosato
Industrial iot: dalle parole ai fatti
Industrial iot: dalle parole ai fatti Industrial iot: dalle parole ai fatti
Industrial iot: dalle parole ai fatti
Riccardo Zamana
Azure day 2019 - Custom Vision on Edge device
Azure day 2019 - Custom Vision on Edge deviceAzure day 2019 - Custom Vision on Edge device
Azure day 2019 - Custom Vision on Edge device
Alessio Biasiutti
Realizzare Accessori iOS con Bluetooth Low Energy e Arduino
Realizzare Accessori iOS con Bluetooth Low Energy e ArduinoRealizzare Accessori iOS con Bluetooth Low Energy e Arduino
Realizzare Accessori iOS con Bluetooth Low Energy e Arduino
fibasile
CQRS ed Event Sourcing su Windows Azure: Applicazioni Distribuite, Scalabilit...
CQRS ed Event Sourcing su Windows Azure: Applicazioni Distribuite, Scalabilit...CQRS ed Event Sourcing su Windows Azure: Applicazioni Distribuite, Scalabilit...
CQRS ed Event Sourcing su Windows Azure: Applicazioni Distribuite, Scalabilit...
DotNetMarche
Gam05 costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...
Gam05   costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...Gam05   costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...
Gam05 costruisci il tuo antifurto perfetto con kinect e gli azure mobile se...
DotNetCampus
Predictive Maintenance per le aziende del nord-est con Azure e IoT
Predictive Maintenance per le aziende del nord-est con Azure e IoTPredictive Maintenance per le aziende del nord-est con Azure e IoT
Predictive Maintenance per le aziende del nord-est con Azure e IoT
Marco Parenzan
Bluetooth low energy & Lumia Sensor Core per Windows Phone 8.1
Bluetooth low energy & Lumia Sensor Core per Windows Phone 8.1Bluetooth low energy & Lumia Sensor Core per Windows Phone 8.1
Bluetooth low energy & Lumia Sensor Core per Windows Phone 8.1
Massimo Bonanni
Win05 accesso ai dati in win 8
Win05   accesso ai dati in win 8Win05   accesso ai dati in win 8
Win05 accesso ai dati in win 8
DotNetCampus
Design Patterns - Enterprise Patterns (part 2)
Design Patterns - Enterprise Patterns (part 2)Design Patterns - Enterprise Patterns (part 2)
Design Patterns - Enterprise Patterns (part 2)
Fabio Armani
Azure dayroma java, il lato oscuro del cloud
Azure dayroma   java, il lato oscuro del cloudAzure dayroma   java, il lato oscuro del cloud
Azure dayroma java, il lato oscuro del cloud
Riccardo Zamana

More from Marco Parenzan (20)

Azure IoT Central per lo SCADA engineer
Azure IoT Central per lo SCADA engineerAzure IoT Central per lo SCADA engineer
Azure IoT Central per lo SCADA engineer
Marco Parenzan
Azure Hybrid @ Home
Azure Hybrid @ HomeAzure Hybrid @ Home
Azure Hybrid @ Home
Marco Parenzan
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptxStatic abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Marco Parenzan
Azure Synapse Analytics for your IoT Solutions
Azure Synapse Analytics for your IoT SolutionsAzure Synapse Analytics for your IoT Solutions
Azure Synapse Analytics for your IoT Solutions
Marco Parenzan
Power BI Streaming Data Flow e Azure IoT Central
Power BI Streaming Data Flow e Azure IoT CentralPower BI Streaming Data Flow e Azure IoT Central
Power BI Streaming Data Flow e Azure IoT Central
Marco Parenzan
Developing Actors in Azure with .net
Developing Actors in Azure with .netDeveloping Actors in Azure with .net
Developing Actors in Azure with .net
Marco Parenzan
Math with .NET for you and Azure
Math with .NET for you and AzureMath with .NET for you and Azure
Math with .NET for you and Azure
Marco Parenzan
.net for fun: write a Christmas videogame
.net for fun: write a Christmas videogame.net for fun: write a Christmas videogame
.net for fun: write a Christmas videogame
Marco Parenzan
Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...
Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...
Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...
Marco Parenzan
Anomaly Detection with Azure and .NET
Anomaly Detection with Azure and .NETAnomaly Detection with Azure and .NET
Anomaly Detection with Azure and .NET
Marco Parenzan
Deploy Microsoft Azure Data Solutions
Deploy Microsoft Azure Data SolutionsDeploy Microsoft Azure Data Solutions
Deploy Microsoft Azure Data Solutions
Marco Parenzan
Deep Dive Time Series Anomaly Detection in Azure with dotnet
Deep Dive Time Series Anomaly Detection in Azure with dotnetDeep Dive Time Series Anomaly Detection in Azure with dotnet
Deep Dive Time Series Anomaly Detection in Azure with dotnet
Marco Parenzan
Azure IoT Central
Azure IoT CentralAzure IoT Central
Azure IoT Central
Marco Parenzan
Anomaly Detection with Azure and .net
Anomaly Detection with Azure and .netAnomaly Detection with Azure and .net
Anomaly Detection with Azure and .net
Marco Parenzan
Code Generation for Azure with .net
Code Generation for Azure with .netCode Generation for Azure with .net
Code Generation for Azure with .net
Marco Parenzan
Running Kafka and Spark on Raspberry PI with Azure and some .net magic
Running Kafka and Spark on Raspberry PI with Azure and some .net magicRunning Kafka and Spark on Raspberry PI with Azure and some .net magic
Running Kafka and Spark on Raspberry PI with Azure and some .net magic
Marco Parenzan
Time Series Anomaly Detection with Azure and .NETT
Time Series Anomaly Detection with Azure and .NETTTime Series Anomaly Detection with Azure and .NETT
Time Series Anomaly Detection with Azure and .NETT
Marco Parenzan
Code Generation for Azure with .net
Code Generation for Azure with .netCode Generation for Azure with .net
Code Generation for Azure with .net
Marco Parenzan
Deep dive time series anomaly detection with different Azure Data Services
Deep dive time series anomaly detection with different Azure Data ServicesDeep dive time series anomaly detection with different Azure Data Services
Deep dive time series anomaly detection with different Azure Data Services
Marco Parenzan
.net interactive for notebooks and for your data job
.net interactive for notebooks and for your data job.net interactive for notebooks and for your data job
.net interactive for notebooks and for your data job
Marco Parenzan
Azure IoT Central per lo SCADA engineer
Azure IoT Central per lo SCADA engineerAzure IoT Central per lo SCADA engineer
Azure IoT Central per lo SCADA engineer
Marco Parenzan
Azure Hybrid @ Home
Azure Hybrid @ HomeAzure Hybrid @ Home
Azure Hybrid @ Home
Marco Parenzan
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptxStatic abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Static abstract members nelle interfacce di C# 11 e dintorni di .NET 7.pptx
Marco Parenzan
Azure Synapse Analytics for your IoT Solutions
Azure Synapse Analytics for your IoT SolutionsAzure Synapse Analytics for your IoT Solutions
Azure Synapse Analytics for your IoT Solutions
Marco Parenzan
Power BI Streaming Data Flow e Azure IoT Central
Power BI Streaming Data Flow e Azure IoT CentralPower BI Streaming Data Flow e Azure IoT Central
Power BI Streaming Data Flow e Azure IoT Central
Marco Parenzan
Developing Actors in Azure with .net
Developing Actors in Azure with .netDeveloping Actors in Azure with .net
Developing Actors in Azure with .net
Marco Parenzan
Math with .NET for you and Azure
Math with .NET for you and AzureMath with .NET for you and Azure
Math with .NET for you and Azure
Marco Parenzan
.net for fun: write a Christmas videogame
.net for fun: write a Christmas videogame.net for fun: write a Christmas videogame
.net for fun: write a Christmas videogame
Marco Parenzan
Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...
Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...
Building IoT infrastructure on edge with .net, Raspberry PI and ESP32 to conn...
Marco Parenzan
Anomaly Detection with Azure and .NET
Anomaly Detection with Azure and .NETAnomaly Detection with Azure and .NET
Anomaly Detection with Azure and .NET
Marco Parenzan
Deploy Microsoft Azure Data Solutions
Deploy Microsoft Azure Data SolutionsDeploy Microsoft Azure Data Solutions
Deploy Microsoft Azure Data Solutions
Marco Parenzan
Deep Dive Time Series Anomaly Detection in Azure with dotnet
Deep Dive Time Series Anomaly Detection in Azure with dotnetDeep Dive Time Series Anomaly Detection in Azure with dotnet
Deep Dive Time Series Anomaly Detection in Azure with dotnet
Marco Parenzan
Anomaly Detection with Azure and .net
Anomaly Detection with Azure and .netAnomaly Detection with Azure and .net
Anomaly Detection with Azure and .net
Marco Parenzan
Code Generation for Azure with .net
Code Generation for Azure with .netCode Generation for Azure with .net
Code Generation for Azure with .net
Marco Parenzan
Running Kafka and Spark on Raspberry PI with Azure and some .net magic
Running Kafka and Spark on Raspberry PI with Azure and some .net magicRunning Kafka and Spark on Raspberry PI with Azure and some .net magic
Running Kafka and Spark on Raspberry PI with Azure and some .net magic
Marco Parenzan
Time Series Anomaly Detection with Azure and .NETT
Time Series Anomaly Detection with Azure and .NETTTime Series Anomaly Detection with Azure and .NETT
Time Series Anomaly Detection with Azure and .NETT
Marco Parenzan
Code Generation for Azure with .net
Code Generation for Azure with .netCode Generation for Azure with .net
Code Generation for Azure with .net
Marco Parenzan
Deep dive time series anomaly detection with different Azure Data Services
Deep dive time series anomaly detection with different Azure Data ServicesDeep dive time series anomaly detection with different Azure Data Services
Deep dive time series anomaly detection with different Azure Data Services
Marco Parenzan
.net interactive for notebooks and for your data job
.net interactive for notebooks and for your data job.net interactive for notebooks and for your data job
.net interactive for notebooks and for your data job
Marco Parenzan

Microsoft Azure per l'IT Pro

  • 1. Microsoft Azure IoT per l'IT Pro Marco Parenzan 1nn0va
  • 4. NET, IoT and Azure Developer, Trainer and Consultant Microsoft MVP 2017 for Azure Book Author @ Packt, LSWR Community Lead 1nn0va (facebook.com/1nn0va) marco [dot] parenzan [at] 1nn0va [dot] it
  • 5. Realizzare uninfrastruttura IoT Sicurezza in una soluzione IoT Gestire dispositivi con IoT Hub Deployment di dispositivi con Azure IoT Hub Processare eventi con Azure Serverless Conclusioni
  • 7. Affermazioni IoT 竪 reale IoT 竪 diventato un asset IoT contempla due scenari Dispositivi aziendali (di cui abbiamo il controllo) Dispositivi dei clienti (di cui non abbiamo il controllo) IoT 竪 un nuovo 束problema損 da gestire
  • 8. Things Pattern per lIoT Insights ActionsInsights Actions Cloud Gateway
  • 9. Pattern per lIoT explained [1] Insights Esplicitare cosa 竪 successo Actions Prendere delle decisioni su quanto 竪 successo ...e questo 竪 quanto facciamo gi
  • 10. Azure e il set di servizi per lIoT Azure Time Series Insights Azure Machine Learning Azure Stream Analytics Cosmos DB Azure Data Lake Azure Data Lake Analytics Azure HD Insight Spark, Storm, Kafka Azure Event Hubs Microsoft Flow Azure Logic Apps Notification Hubs Azure Websites Microsoft Power BI Azure Active Directory Azure IoT Hub Azure IoT Hub Device Provisioning Service Azure IoT Edge Azure Monitor PaaSServices& DeviceSupport Edge Support Device Support Azure IoT Device SDK Certified Devices Azure Certified for IoT Security Program for Azure IoT IoT Services Data & Analytics Services Visualization & Integration Services IoTSolutions (PaaS) IoTSolutions (SaaS) Microsoft IoT Central IoT SaaS Microsoft Connected Field Service Field Service SaaS Remote Monitoring Predictive Maintenance Connected factory Windows 10 IoT Core Azure IoT Suite
  • 11. Pattern per lIoT explained [2]: Things (束Edge損) Non 竪 un PC o mobile Non c竪 un utente/Non c竪 un browser/Non c竪 una app Fa il suo lavoro e notifica il suo lavoro (eventi e telemetria) Tanto pi湛 intelligente, tanto pi湛 竪 autonomo (e molto 束trendy損 ora Edge processing) Si aspetta dei comandi Ragiona a messaggi asset aziendale (BE AWARE!)
  • 12. Pattern per lIoT explained [3]: Cloud Gateway E l 束API損 dei servizi esposti Non 竪 Json/WebApi Non usa i protocolli canonici (Http(s)) il valore dellofferta Cloud Farlo custom 竪 impegnativo
  • 13. Azure IoT Hub Bi-directional communication Enterprise scale & integration End-to-End Security
  • 14. Funziona a messaggi uno stream di messaggi Compatibile EventHub uno store temporaneo di messaggi 48 ore un router di messaggi Propriet nella 束busta損 Contenuto opaco
  • 15. Costi e scalabilit Unitsunit di scaling Messaggi limite 256Kb fatturati in chunks di 4Kb (0,5Kb per il Free tier) Messaggi Twin Limite 8Kb fatturati in chunks di 0,5Kb
  • 16. Usare IoT (ed Azure) dalla command line (everything is) Rest API .NET (JS, Python) SDKs PowerShell IoTHub Explorer Azure CLI 2.0+extension
  • 17. Sviluppare devices Opzioni Microprocessore (ARM Raspberry like) Microcontrollore (ATMEL Arduino like) Custom Legacy Soluzioni moderne SDK Linguaggi Debugging e simulazione
  • 18. Sicurezza in una soluzione IoT Hub
  • 19. Protocolli AMQP nativo MQTT con protocol handler Completo per tutte le funzioni Nuova versione del protocollo appena uscita (V5) Http(s) solo se strettamente necessario Firewall? Tutti su IP/TLS AMQP (5671/5672) MQTT (1883/8883)
  • 23. Cos竪 una Shared Access Policy? una autorizzazione ad accedere a qualche endpoint Usa una chiave simmetrica (revocabile) per autorizzare Buona pratica: 1 policy, 1 servizio Non usare le policy di default Per i deviceGateway
  • 24. Registro dei devices un database No SQL (束eventualmente consistente損) Mantiene lidentit dei dispositivi che possono comunicare Create identity Update identity Retrieve identity Delete identity List identities Export identities Import identities
  • 25. Asymmetric Key encryption Utilizzato per ricevere dati protetti dalle parti Coppia di chiavi. Le chiavi private, tenute al sicuro dal generatore delle chiavi, decifrano ci嘆 che 竪 cifrato dalla chiave pubblica Certificati autofirmati o certificati CA (anteprima) Pro Single point of failure Long keys (2 ^ 10 bit +) difficili da decifrare Contro pu嘆 crittografare piccoli blocchi di dati Utilizzato per crittografare una chiave simmetrica in ogni comunicazione Encrypt( , , )= Decrypt( , , )=
  • 26. Symmetric Key encryption Utilizzato per scambiare dati protetti dalle parti Chiave singola condivisa dalle parti professionista Pu嘆 crittografare grandi blocchi di dati Contro Non sicuro se una delle parti perde la chiave, pi湛 punti di errore Encrypt( , , )= Decrypt( , , )=
  • 29. Demo
  • 31. IoT Hub Device Management Device Twin Queries Methods Jobs
  • 32. Device Twin Twin 竪 la rappresentazione logica del dispositivo. un documento JSON che memorizza le informazioni sullo stato del dispositivo. Le informazioni sono propriet che 竪 possibile distinguere in tag, desired properties e reported properties Il documento viene archiviato in IoT hub, in un db No SQl simile a Cosmos Db eventually consistent In generale, tutte le propriet sono solo propriet JSON, quindi 竪 possibile scrivere qualsiasi cosa che rispetti le regole JSON. versionato e pu嘆 essere patchato (piccole dimensioni di json trasmesse)
  • 33. Device Twin Limitations Le propriet possono avere una profondit massima di 5. La dimensione dei valori della propriet non pu嘆 essere maggiore di 8Kb Tipi JSON supportati: boolean, number, string, object. Gli array non sono ammessi Il documento viene aggiornato e sincronizzato con la gestione ottimistica della gestione dei dispositivi. 8 KB (dimensioni di fatturazione: 16 messaggi)
  • 34. Desired properties Dobbiamo configurare il dispositivo da remoto. Non 竪 economicamente conveniente eseguire localmente. La desired property 竪 un tipo di propriet configurata sul twin. L'hub IoT gestisce le modifiche che accodano l'aggiornamento sull'endpoint del dispositivo. Quindi quando si ricollega, aggiorner il suo stato. La dimensione massima delle propriet desiderate 竪 8Kb.
  • 35. Reported properties Il dispositivo ha uno stato locale. Questo stato cambia perch辿 il dispositivo esegue alcune attivit e vuoi che venga aggiornato Il dispositivo pu嘆 inviare aggiornamenti su questi quando cambiano. IoTHub riceve un messaggio dall'endpoint del dispositivo sull'aggiornamento e questo viene modificato sul gemello. La dimensione massima delle propriet riportate 竪 8 KB.
  • 36. Tags Le propriet desiderate e le propriet segnalate sono funzionali per il dispositivo. Alcune propriet sono utili solo per il servizio e non per i dispositivi. un dizionario di dati chiave / valore.
  • 37. Querying Device Twins FROM WHERE SELECT GROUP BY
  • 38. Sample queries Devices located in the US configured to send telemetry less often that every minute Devices which have wifi o wired connectivity Devices where reported and desired properties do not match Devices group by status
  • 39. Device Management Lifetime Operations Reboot Factory Reset Firmware Update Configuration Reporting progress and status
  • 41. Creare un portale per lutente Tutto questo 竪 accessibile da portale Azure o command line Difficile, pericoloso e poco produttivo per lamministratore finale Creare un portale per lutente
  • 42. Demo
  • 43. Deployment di dispositivi con Azure IoT Hub
  • 46. IoT Hub Device Provisioning Service I dispositivi sono collegati automaticamente e in modo sicuro al servizio Hub IoT e vengono forniti con la configurazione iniziale Un titolare di provisioning di dispositivo singolo pu嘆 fornire il servizio per pi湛 hub IoT (in pi湛 regioni) I clienti forniscono regole e logica per assicurare che il dispositivo giusto sia collegato alla giusta soluzione IoT (e all'endpoint hub IoT associato) L'abilit di provisioning dei dispositivi 竪 estensibile con il supporto di diversi tipi di modelli di attestazione dell'identit
  • 47. Setup I dispositivi dispongono gi dell'URI per il servizio di provisioning dei dispositivi al primo avvio Il servizio di provisioning dei dispositivi conosce gi gli IoT Hub a cui connettere i dispositivi Il servizio di provisioning dei dispositivi conosce gi il tipo di attestato di identit che sta utilizzando, comprese le informazioni di connessione per ciascuno Il tutto viene fatto con una lista di enrollment
  • 48. Demo
  • 49. Processare eventi con Azure Serverless
  • 50. Platform as a Service IoT Hub 竪 PaaS Non esiste un equivalente IaaS o On Premise Il processing 竪 adeguato allofferta PaaS
  • 51. Dove memorizzare gli eventi? Azure SQL Database Azure CosmosDb Azure Storage Azure EventHub Azure Service Bus Azure Queue
  • 52. Alternative per levent processing Stream Analytics Event Processor Functions
  • 53. Comparazione delle diverse opportunit Data streaming Event correlation High scalability Single event Performance not critical Custom coding Flexible coding Special hosting requirements Special performance requirements
  • 55. Serverless manifesto Una funzione 竪 l'unit di deployment e scaling Scalabilit in base alle richieste. Gli utenti non possono causare overprovisioning o underprovisioning Non pagare mai per inattivit Il codice di una funzione viene scatenato da un trigger, cio竪 un evento che 竪 avvenuto e che deve essere gestito
  • 56. Demo
  • 58. (Embedded vs. Web) developers Embedded (Web) Apps Cloud IoT
  • 60. Cosa lIT pu嘆 dare all 束embedded損 world Pieno contributo lato cloud Un buon contributo lato embedded (metodologia, modernit, strumenti, patterns)
  • 61. IoT Hub come servizio Pro Soluzione moderna e allineata allo stile Azure Piena integrazione Portal/CLI/Visual Studio Completa/in completamento Soluzioni Sviluppo molto veloce Edge Cons LTSLong Term Support
  • 62. IoT Hub per lIT Pro Millions of Devices HTTPS/AMQPS/MQTTS Receive Commands Device Management Device Twins Queries & Jobs Scale up and down Declarative Message Routes Azure Monitor Configuration Management Per Device Certificates Per Device Enable/Disable TLS Security X.509 Support IP Whitelisting/Blacklisting Shared Access Polices Firmware/Software Updates

Editor's Notes

  • #7: Device has also a 束non functional損 lifetime 束Nonfunctional損 means that a device needs to run some tasks to manage its lifetime, not really the core device functions. For example, it needs to be configured because it is probably headless, so we have to configure it remotely after initial configuration and deployment. We need also to query devices to perform some analysis, either on some classification information or its state. And we need to perform some actions on devices because conditions change through their lifetime, so we need to run some tasks
  • #14: 2/11/2018 6:58 PM
  • #16: IoT Hub can scale to million of devices with IoT Hub. But when you scale, you don't think about resource allocation, CPU or memory. You just think about messages. How many messages and devices you need. That's why with IoT Hub you talk about a "unit," that is the scaling element. Each unit has a different capacity in different tier. Each differs in the number of messages a unit can handle per day. But you have to be careful. During the course, you will often meet the notions of message and size. Well, that size is a variable size that depends on by the functionality, for example, 8Kb or 256Kb) The "unit" message size is different. A "unit" message size is a billable message and is a fixed size 4Kb chunk of data in standard tier, 0.5Kb in the free tier or if the message is about device configuration with twins. For instance, if a device sends 16 kilobytes message, in S1, S2, and S3 tiers, it will be billed as four messages. So when you need to configure service to run or scaling, you have to measure you messaging performances. You need to count your devices, your messages, calculate the average size and estimage the number of billable messages. Then you count the number of units you need, and you can change that number during configuration. Or you can deploy other instances of IoT Hub, which is a good practice regarding scalability but also resilience in case of failure. For this last uses, IoT Hub supports you importing and exporting device registry if you need to backup and restore for recovery.
  • #19: Device has also a 束non functional損 lifetime 束Nonfunctional損 means that a device needs to run some tasks to manage its lifetime, not really the core device functions. For example, it needs to be configured because it is probably headless, so we have to configure it remotely after initial configuration and deployment. We need also to query devices to perform some analysis, either on some classification information or its state. And we need to perform some actions on devices because conditions change through their lifetime, so we need to run some tasks
  • #25: IoTHub contains an identity registry to stores all the information about devices. On this registry, you can perform some operations. Create device identity Update device identity Retrieve device identity Delete device identity List all the stored identities Export all identities to Azure blob storage Import identities from Azure blob storage All the operations are available by a REST API so you can build your device registration tool inside your required device management workflow. You can also use one of the SDKs available for the major programming languages and platforms.
  • #28: Tampering is the modification of a device to induce failure or altering its behavior. Information disclosure threats involve the exposure of information to individuals who are not supposed to have access to itfor example, the ability of users to read a file that they were not granted access to, or the ability of an intruder to read data in transit between two computers. Denial of service (DoS) attacks deny service to valid usersfor example, by making a Web server temporarily unavailable or unusable. You must protect against certain types of DoS threats simply to improve system availability and reliability. In this type of threat, an unprivileged user gains privileged access and thereby has sufficient access to compromise or destroy the entire system. Elevation of privilege threats include those situations in which an attacker has effectively penetrated all system defenses and become part of the trusted system itself, a dangerous situation indeed. An example of identity spoofing is illegally accessing and then using another user's authentication information, such as username and password Data tampering involves the malicious modification of data. Examples include unauthorized changes made to persistent data, such as that held in a database, and the alteration of data as it flows between two computers over an open network, such as the Internet. Repudiation threats are associated with users who deny performing an action without other parties having any way to prove otherwisefor example, a user performs an illegal operation in a system that lacks the ability to trace the prohibited operations. Nonrepudiation refers to the ability of a system to counter repudiation threats. For example, a user who purchases an item might have to sign for the item upon receipt. The vendor can then use the signed receipt as evidence that the user did receive the package.
  • #32: So when you have an identity, you can interact with the device and perform some non functional tasks, for maintenance. There are some operations that you can perform with devices. Device Twin Synchronize the device condition and configuration between cloud and device Queries Dynamic reporting across device twin and jobs to attest device status and health Methods Perform interactive actions on devices Then there are Jobs, but we dont cover that in this lecture.
  • #38: All the device twins are persisted in the registry, in a sort of NoSQL database. All data in the twins can be queried with an SQL-like language to perform any listing or summary query for statistics or deep dive evaluations. It contains extensions for the IoTHub requirements. FROM clause allow selecting documents allowed, at the moment the only allowed keywords are devices or jobs. WHERE clause allows expressing filter predicated on the twin document structure. Root properties are tags, properties.Reported, properties.desired and you can. You can fully write predicates to include or exclude devices for the result of the query. You can also use functions to manipulate data such as math functions, type testing functions, string manipulation functions. SELECT allow to project twin property values or tags, so to represent the correct data set minimizing data or to evaluate some summarizing values with aggregate functions GROUP BY allow aggregating values by some values
  • #41: Direct methods represent a request-reply interaction with a device similar to an HTTP call in that they succeed or fail immediately (after a timeout). You use Direct methods for operations that require immediate confirmation A device receives direct methods through a device-specific MQTT topic. In fact, it is only supported MQTT. If you need to use AMQP, you cannot use Direct methods. Its a two-way data flow. There is a limitation with data exchanged as you can exchange 8Kb in the request and 8Kb in the response. When the device is disconnected, IoTHub cannot reach it. The backend receives a notification when the device is disconnected. You can set the timeout you require to understand that the device is offline, in a range from 30sec to 3600sec.