Show / Hide Table of Contents

Class QueueTriggerAttribute

Attribute used to bind a parameter to an Azure Queue message, causing the function to run when a message is enqueued.

Inheritance
System.Attribute
QueueTriggerAttribute
Namespace: System.Dynamic.ExpandoObject
Assembly: Microsoft.Azure.WebJobs.Extensions.Storage.Queues.dll
Syntax
[Microsoft.Azure.WebJobs.ConnectionProvider(typeof(Microsoft.Azure.WebJobs.StorageAccountAttribute))]
[Microsoft.Azure.WebJobs.Description.Binding]
[System.AttributeUsage(System.AttributeTargets.Parameter)]
[System.Diagnostics.DebuggerDisplay("{QueueName,nq}")]
public sealed class QueueTriggerAttribute : Attribute, Microsoft.Azure.WebJobs.IConnectionProvider
Remarks

The method parameter type can be one of the following:

  • Azure.Storage.Queues.Models.QueueMessage
  • System.String
  • byte[]
  • System.BinaryData
  • A user-defined type (serialized as JSON)

By default messages received from the queue are expected to be Base64-encoded and are decoded before calling the function. This behavior can be changed by setting MessageEncoding. For example, to configure Azure Functions to perform no base64 encoding/decoding, specify the following in host.json.


 "extensions": {
   "queues": {
     "messageEncoding": "none"
   }
 }
 

Constructors

QueueTriggerAttribute(String)

Initializes a new instance of the QueueTriggerAttribute class.

Declaration
public QueueTriggerAttribute (string queueName);
Parameters
System.String queueName

The name of the queue to which to bind.

Properties

Connection

Gets or sets the app setting name that contains the Azure Storage connection string.

Declaration
public string Connection { get; set; }
Property Value
System.String

QueueName

Gets the name of the queue to which to bind.

Declaration
public string QueueName { get; }
Property Value
System.String

Back to top Azure SDK for .NET