SlideShare a Scribd company logo
TechDays 2017 - Creating real life serverless solutions with azure functions
TechDays 2017 - Creating real life serverless solutions with azure functions
TechDays 2017 - Creating real life serverless solutions with azure functions
servers
Like PaaS
“If your PaaS can efficiently start instances in
20ms that run for half a second, then call it
serverless.”
Adrian Cockcroft - VP Cloud Architecture Strategy AWS
Keep It Small and Simple
TechDays 2017 - Creating real life serverless solutions with azure functions
URL Minification
GET minified URL redirect
CREATE minified URL
CosmosDB
Oh yeah!
TechDays 2017 - Creating real life serverless solutions with azure functions
Web App CosmosDB
TechDays 2017 - Creating real life serverless solutions with azure functions
CosmosDB
GET
POST
CosmosDB
GET
POST
Azure cache
UPDATE Change
Feed
CosmosDB
GET
POST
Azure cache
UPDATE
Change
Feed
Queue TRIGGER
CosmosDB
GET
POST
Bindings are your friend
"bindings": [
{
"type": "httpTrigger",
"route": "{slug}",
"methods": [
"get"
],
"authLevel": "anonymous",
"name": "req"
}
],
Function, User, System & Admin
"bindings": [
{
"name": “minifiedUrl",
"type": "documentDB",
"databaseName": “MinifyRepository",
"collectionName": “MinifiedUrls",
"createIfNotExists": true,
"connection": “CosmosDbConnection",
"direction": "out"
}
],
Don’t write JSON
TechDays 2017 - Creating real life serverless solutions with azure functions
Where to put the code
Existing patterns &
principles still apply!
private readonly ICosmosClient cosmosClient;
public CreateUrlHandler()
{
this.cosmosClient = new CosmosClient();
}
public CreateUrlHandler(ICosmosClient cosmosClient)
{
this.cosmosClient = cosmosClient;
}
TechDays 2017 - Creating real life serverless solutions with azure functions
CosmosDB
GET
POST
TechDays 2017 - Creating real life serverless solutions with azure functions
TechDays 2017 - Creating real life serverless solutions with azure functions
[FunctionName("Get")]
public static async Task<HttpResponseMessage> Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "{slug}")]
HttpRequestMessage req,
string slug,
TraceWriter log)
{
var getUrl = new GetUrlHandler();
var minifiedUrl = await getUrl.Execute(slug);
if (minifiedUrl == null)
{
return req.CreateErrorResponse(HttpStatusCode.NotFound,
$"Minified value `{slug}` is not found.");
}
var response = req.CreateResponse(HttpStatusCode.Redirect);
response.Headers.Location = new Uri(minifiedUrl.FullUrl);
return response;
}
public static class Create
{
[FunctionName("Create")]
public static HttpResponseMessage Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "post", Route = "create")]
HttpRequestMessage req,
[DocumentDB("datbaseName", "collectionName",
PartitionKey = "MinifiedUrls",
CreateIfNotExists = true,
ConnectionStringSetting = "minifiedUrlConnectionString")]
out dynamic minifiedUrl,
TraceWriter log)
{
string jsonContent = req.Content.ReadAsStringAsync().Result;
var data = JsonConvert.DeserializeObject<MinifiedUrl>(jsonContent);
var create = new CreateUrlHandler();
minifiedUrl = create.Execute(data);
return req.CreateResponse(HttpStatusCode.Created,
$"api/{data.MinifiedSlug}");
}
}
TechDays 2017 - Creating real life serverless solutions with azure functions
Easy mode
TechDays 2017 - Creating real life serverless solutions with azure functions
TechDays 2017 - Creating real life serverless solutions with azure functions
master branch
to production
Pro mode
TechDays 2017 - Creating real life serverless solutions with azure functions
TechDays 2017 - Creating real life serverless solutions with azure functions
Check if you use slots
Point to the correct package
TechDays 2017 - Creating real life serverless solutions with azure functions
TechDays 2017 - Creating real life serverless solutions with azure functions
TechDays 2017 - Creating real life serverless solutions with azure functions
https://my.jdv.li/api/minifiedurl
or
https://my.jdv.li/minifiedurl
{
"$schema": "http://json.schemastore.org/proxies",
"proxies": {
"getminifiedredirect": {
"matchCondition": {
"methods": [ "GET" ],
"route": "/{slug}"
},
"backendUri": "https://%WEBSITE_HOSTNAME%/api/{slug}"
}
}
}
Matching conditions
https://github.com/Jandev/minifier
@Jan_de_V
jandv@4dotnet.nl
https://jan-v.nl

