SlideShare a Scribd company logo
Working with data
using Azure
Functions
Liam Moat
Steph Locke
What we’re here to talk
about
• What are Azure Functions?
• How to position serverless for your workloads
• Using Azure Functions for data processing
Steph & Liam
Steph Locke
Tw: @theStephLocke
Li: stephanielocke
GH: stephlocke
Liam Moat
Li: liammoatcom
GH: liammoat
Azure Functions
Level
of
abstraction
Focus on business logic
Physical server
Virtual machine
PaaS
Containerization
Serverless
No infrastructure
management
Developers can just focus on
their code—without needing
to worry about provisioning
and managing infrastructure
Instant, event-
driven scalability
Application components
react to events and triggers
in near real-time with
virtually unlimited scalability
Pay-per-use
Only pay for what you use:
billing is typically calculated
on the number of function
calls, code execution time, and
memory used*
*Supporting services, like storage and networking, may be charged separately.
Functions-as-a-Service programming model use functions to achieve true serverless compute
Single
responsibility
Functions are single-
purposed, reusable pieces of
code that process an input
and return a result
Short-lived
Functions don’t stick around
when finished executing,
freeing up resources
for further executions
Stateless
Functions don’t hold any
persistent state and
don’t rely on the state of any
other processes
Event-driven
and scalable
Functions respond to
predefined events, and are
instantly replicated
as many times as needed
An event-based, serverless compute experience that accelerates app development
Integrated
programming
model
Use built-in triggers and
bindings to define when a
function is invoked and to what
data it connects
End-to-end
development
experience
Take advantage of a complete,
end-to-end development
experience with Functions—from
building and debugging
locally on major platforms like
Windows, macOS, and Linux
to deploying and monitoring in
the cloud
Hosting
options
flexibility
Choose the deployment model
that better fits your business
needs without compromising
development experience
Fully
managed and
cost-effective
Automated and flexible scaling
based on your workload
volume, keeping the focus on
adding value instead of
managing infrastructure
Integrated programming model
Azure Functions features input/output bindings
which provide a means of pulling data or
pushing data to other services. These bindings
work for both Microsoft and third-party services
without the need to hard-code integrations.
Trigger
Input binding
Output binding
Trigger object
Your code
Input object
Output object
The “Old” Way - Pseudocode
func Run()
{
var connectionString = CloudConfigurationManager.GetSetting("storage:connection")
var storageAccount = CloudStorageAccount.Parse(connectionString)
var eventHubClient = EventHubClient.CreateFromConnectionString(eventHubConnection)
func Poll()
{
var queueClient = storageAccount.CreateCloudQueueClient()
var queue = queueClient.GetQueueReference("myqueue-items")
queue.CreateIfNotExists()
var msg = queue.PeekMessage().AsString
var tableClient = storageAccount.CreateCloudTableClient()
var table = tableClient.GetTableReference("people")
table.CreateIfNotExists()
var customer = table.Execute(TableOperation.Retrieve<Customer>(“Customer”, msg))
// do something with customer - business logic goes here.
eventHubClient.Send(new EventData(...))
queue.DeleteMessage(msg);
Sleep(10 seconds)
Poll()
}
Poll()
}
Triggers - Pseudocode
func Run([QueueTrigger("myqueue-items")] string msg)
{
var connectionString = CloudConfigurationManager.GetSetting("storage:connection")
var storageAccount = CloudStorageAccount.Parse(connectionString)
var eventHubClient = EventHubClient.CreateFromConnectionString(eventHubConnection)
var tableClient = storageAccount.CreateCloudTableClient()
var table = tableClient.GetTableReference("people")
table.CreateIfNotExists()
var customer = table.Execute(TableOperation.Retrieve<Customer>("Customer", msg))
// do something with customer - business logic goes here.
eventHubClient.Send(new EventData(...))
}
Inputs - Pseudocode
func Run([QueueTrigger("myqueue-items")] string myQueueItem
[Table("people", "my-partition", "{queueTrigger}")] Customer customer)
{
var eventHubClient = EventHubClient.CreateFromConnectionString(eventHubConnection)
// do something with customer - business logic goes here.
eventHubClient.Send(new EventData(...))
}
Outputs - Pseudocode
[return: EventHub("event-hub", Connection = "EventHubConnection")]
Func EventData Run([QueueTrigger("myqueue-items")] string myQueueItem
[Table("MyTable", "MyPartition", "{queueTrigger}")] Customer customer)
{
// do something with customer - business logic goes here.
return new EventData(...)
}
Streamlining
connections and
improving security
Use Managed Identities for downstream
connections and for clients that invoke
Functions
Leverage Azure Key Vault for services
without support for MI
Managed Identities and Key Vault secrets
allows others to manage access and
minimises risk of leaked credentials
Use Azure Functions v4 for MI support
Managed Identities + Infrastructure as Code FTW
Step 1:
Assign the Managed Identity
access to resources
Step 2:
Add simplified values to app
settings
Step 3:
Use simple connection
references in Functions
DEMO: Creating an Azure Function project
IaC (bicep), VS Code (Azure Functions and bicep extensions), Azure
Function Core Tools, Github Copilot
Working with data
Automation of scheduled tasks
S C E N A R I O E X A M P L E
Financial services
A customer database is analyzed
for duplicate entries every
15 minutes, to avoid multiple
communications being sent out
to same customers
A function cleans a database
every 15 minutes…
…deduplicating entries
based on business logic
Handling data with a schedule
Timer.cs
[FunctionName("TimerTriggerCSharp")]
public static void Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, ILogger log)
{
// Business logic goes here…
}
Use NCRONTAB specifications for schedules
Schedules can be managed in appsettings to put all schedules in a single location
Use inputs and outputs to handle whatever you need to do
Real-time stream processing
S C E N A R I O E X A M P L E
ISV
Huge amounts of telemetry
data is collected from a massive
cloud app. That data is
processed in near real-time and
stored in a DB for use
in an analytics dashboard
App or device
producing data
Event Hubs ingests
telemetry data A function processes
the data…
…and sends it to
Cosmos DB
Data used for
dashboard
visualizations
Handling events
Queue.cs
public static class QueueFunctions
{
[FunctionName("QueueTrigger")]
public static void QueueTrigger(
[QueueTrigger("items")] string myQueueItem,
ILogger log)
{
// Business logic goes here…
}
}
Use a trigger that listens to an event publisher
Process messages with a schema to improve quality
Choose to process single messages or micro-batches
Handling data on change
S C E N A R I O E X A M P L E
Financial Services
Colleagues use mobile banking
to reimburse each other for
lunch: the person who paid for
lunch requests payment through
his mobile app, triggering a
notification on his colleagues’
phones.
Handling data when there’s changes
CosmosDB.cs
[FunctionName("CosmosTrigger")]
public static void Run([CosmosDBTrigger(
databaseName: "CorpDB",
containerName: "CorpDB",
Connection = "CorpDB",
LeaseContainerName = "leases")]IReadOnlyList<Person> documents,
ILogger log)
{
// Business logic goes here…
}
Use a trigger for a source that has CDC – primarily Cosmos DB and Azure SQL
Process messages with a schema to improve quality
Use inputs to get additional record sets to support processing
Handling data on request
S C E N A R I O E X A M P L E
Professional Services
A SaaS solution provides
extensibility through webhooks,
which can be implemented
through Functions, to automate
certain workflows.
Handling data when requested
HTTP.cs
[FunctionName("HttpTriggerCSharp")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)]
HttpRequest req, ILogger log)
{
// Business logic goes here…
}
Use HTTP triggers to create APIs or webhook driven activities
Use OpenAPI decorators to add documentation to your functions
Use Managed Identity on resources that connect or do pass through auth where
possible
?
Workflows and orchestration
with Durable Functions
P A T T E R N S / U S E C A S E S
Durable Functions is an
extension of Azure Functions
that lets you write stateful
functions in a serverless
compute environment
Manageable sequencing +
error handling/compensation
Fanning out and fanning in External events correlation
Flexible automated long-running
process monitoring
Start
Get status
Http-based async long-
running APIs Human interaction
Handling data with multiple steps
Durable.cs
[FunctionName("Chaining")]
public static async Task<object> Run(
[OrchestrationTrigger] IDurableOrchestrationContext context)
{
var x = await context.CallActivityAsync<object>("F1", null);
await context.CallActivityAsync<object>("F2", x);
}
Orchestrate complex or stateful data flows using Durable Functions
Use for different cases like aggregating, fanning out, human in the loop, or
chaining functions
DEMO: Creating different Azure Functions
VS Code (Azure Functions & Azurite extensions), Azure Functions Core
Tools, Github Copilot, Event Hub, Azure SQL, CosmosDB
Closing
What we talked about
• What are Azure Functions?
• How to position serverless for your workloads
• Using Azure Functions for data processing
Try it yourself
Learn with our Cloud Skills
Challenge
aka.ms/sqlbits-dwf
Check out our repo to see
things in detail
aka.ms/sqlbits-dwf-demo
Give it ago with free Azure
resources
Free Services

