Documentation
Learn how to use queue output bindings to send messages to Azure Storage Queues from your Azure Functions.
Output bindings allow your Azure Function to interact with other Azure services and external systems without requiring explicit SDK code in your function. Queue output bindings are used to send messages to an Azure Storage Queue.
When you define a queue output binding, you can simply return a value from your function, or assign a value to the output binding parameter, and Azure Functions runtime will automatically handle sending that message to the configured queue.
Queue output bindings are configured in the function.json file for your function.
function.json Examplefunction.json
{
  "bindings": [
    {
      "name": "msg",
      "type": "queue",
      "direction": "out",
      "queueName": "myoutputqueue",
      "connection": "AzureWebJobsStorage"
    }
  ]
}
            In this example:
"name": "msg": This is the name of the parameter in your function code that will receive the output."type": "queue": Specifies that this is a queue binding."direction": "out": Indicates that this binding is for output."queueName": "myoutputqueue": The name of the Azure Storage Queue to which messages will be sent. This queue will be created if it doesn't exist."connection": "AzureWebJobsStorage": The name of an app setting that contains the connection string for your Azure Storage account. This defaults to AzureWebJobsStorage, which is the default connection string used by Azure Functions.
using Microsoft.Azure.Functions.Worker;
public static class QueueOutputFunction
{
    [Function("QueueOutputFunction")]
    [QueueOutput("myoutputqueue")]
    public static string Run(
        [QueueTrigger("myinputqueue")] string myQueueItem,
        FunctionContext context)
    {
        var logger = context.GetLogger();
        logger.LogInformation($"C# Queue trigger function processed: {myQueueItem}");
        string responseMessage = $"Message '{myQueueItem}' processed and sent to output queue.";
        return responseMessage; // This string will be sent to the 'myoutputqueue'
    }
}
             
const { app } = require('@azure/functions');
app.storageQueue('queueOutputFunction', {
    queueName: 'myinputqueue',
    connection: 'AzureWebJobsStorage',
    handler: async (queueItem, context) => {
        context.log('JavaScript queue trigger function processed work item', queueItem);
        // Example of sending a message to an output queue
        // The output binding 'msg' must be defined in function.json
        context.bindings.msg = `Processed: ${queueItem}`;
        context.log('Message sent to output queue.');
    }
});
            In the JavaScript example, the output binding is referred to via context.bindings.msg, where msg matches the "name" property in the function.json.
import logging
import azure.functions as func
def main(myQueueItem: str, msg: func.Out[str]) -> None:
    logging.info('Python queue trigger function processed a work item: %s', myQueueItem)
    msg.set(f"Processed: {myQueueItem}")
            In the Python example, the output binding is represented by the msg: func.Out[str] parameter, where msg matches the "name" property in the function.json.
queueName does not exist, Azure Functions will attempt to create it.connection setting in function.json points to an application setting that holds your Azure Storage connection string. Ensure this setting is correctly configured in your Azure Function App's configuration.
        function.json. Always use application settings or environment variables.