Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Azure Functions provides a powerful serverless infrastructure, enabling you to develop scalable, on-demand HTTP endpoints with ease. By using JavaScript or TypeScript, you can create serverless applications that respond to various events, allowing you to focus on writing code without worrying about managing servers. This guide helps you get started with developing serverless Node.js apps using Azure Functions, integrating seamlessly with other Azure services.
An Azure Function resource is a logical unit for all related functions in a single Azure geographic location. The resource can contain a single function or many functions, which can be independent of each other or related with input or output bindings. You can select from many common functions or create your own.
The function resource settings include typical serverless configurations including environment variables, authentication, logging, and CORS.
Durable Functions retain state, or manage long-running functions in Azure. Create your first durable function in JavaScript.
When you develop a static front-end client application (such as Angular, React, or Vue), which also need serverless APIs, use Static Web apps with functions to bundle both together.
If you intend to deploy your API with your Static web app, you don't need to proxy your client application's API calls. The proxy is established for you when you deploy the Azure Functions app as a managed app.
When you develop locally with a Static Web App and Azure Functions, the Azure Static Web App CLI provides the local proxy.
The following common settings should be configured to keep your Azure Function secure:
*
, indicating all domains.https
) and delay purchasing a domain name, and using a certificate for the domain until you're ready.stage
or preflight
and push to that slot. Swap this stage slot to production when you're ready. Don't get in the habit of manually pushing to production. Your code base should be able to indicate the version or commit that is on a slot.A function is an exported asynchronous function with request and context information. The following partial screenshot from the Azure portal shows the function code.
import { app, HttpRequest, HttpResponseInit, InvocationContext } from "@azure/functions";
export async function status(request: HttpRequest, context: InvocationContext): Promise<HttpResponseInit> {
context.log(`Http function processed request for url "${request.url}"`);
return {
status: 200,
jsonBody: {
env: process.env
}
};
};
app.http('status', {
route: "status",
methods: ['GET'],
authLevel: 'anonymous',
handler: status
});
Create your first function using Visual Studio Code. Visual Studio Code, simplifies many of the details with the Azure Functions extension.
This extension helps you create JavaScript and TypeScript functions with common templates.
Serverless functions remove much of the server configuration and management so you can focus on just the code you need.
Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Learning path
Create serverless applications learning path - Training
In this learning path, discover Azure Functions that create event-driven, compute-on-demand systems using server-side logic to build serverless architectures.
Certification
Microsoft Certified: Azure Developer Associate - Certifications
Build end-to-end solutions in Microsoft Azure to create Azure Functions, implement and manage web apps, develop solutions utilizing Azure storage, and more.