More Related Content

Similar to Working with data using Azure Functions.pdf

Apache Samza 1.0 - What's New, What's Next
Apache Samza 1.0 - What's New, What's NextApache Samza 1.0 - What's New, What's Next
Apache Samza 1.0 - What's New, What's Next
Prateek Maheshwari
 
Serverless in-action
Serverless in-actionServerless in-action
Serverless in-action
Assaf Gannon
 
Develop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverlessDevelop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverless
Lalit Kale
 
Fabric - Realtime stream processing framework
Fabric - Realtime stream processing frameworkFabric - Realtime stream processing framework
Fabric - Realtime stream processing framework
Shashank Gautam
 
Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30) Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30)
Paco de la Cruz
 
Azure Durable Functions (2018-06-13)
Azure Durable Functions (2018-06-13)Azure Durable Functions (2018-06-13)
Azure Durable Functions (2018-06-13)
Paco de la Cruz
 
Logisland "Event Mining at scale"
Logisland "Event Mining at scale"Logisland "Event Mining at scale"
Logisland "Event Mining at scale"
Thomas Bailet
 
Observability foundations in dynamically evolving architectures
Observability foundations in dynamically evolving architecturesObservability foundations in dynamically evolving architectures
Observability foundations in dynamically evolving architectures
Boyan Dimitrov
 
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
Amazon Web Services Korea
 
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
MSDEVMTL
 
