A trigger is a configurable way of defining how an Azure Function is invoked. In our sample scenario, we would like our Function to be invoked when there is a message is available in the orders Service Bus queue:
[FunctionName("UpdateInventory")] public async static void Run([ServiceBusTrigger("orders", Connection = "ShipAnyWhere_SERVICEBUS")]PurchaseOrder order
The same configuration can also be done in the function.json file:
{ "generatedBy": "Microsoft.NET.Sdk.Functions-1.0.24", "configurationSource": "attributes", "bindings": [ { "type": "serviceBusTrigger", "connection": "ShipAnyWhere_SERVICEBUS", "queueName": "orders", "name": "order" } ], "disabled": false, "scriptFile": "../bin/ShipAnyWhere-AzureFunctions.dll", "entryPoint": "ShipAnyWhere.UpdateInventory.Run" }