Serverless lets you focus on coding and testing instead of provisioning infrastructure, configuring web servers, debugging your configuration, managing security settings, and all the drudgery normally associated with getting an app up and running. In this session with, you’ll discover how to migrate an API of an existing app to Azure Functions. You’ll learn how to use Visual Studio Code and the Azure Functions extension to speed up your work. After this session, you’ll join the ranks of serverless developers.
8. @simona_cotin
–Martin Fowler
“Serverless architectures refer to
applications that significantly
depend on third-party services
(known as Backend as a Service
or "BaaS") or on custom code
that's run in ephemeral containers
(Function as a Service or "FaaS")”
16. @simona_cotin
✓How do I create a project?
✓How do I debug and run locally?
✓ How do I install npm packages?
✓ How do I connect to a mongodb instance?
✓ Where do I save my env variables?
✓ How to configure REST like URLs?
✓ How do I deploy to the cloud?
49. @simona_cotin
•Javascript has a rich
ecosystem of libraries and
tools
•Enable FE developers to
build scalable backends
•Large use base - javascript
is the English of languages
Why Node.js?
50. @simona_cotin
•Lightweight - helps reduce cold
start
•Commonly run in a distributed,
horizontally scaled fashion
•Scripting means no compilation
required to start from a portal
•Runs equally easy on most
OS’s
Why Node.js?
52. @simona_cotin
How do I create a project?
How do I debug and run locally?
How do I install npm packages?
How do I connect to mongodb?
Where do I save my env variables?
How to configure REST like URLs?
How do I deploy to the cloud?
Why Nodejs?
VS Code & Azure Functions Extension
VS Code & Azure Functions Extension
You know this already :)
You know this already :)
local.settings.json
proxy.json
VS Code & Azure Functions Extension
AWESOME <3
I want you to think about twitter for a second. Think about Twitter scale.
330 million users in total, 6k tweets/second, 350k tweets
Now I want you to think about what if the twitter creators would have been paralysed by how to scale that they didn’t even begin!
That’s me on every single startup idea I’ve ever had. Which is why I love seervelress so much. Becas it handles th eissues of scaling leading me to building the next twitter! I knew how to make an api with express but I didn’t know how to build an api with servers and that’s what we’re going to talk about today.
And that’s the topic of today’s talk?
https://www.istockphoto.com/photo/three-young-nerds-with-thinking-caps-gm678860582-125092811
Serverless computing is the abstraction of servers, infrastructure, and operating systems. When you build serverless apps you don’t need to provision and manage any servers, so you can take your mind off infrastructure concerns. Serverless computing is driven by the reaction to events and triggers happening in near-real-time—in the cloud. As a fully managed service, server management and capacity planning are invisible to the developer and billing is based just on resources consumed or the actual time your code is running.
https://martinfowler.com/articles/serverless.html
Serverless computing is the abstraction of servers, infrastructure, and operating systems. When you build serverless apps you don’t need to provision and manage any servers, so you can take your mind off infrastructure concerns. Serverless computing is driven by the reaction to events and triggers happening in near-real-time—in the cloud. As a fully managed service, server management and capacity planning are invisible to the developer and billing is based just on resources consumed or the actual time your code is running.
Serverless computing is the abstraction of servers, infrastructure, and operating systems. When you build serverless apps you don’t need to provision and manage any servers, so you can take your mind off infrastructure concerns. Serverless computing is driven by the reaction to events and triggers happening in near-real-time—in the cloud. As a fully managed service, server management and capacity planning are invisible to the developer and billing is based just on resources consumed or the actual time your code is running.
And the way this talk is structured is a series of I don’t knows, things that I know how to do when using express but had to learn with serverless. And some of them might be exactly how you expected it to, but we still need to go through the effort of understanding them.
So here we have an angular app that’s connecting to an express backend. And what we can do is Create new puppies, list exsiting ones, edit puppis and delete them. So basically the typical CRUD operations. And the goal is to take this app and instead of connecting to an express back end we should insteab be able to call serverless endpoints.
https://raw.githubusercontent.com/ashleymcnamara/Developer-Advocate-Bit/master/BABY_BIT.png
Explain why , set of stories list all tasks
Creating a project
Add section on serverless - spend a minute or two on this; what is serverless
https://raw.githubusercontent.com/ashleymcnamara/Developer-Advocate-Bit/master/BABY_BIT.png
I want you to take a very good loooooong look at this logo. This has been one of the most controversial logos in the entire history of text editor logos. It’s also the logo of the editor that will help you the most with building servrless apps.
Empty IDE
IDE with the extension installed
https://raw.githubusercontent.com/ashleymcnamara/Developer-Advocate-Bit/master/BABY_BIT.png
I want you to take a very good loooooong look at this logo. This has been one of the most controversial logos in the entire history of text editor logos. It’s also the logo of the editor that will help you the most with building servrless apps.
Empty IDE
IDE with the extension installed
https://raw.githubusercontent.com/ashleymcnamara/Developer-Advocate-Bit/master/BABY_BIT.png
I want you to take a very good loooooong look at this logo. This has been one of the most controversial logos in the entire history of text editor logos. It’s also the logo of the editor that will help you the most with building servrless apps.
Once we have the extension installed we can go ahead and create a new function on our computer. First thing that will be created is a function app that allows us to group together functions with similar functionality and also configure settings that will apply to all functions within the same functionapp. To create a new function app we need to Click this folder icon on our extension, choose the language that we want to use. Once that’s done a vscode folder will be generated for us which will include the debuggging cofnig for us. Another important file that’s being generated is the local.settings.json file. This is where we’ll store our secrets, our environment variables.
Stop looping
This will generate a few files for us so let’s see what each of them does. The function.json file defines the function bindings and other configuration settings. The runtime uses this file to determine the events to monitor and how to pass data into and return data from function execution. The index.js file is where our functions’ code lives. Sample.dat contains test data.
All files are stored inside a folder named just like our function
Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the first resource was served.
In your local.settings.json
What is cors
https://github.com/ashleymcnamara/Developer-Advocate-Bit/blob/master/bit_octocat.png
There’s actually more than one option here. The first and the easiest is deploying using the same azure functions extension. This will zip up your code and you node modules and push them to the cloud. Pretty straighforward. And easy to use.
There’s actually more than one option here. The first and the easiest is deploying using the same azure functions extension. This will zip up your code and you node modules and push them to the cloud. Pretty straighforward. And easy to use.
https://www.youtube.com/watch?v=FGJnBWWxTos
https://www.youtube.com/watch?v=FGJnBWWxTos
Javascript is easy to get started with and friendly to beginners.