FMK2019 being an optimist in a pessimistic world by vincenzo menanno
FMK2019 being an optimist in a pessimistic world by vincenzo menannoFMK2019 being an optimist in a pessimistic world by vincenzo menanno
FMK2019 being an optimist in a pessimistic world by vincenzo menanno
Verein FM Konferenz
 
CQRS and Event Sourcing
CQRS and Event SourcingCQRS and Event Sourcing
CQRS and Event Sourcing
Sergey Seletsky
 
The Art of The Event Streaming Application: Streams, Stream Processors and Sc...
The Art of The Event Streaming Application: Streams, Stream Processors and Sc...The Art of The Event Streaming Application: Streams, Stream Processors and Sc...
The Art of The Event Streaming Application: Streams, Stream Processors and Sc...
confluent
 
Kakfa summit london 2019 - the art of the event-streaming app
Kakfa summit london 2019 - the art of the event-streaming appKakfa summit london 2019 - the art of the event-streaming app
Kakfa summit london 2019 - the art of the event-streaming app
Neil Avery
 
CiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklum Ukraine
 
Track 4 Session 2_MAD03 容器技術和 AWS Lambda 讓您專注「應用優先」.pptx
Track 4 Session 2_MAD03 容器技術和 AWS Lambda 讓您專注「應用優先」.pptxTrack 4 Session 2_MAD03 容器技術和 AWS Lambda 讓您專注「應用優先」.pptx
Track 4 Session 2_MAD03 容器技術和 AWS Lambda 讓您專注「應用優先」.pptxAmazon Web Services
 
Couchbase@live person meetup july 22nd
Couchbase@live person meetup   july 22ndCouchbase@live person meetup   july 22nd
Couchbase@live person meetup july 22nd
Ido Shilon
 
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
NCCOMMS
 
Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)
Paco de la Cruz
 

Similar to Working with data using Azure Functions.pdf (20)

Apache Samza 1.0 - What's New, What's Next
Apache Samza 1.0 - What's New, What's NextApache Samza 1.0 - What's New, What's Next
Apache Samza 1.0 - What's New, What's Next
 
Serverless in-action
Serverless in-actionServerless in-action
Serverless in-action
 
Develop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverlessDevelop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverless
 