More Related Content

PPTX
Creating real life serverless solutions with Azure Functions
PPTX
Creating real life serverless solutions with Azure Functions - dotNet Amsterd...
PDF
When all you have is a hammer, everything looks like Javascript - ebookcraft ...
PDF
AtlasCamp 2014: Writing Connect Add-ons for Confluence
PPSX
Azure DocumentDB
PPTX
Elastic search intro-@lamper
PDF
AtlasCamp 2014: 10 Things a Front End Developer Should Know About Connect
PPSX
Azure Mobile Services .NET Backend
Creating real life serverless solutions with Azure Functions
Creating real life serverless solutions with Azure Functions - dotNet Amsterd...
When all you have is a hammer, everything looks like Javascript - ebookcraft ...
AtlasCamp 2014: Writing Connect Add-ons for Confluence
Azure DocumentDB
Elastic search intro-@lamper
AtlasCamp 2014: 10 Things a Front End Developer Should Know About Connect
Azure Mobile Services .NET Backend

What's hot (20)

PPTX
ASP.NET WEB API
PPTX
曾勇 Elastic search-intro
PDF
Ng init | EPI Sousse
PPTX
Azure Service Fabric Mesh
PPTX
Running Node Applications on iOS and Android
PPTX
Microservices/dropwizard
PPTX
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
PDF
Azure Large Scale Deployments - Tales from the Trenches
PDF
Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...
PDF
Consuming Web Services in Android
PDF
Getting started with node JS
PDF
【勉強会資料】ネットワークアクセス制御編 for PCI DSS
PDF
David Fetter, Disqus
PDF
Into to Node.js: Building Fast, Scaleable Network Applications
PPT
Intergalactic data speak_highload++_20131028
PDF
10gen MongoDB Video Presentation at WebGeek DevCup
PPTX
Azure Resource Manager (ARM) Template - Beginner's Guide
PPTX
Introduction about-ajax-framework
PPTX
Product Ecosystem Of Cloud Native Applications
PDF
Building Android apps with Parse
ASP.NET WEB API
曾勇 Elastic search-intro
Ng init | EPI Sousse
Azure Service Fabric Mesh
Running Node Applications on iOS and Android
Microservices/dropwizard
Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS A...
Azure Large Scale Deployments - Tales from the Trenches
Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...
Consuming Web Services in Android
Getting started with node JS
【勉強会資料】ネットワークアクセス制御編 for PCI DSS
David Fetter, Disqus
Into to Node.js: Building Fast, Scaleable Network Applications
Intergalactic data speak_highload++_20131028
10gen MongoDB Video Presentation at WebGeek DevCup
Azure Resource Manager (ARM) Template - Beginner's Guide
Introduction about-ajax-framework
Product Ecosystem Of Cloud Native Applications
Building Android apps with Parse
Ad

Similar to TechDays 2017 - Creating real life serverless solutions with azure functions (16)

