Azure Function - tom-kotlar/learn-azure GitHub Wiki

Azure Functions

Serverless architecture makes use of infrastructure provided by the cloud.

Azure Functions is a fully scalable, resilient, reliable, and secure service managed PaaS service that helps us to implement a serverless architecture.

Azure Function App An Azure Function App hosts one or more Azure Functions. It provides the environment and runtime for the functions.


The npm start command is equivalent to the following commands:

  • func
  • npm run build
  • func extensions install
  • tsc
  • func start

Functions triggers bindings

An Azure Function is triggered by an event rather than being called directly from an app. You specify the type of event that will trigger the functions in your Azure Function App. The events available include:

  • Blob trigger.

    This type of function runs when a file is uploaded or modified in Azure Blob storage.

  • Event Hub trigger.

    An Event Hub trigger runs the function when an Event Hub receives a message.

  • Azure Cosmos DB trigger.

    This trigger runs when a document is added to, or modified in, and Azure Cosmos DB database. You can use this trigger to integrate Azure Cosmos DB with other services. For example, if a document representing a customer's order is added to a database, you could use a trigger to send a copy of the order to a queue for processing.

  • HTTP trigger.

    An HTTP trigger runs the function when an HTTP request occurs in a web app. You can also use this trigger to respond to webhooks. A webhook is a callback that occurs when an item hosted by a website is modified. For example, you can create an Azure Function that is fired by a webhook from a GitHub repository when an item in the repository changes.

  • Queue trigger.

    This trigger fires the function when a new item is added to an Azure Storage Queue.

  • Service Bus Queue trigger.

    Use this trigger to run the function when a new item is added to an Azure Service Bus Queue.

  • Service Bus Topic trigger.

    This trigger runs the function in response to a new message arriving on a Service Bus Topic.

  • Timer trigger.

    Use this event to run the Azure Function at regular intervals, following a schedule that you define.


An Azure Function App stores management information, code, and logs in Azure Storage. Create a Storage Account to hold this data. The storage account must support Azure Blob, Queue, Files, and Table storage; use a general Azure Storage account for this purpose.

Connect Azure Functions to Azure Storage using VS Code

Examples:

Azure-functions-university

Azure serverless community library

  • library of downloadable examples with ARM templates

Serverless Microservices reference architecture