Fabric - Realtime stream processing framework
Fabric - Realtime stream processing frameworkFabric - Realtime stream processing framework
Fabric - Realtime stream processing framework
 
Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30) Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30)
 
Azure Durable Functions (2018-06-13)
Azure Durable Functions (2018-06-13)Azure Durable Functions (2018-06-13)
Azure Durable Functions (2018-06-13)
 
Logisland "Event Mining at scale"
Logisland "Event Mining at scale"Logisland "Event Mining at scale"
Logisland "Event Mining at scale"
 
Tdd,Ioc
Tdd,IocTdd,Ioc
Tdd,Ioc
 
Observability foundations in dynamically evolving architectures
Observability foundations in dynamically evolving architecturesObservability foundations in dynamically evolving architectures
Observability foundations in dynamically evolving architectures
 
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
AWS Step Functions을 활용한 서버리스 앱 오케스트레이션
 
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
 
FMK2019 being an optimist in a pessimistic world by vincenzo menanno
FMK2019 being an optimist in a pessimistic world by vincenzo menannoFMK2019 being an optimist in a pessimistic world by vincenzo menanno
FMK2019 being an optimist in a pessimistic world by vincenzo menanno
 
CQRS and Event Sourcing
CQRS and Event SourcingCQRS and Event Sourcing
CQRS and Event Sourcing
 
The Art of The Event Streaming Application: Streams, Stream Processors and Sc...
The Art of The Event Streaming Application: Streams, Stream Processors and Sc...The Art of The Event Streaming Application: Streams, Stream Processors and Sc...
The Art of The Event Streaming Application: Streams, Stream Processors and Sc...
 
Kakfa summit london 2019 - the art of the event-streaming app
Kakfa summit london 2019 - the art of the event-streaming appKakfa summit london 2019 - the art of the event-streaming app
Kakfa summit london 2019 - the art of the event-streaming app
 
CiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForceCiklumJavaSat_15112011:Alex Kruk VMForce
CiklumJavaSat_15112011:Alex Kruk VMForce
 
Track 4 Session 2_MAD03 容器技術和 AWS Lambda 讓您專注「應用優先」.pptx
Track 4 Session 2_MAD03 容器技術和 AWS Lambda 讓您專注「應用優先」.pptxTrack 4 Session 2_MAD03 容器技術和 AWS Lambda 讓您專注「應用優先」.pptx
Track 4 Session 2_MAD03 容器技術和 AWS Lambda 讓您專注「應用優先」.pptx
 
Couchbase@live person meetup july 22nd
Couchbase@live person meetup   july 22ndCouchbase@live person meetup   july 22nd
Couchbase@live person meetup july 22nd
 
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
 
Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)
 

More from Stephanie Locke

Let's banish "it works on my machine"
Let's banish "it works on my machine"Let's banish "it works on my machine"
Let's banish "it works on my machine"
Stephanie Locke
 
How to build brilliant managers.pdf
How to build brilliant managers.pdfHow to build brilliant managers.pdf
How to build brilliant managers.pdf
Stephanie Locke
 
Developer Velocity
Developer VelocityDeveloper Velocity
Developer Velocity
Stephanie Locke
 
The Microsoft Well Architected Framework For Data Analytics
The Microsoft Well Architected Framework For Data AnalyticsThe Microsoft Well Architected Framework For Data Analytics
The Microsoft Well Architected Framework For Data Analytics
Stephanie Locke
 
Sustainable manufacturing with AI
Sustainable manufacturing with AISustainable manufacturing with AI
Sustainable manufacturing with AI
Stephanie Locke
 
Wrangling data like a boss
Wrangling data like a bossWrangling data like a boss
Wrangling data like a boss
Stephanie Locke
 
Digitalisation from the back office to the factory floor
Digitalisation from the back office to the factory floorDigitalisation from the back office to the factory floor
Digitalisation from the back office to the factory floor
Stephanie Locke
 
The fundamentals of regression
The fundamentals of regressionThe fundamentals of regression
The fundamentals of regression
Stephanie Locke
 
Practical AI & data science ethics
Practical AI & data science ethicsPractical AI & data science ethics
Practical AI & data science ethics
Stephanie Locke
 