PDF
TechDays Sweden - Creating real-life serverless solutions with Azure Functions
PPTX
cosmodb ppt personal.pptxgskjhkjsfgkhkjgskhk
PPTX
Azure Cosmos DB L100 Pitch Deck
PPTX
Tech-Spark: Exploring the Cosmos DB
PPTX
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
PPTX
Introduction to CosmosDB - Azure Bootcamp 2018
PDF
Getting started with Cosmos DB + Linkurious Enterprise
PPTX
Cosmos DB and Azure Functions A serverless database processing.pptx
PPTX
DataWeekender 4_2 Cosmos DB and Azure Functions- A serverless database proces...
PPTX
NoSQL Migration Technical Pitch Deck
PDF
Dealing with Azure Cosmos DB
PPTX
Azure Cosmos DB by Mohammed Gadi AUG April 2019
PPTX
cosmodb ppt.pptxfkhkfsgkhgfkfghkhsadaljlsfdfhkgjh
PPTX
Azure Cosmos DB - Azure Austin Meetup
PPTX
Cosmos db
PPTX
Session: Modern Data WareHouse
TechDays Sweden - Creating real-life serverless solutions with Azure Functions
cosmodb ppt personal.pptxgskjhkjsfgkhkjgskhk
Azure Cosmos DB L100 Pitch Deck
Tech-Spark: Exploring the Cosmos DB
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
Introduction to CosmosDB - Azure Bootcamp 2018
Getting started with Cosmos DB + Linkurious Enterprise
Cosmos DB and Azure Functions A serverless database processing.pptx
DataWeekender 4_2 Cosmos DB and Azure Functions- A serverless database proces...
NoSQL Migration Technical Pitch Deck
Dealing with Azure Cosmos DB
Azure Cosmos DB by Mohammed Gadi AUG April 2019
cosmodb ppt.pptxfkhkfsgkhgfkfghkhsadaljlsfdfhkgjh
Azure Cosmos DB - Azure Austin Meetup
Cosmos db
Session: Modern Data WareHouse
Ad

More from Jan de Vries (14)

PDF
Webdev Zwolle - PaaSwordless in Azure
PDF
Global Azure - Use Azure Active Directory Managed Identities for your services!
PDF
Next.Net event - Use Azure Active Directory Managed Identities for your servi...
PPTX
Move Up - Design je Azure Functions als een pro
PDF
TechDays Sweden - No Nouns!
PPTX
Serverless... Hoe, wat en vooral waarom
PPTX
Why care about serverless
PPTX
No nouns, hoe ga je een microservices architectuur opzetten
PDF
No nouns
PPTX
Using the Azure Container Service in your company
PPTX
Visual Studio 2017
PPTX
Applied patterns in the project
PPTX
Dependency injection en testen
PPT
Clean Code summary
Webdev Zwolle - PaaSwordless in Azure
Global Azure - Use Azure Active Directory Managed Identities for your services!
Next.Net event - Use Azure Active Directory Managed Identities for your servi...
Move Up - Design je Azure Functions als een pro
TechDays Sweden - No Nouns!
Serverless... Hoe, wat en vooral waarom
Why care about serverless
No nouns, hoe ga je een microservices architectuur opzetten
No nouns
Using the Azure Container Service in your company
Visual Studio 2017
Applied patterns in the project
Dependency injection en testen
Clean Code summary

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPT
Teaching material agriculture food technology
PDF
Encapsulation theory and applications.pdf
PDF
cuic standard and advanced reporting.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Big Data Technologies - Introduction.pptx
Understanding_Digital_Forensics_Presentation.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
NewMind AI Weekly Chronicles - August'25 Week I
Teaching material agriculture food technology
Encapsulation theory and applications.pdf
cuic standard and advanced reporting.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Electronic commerce courselecture one. Pdf
Review of recent advances in non-invasive hemoglobin estimation
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Reach Out and Touch Someone: Haptics and Empathic Computing
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Encapsulation_ Review paper, used for researhc scholars
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Agricultural_Statistics_at_a_Glance_2022_0.pdf

TechDays 2017 - Creating real life serverless solutions with azure functions