An introduction to Azure Functions
Azure Functions is a solution for easily running small pieces of code, or „functions,“ in the cloud. You can write just the code you need for the problem at hand, without worrying about a whole application or the infrastructure to run it. C #, F #, Node.js, Java, or PHP. Functions can make more productive, and you can use your language of choice. Pay only for the time your code runs and trust Azure to scale as needed. Azure Functions lets you develop serverless applications on Microsoft Azure.
This topic provides a high-level overview of Azure Functions. If you want to jump right into and start with functions, start with your first Azure Function. If you are looking for more technical information about Functions, see the developer reference.
features
Here are some key features of Functions:
- Choice of language – Write functions using your choice of C #, F #, or Javascript. See Supported languages for other options.
- Pay-per-use pricing model – Pay only for the time spent running your code. See the Consumption hosting plan option in the pricing section.
- Bring your own dependencies – Functions supports NuGet and NPM, so you can use your favorite libraries.
- Integrated security – Protect HTTP-triggered functions with OAuth providers such as Azure Active Directory, Facebook, Google, Twitter, and Microsoft Account.
- Simplified integration – Easily leverage Azure services and software-as-a-service (SaaS) offerings. See the integrations section for some examples.
- Flexible development – GitHub, Visual Studio Team Services, and other supported development tools.
- Open-source – The Functions runtime is open-source and available on GitHub .
What can I do with Functions?
Functions is a great solution for processing data, integrating systems, working with the Internet of Things (IoT), and building simple APIs and microservices. Consider tasks or image processing, file maintenance, or any tasks that you want to run on a schedule.
Functions provides templates to get started with key scenarios, including the following:
- HTTPTrigger – Trigger the execution of your code by using HTTP request. For example, see Create your first function .
- TimerTrigger – Execute cleanup or other batch tasks on a predefined schedule. For an example, see Create a function triggered by a timer .
- GitHub webhook – Respond to events that occur in your GitHub repositories. For an example, see Create a function triggered by a GitHub webhook .
- Generic webhook – Process webhook HTTP requests from any service that supports webhooks. For an example, see Create a function triggered by a generic webhook .
- CosmosDBTrigger – Process Azure Cosmos DB documents when they are updated or updated in a NoSQL database. For an example, see Create a function triggered by Azure Cosmos DB .
- BlobTrigger – Process Azure Storage blobs when they are added to containers. You might use this function for image resizing. For more information, see blob storage bindings .
- QueueTrigger – Respond to messages as they arrive at Azure Storage queue. For an example, see Create a function triggered by Azure Queue storage .
- EventHubTrigger – Respond to events delivered to Azure Event Hub. Especially useful in application instrumentation, user experience or workflow processing, and Internet of Things (IoT) scenarios. For more information, see Event Hubs bindings . Internet of Things (IoT) scenarios. For more information, see
- ServiceBusQueueTrigger – Connect your code to other Azure services or on-premises services by listening to message queues. For more information, see Service Bus bindings .
- ServiceBusTopicTrigger – Connect your code to other Azure services or on-premises services by subscribing to topics. For more information, see Service Bus bindings .
Azure Functions supports triggers , which are ways to start execution of your code, and bindings , which are ways to simplify coding for input and output data. Azure Functions Provides, Lake Azure Functions triggers and bindings developer reference .
Integrations
Azure Functions integrates with various Azure and 3rd party services. These services can trigger your function and start execution, or they can serve as input and output for your code. The following service integrations are supported by Azure Functions:
- Azure Cosmos DB
- Azure Event Hubs
- Azure Event Grid
- Azure Mobile Apps (tables)
- Azure Notification Hubs
- Azure Service Bus (queues and topics)
- Azure Storage (blob, queues, and tables)
- GitHub (webhooks)
- On-premises (using Service Bus)
- Twilio (SMS messages)
In the project, we use Logic functions as follows
Using Logic Functions to communicate to Philips Hue and Azure –