Help There’s Too Many [Something]Ops!
Help There’s Too Many [Something]Ops!Help There’s Too Many [Something]Ops!
Help There’s Too Many [Something]Ops!
Stephanie Locke
 
Reproducible machine learning
Reproducible machine learningReproducible machine learning
Reproducible machine learning
Stephanie Locke
 
AI monitoring in the workplace
AI monitoring in the workplaceAI monitoring in the workplace
AI monitoring in the workplace
Stephanie Locke
 
Working with relational data in Microsoft Azure
Working with relational data in Microsoft AzureWorking with relational data in Microsoft Azure
Working with relational data in Microsoft Azure
Stephanie Locke
 
Win more, win faster with sales automation
Win more, win faster with sales automationWin more, win faster with sales automation
Win more, win faster with sales automation
Stephanie Locke
 
Build or buy AI?
Build or buy AI?Build or buy AI?
Build or buy AI?
Stephanie Locke
 
AI in manufacturing - a technical perspective
AI in manufacturing - a technical perspectiveAI in manufacturing - a technical perspective
AI in manufacturing - a technical perspective
Stephanie Locke
 
The historian and AI
The historian and AIThe historian and AI
The historian and AI
Stephanie Locke
 
AI for marketers
AI for marketersAI for marketers
AI for marketers
Stephanie Locke
 
AI in manufacturing
AI in manufacturingAI in manufacturing
AI in manufacturing
Stephanie Locke
 

More from Stephanie Locke (19)

Let's banish "it works on my machine"
Let's banish "it works on my machine"Let's banish "it works on my machine"
Let's banish "it works on my machine"
 
How to build brilliant managers.pdf
How to build brilliant managers.pdfHow to build brilliant managers.pdf
How to build brilliant managers.pdf
 
Developer Velocity
Developer VelocityDeveloper Velocity
Developer Velocity
 
The Microsoft Well Architected Framework For Data Analytics
The Microsoft Well Architected Framework For Data AnalyticsThe Microsoft Well Architected Framework For Data Analytics
The Microsoft Well Architected Framework For Data Analytics
 
Sustainable manufacturing with AI
Sustainable manufacturing with AISustainable manufacturing with AI
Sustainable manufacturing with AI
 
Wrangling data like a boss
Wrangling data like a bossWrangling data like a boss
Wrangling data like a boss
 
Digitalisation from the back office to the factory floor
Digitalisation from the back office to the factory floorDigitalisation from the back office to the factory floor
Digitalisation from the back office to the factory floor
 
The fundamentals of regression
The fundamentals of regressionThe fundamentals of regression
The fundamentals of regression
 
Practical AI & data science ethics
Practical AI & data science ethicsPractical AI & data science ethics
Practical AI & data science ethics
 
Help There’s Too Many [Something]Ops!
Help There’s Too Many [Something]Ops!Help There’s Too Many [Something]Ops!
Help There’s Too Many [Something]Ops!
 
Reproducible machine learning
Reproducible machine learningReproducible machine learning
Reproducible machine learning
 
AI monitoring in the workplace
AI monitoring in the workplaceAI monitoring in the workplace
AI monitoring in the workplace
 
Working with relational data in Microsoft Azure
Working with relational data in Microsoft AzureWorking with relational data in Microsoft Azure
Working with relational data in Microsoft Azure
 
Win more, win faster with sales automation
Win more, win faster with sales automationWin more, win faster with sales automation
Win more, win faster with sales automation
 
Build or buy AI?
Build or buy AI?Build or buy AI?
Build or buy AI?
 
AI in manufacturing - a technical perspective
AI in manufacturing - a technical perspectiveAI in manufacturing - a technical perspective
AI in manufacturing - a technical perspective
 
The historian and AI
The historian and AIThe historian and AI
The historian and AI
 
AI for marketers
AI for marketersAI for marketers
AI for marketers
 
AI in manufacturing
AI in manufacturingAI in manufacturing
AI in manufacturing
 

Recently uploaded

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 

Recently uploaded (20)

Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 

Working with data using Azure Functions.pdf

  • 1. Working with data using Azure Functions Liam Moat Steph Locke
  • 2. What we’re here to talk about • What are Azure Functions? • How to position serverless for your workloads • Using Azure Functions for data processing
  • 3. Steph & Liam Steph Locke Tw: @theStephLocke Li: stephanielocke GH: stephlocke Liam Moat Li: liammoatcom GH: liammoat
  • 5. Level of abstraction Focus on business logic Physical server Virtual machine PaaS Containerization Serverless
  • 6. No infrastructure management Developers can just focus on their code—without needing to worry about provisioning and managing infrastructure Instant, event- driven scalability Application components react to events and triggers in near real-time with virtually unlimited scalability Pay-per-use Only pay for what you use: billing is typically calculated on the number of function calls, code execution time, and memory used* *Supporting services, like storage and networking, may be charged separately.
  • 7. Functions-as-a-Service programming model use functions to achieve true serverless compute Single responsibility Functions are single- purposed, reusable pieces of code that process an input and return a result Short-lived Functions don’t stick around when finished executing, freeing up resources for further executions Stateless Functions don’t hold any persistent state and don’t rely on the state of any other processes Event-driven and scalable Functions respond to predefined events, and are instantly replicated as many times as needed
  • 8. An event-based, serverless compute experience that accelerates app development Integrated programming model Use built-in triggers and bindings to define when a function is invoked and to what data it connects End-to-end development experience Take advantage of a complete, end-to-end development experience with Functions—from building and debugging locally on major platforms like Windows, macOS, and Linux to deploying and monitoring in the cloud Hosting options flexibility Choose the deployment model that better fits your business needs without compromising development experience Fully managed and cost-effective Automated and flexible scaling based on your workload volume, keeping the focus on adding value instead of managing infrastructure
  • 9. Integrated programming model Azure Functions features input/output bindings which provide a means of pulling data or pushing data to other services. These bindings work for both Microsoft and third-party services without the need to hard-code integrations. Trigger Input binding Output binding Trigger object Your code Input object Output object
  • 10. The “Old” Way - Pseudocode func Run() { var connectionString = CloudConfigurationManager.GetSetting("storage:connection") var storageAccount = CloudStorageAccount.Parse(connectionString) var eventHubClient = EventHubClient.CreateFromConnectionString(eventHubConnection) func Poll() { var queueClient = storageAccount.CreateCloudQueueClient() var queue = queueClient.GetQueueReference("myqueue-items") queue.CreateIfNotExists() var msg = queue.PeekMessage().AsString var tableClient = storageAccount.CreateCloudTableClient() var table = tableClient.GetTableReference("people") table.CreateIfNotExists() var customer = table.Execute(TableOperation.Retrieve<Customer>(“Customer”, msg)) // do something with customer - business logic goes here. eventHubClient.Send(new EventData(...)) queue.DeleteMessage(msg); Sleep(10 seconds) Poll() } Poll() }
  • 11. Triggers - Pseudocode func Run([QueueTrigger("myqueue-items")] string msg) { var connectionString = CloudConfigurationManager.GetSetting("storage:connection") var storageAccount = CloudStorageAccount.Parse(connectionString) var eventHubClient = EventHubClient.CreateFromConnectionString(eventHubConnection) var tableClient = storageAccount.CreateCloudTableClient() var table = tableClient.GetTableReference("people") table.CreateIfNotExists() var customer = table.Execute(TableOperation.Retrieve<Customer>("Customer", msg)) // do something with customer - business logic goes here. eventHubClient.Send(new EventData(...)) }
  • 12. Inputs - Pseudocode func Run([QueueTrigger("myqueue-items")] string myQueueItem [Table("people", "my-partition", "{queueTrigger}")] Customer customer) { var eventHubClient = EventHubClient.CreateFromConnectionString(eventHubConnection) // do something with customer - business logic goes here. eventHubClient.Send(new EventData(...)) }
  • 13. Outputs - Pseudocode [return: EventHub("event-hub", Connection = "EventHubConnection")] Func EventData Run([QueueTrigger("myqueue-items")] string myQueueItem [Table("MyTable", "MyPartition", "{queueTrigger}")] Customer customer) { // do something with customer - business logic goes here. return new EventData(...) }
  • 14. Streamlining connections and improving security Use Managed Identities for downstream connections and for clients that invoke Functions Leverage Azure Key Vault for services without support for MI Managed Identities and Key Vault secrets allows others to manage access and minimises risk of leaked credentials Use Azure Functions v4 for MI support
  • 15. Managed Identities + Infrastructure as Code FTW Step 1: Assign the Managed Identity access to resources Step 2: Add simplified values to app settings Step 3: Use simple connection references in Functions
  • 16. DEMO: Creating an Azure Function project IaC (bicep), VS Code (Azure Functions and bicep extensions), Azure Function Core Tools, Github Copilot
  • 18. Automation of scheduled tasks S C E N A R I O E X A M P L E Financial services A customer database is analyzed for duplicate entries every 15 minutes, to avoid multiple communications being sent out to same customers A function cleans a database every 15 minutes… …deduplicating entries based on business logic
  • 19. Handling data with a schedule Timer.cs [FunctionName("TimerTriggerCSharp")] public static void Run([TimerTrigger("0 */5 * * * *")]TimerInfo myTimer, ILogger log) { // Business logic goes here… } Use NCRONTAB specifications for schedules Schedules can be managed in appsettings to put all schedules in a single location Use inputs and outputs to handle whatever you need to do
  • 20. Real-time stream processing S C E N A R I O E X A M P L E ISV Huge amounts of telemetry data is collected from a massive cloud app. That data is processed in near real-time and stored in a DB for use in an analytics dashboard App or device producing data Event Hubs ingests telemetry data A function processes the data… …and sends it to Cosmos DB Data used for dashboard visualizations
  • 21. Handling events Queue.cs public static class QueueFunctions { [FunctionName("QueueTrigger")] public static void QueueTrigger( [QueueTrigger("items")] string myQueueItem, ILogger log) { // Business logic goes here… } } Use a trigger that listens to an event publisher Process messages with a schema to improve quality Choose to process single messages or micro-batches
  • 22. Handling data on change S C E N A R I O E X A M P L E Financial Services Colleagues use mobile banking to reimburse each other for lunch: the person who paid for lunch requests payment through his mobile app, triggering a notification on his colleagues’ phones.
  • 23. Handling data when there’s changes CosmosDB.cs [FunctionName("CosmosTrigger")] public static void Run([CosmosDBTrigger( databaseName: "CorpDB", containerName: "CorpDB", Connection = "CorpDB", LeaseContainerName = "leases")]IReadOnlyList<Person> documents, ILogger log) { // Business logic goes here… } Use a trigger for a source that has CDC – primarily Cosmos DB and Azure SQL Process messages with a schema to improve quality Use inputs to get additional record sets to support processing
  • 24. Handling data on request S C E N A R I O E X A M P L E Professional Services A SaaS solution provides extensibility through webhooks, which can be implemented through Functions, to automate certain workflows.
  • 25. Handling data when requested HTTP.cs [FunctionName("HttpTriggerCSharp")] public static async Task<IActionResult> Run( [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, ILogger log) { // Business logic goes here… } Use HTTP triggers to create APIs or webhook driven activities Use OpenAPI decorators to add documentation to your functions Use Managed Identity on resources that connect or do pass through auth where possible
  • 26. ? Workflows and orchestration with Durable Functions P A T T E R N S / U S E C A S E S Durable Functions is an extension of Azure Functions that lets you write stateful functions in a serverless compute environment Manageable sequencing + error handling/compensation Fanning out and fanning in External events correlation Flexible automated long-running process monitoring Start Get status Http-based async long- running APIs Human interaction
  • 27. Handling data with multiple steps Durable.cs [FunctionName("Chaining")] public static async Task<object> Run( [OrchestrationTrigger] IDurableOrchestrationContext context) { var x = await context.CallActivityAsync<object>("F1", null); await context.CallActivityAsync<object>("F2", x); } Orchestrate complex or stateful data flows using Durable Functions Use for different cases like aggregating, fanning out, human in the loop, or chaining functions
  • 28. DEMO: Creating different Azure Functions VS Code (Azure Functions & Azurite extensions), Azure Functions Core Tools, Github Copilot, Event Hub, Azure SQL, CosmosDB
  • 30. What we talked about • What are Azure Functions? • How to position serverless for your workloads • Using Azure Functions for data processing
  • 31. Try it yourself Learn with our Cloud Skills Challenge aka.ms/sqlbits-dwf Check out our repo to see things in detail aka.ms/sqlbits-dwf-demo Give it ago with free Azure resources Free Services