QueueAttribute Klasse

Definition

Attribut, das zum Binden eines Parameters an eine Azure-Warteschlange verwendet wird.

[Microsoft.Azure.WebJobs.ConnectionProvider(typeof(Microsoft.Azure.WebJobs.StorageAccountAttribute))]
[Microsoft.Azure.WebJobs.Description.Binding]
[System.AttributeUsage(System.AttributeTargets.Parameter | System.AttributeTargets.ReturnValue)]
public class QueueAttribute : Attribute, Microsoft.Azure.WebJobs.IConnectionProvider
[<Microsoft.Azure.WebJobs.ConnectionProvider(typeof(Microsoft.Azure.WebJobs.StorageAccountAttribute))>]
[<Microsoft.Azure.WebJobs.Description.Binding>]
[<System.AttributeUsage(System.AttributeTargets.Parameter | System.AttributeTargets.ReturnValue)>]
type QueueAttribute = class
    inherit Attribute
    interface IConnectionProvider
Public Class QueueAttribute
Inherits Attribute
Implements IConnectionProvider
Vererbung
QueueAttribute
Attribute
Microsoft.Azure.WebJobs.ConnectionProviderAttribute Microsoft.Azure.WebJobs.Description.BindingAttribute AttributeUsageAttribute
Implementiert
Microsoft.Azure.WebJobs.IConnectionProvider

Hinweise

Der Methodenparametertyp kann einer der folgenden sein:

  • QueueClient
  • QueueMessage (out-Parameter)
  • String (out-Parameter)
  • byte[] (out-Parameter)
  • BinaryData (out-Parameter)
  • Ein benutzerdefinierter Typ (out-Parameter, serialisiert als JSON)
  • Microsoft.Azure.WebJobs.ICollector`1 dieser Typen (um mehrere Nachrichten über Microsoft.Azure.WebJobs.ICollector`1.Add(`0)
  • Microsoft.Azure.WebJobs.IAsyncCollector`1 dieser Typen (um mehrere Nachrichten über Microsoft.Azure.WebJobs.IAsyncCollector`1.AddAsync(`0,System.Threading.CancellationToken)

Standardmäßig codiert die Erweiterung Base64-ausgehende Nachrichten. Dieses Verhalten kann durch Festlegen MessageEncodingvon geändert werden. Um beispielsweise Azure Functions so zu konfigurieren, dass keine Base64-Codierung/-Decodierung ausgeführt wird, geben Sie folgendes in host.json an.

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

Konstruktoren

QueueAttribute(String)

Initialisiert eine neue Instanz der QueueAttribute-Klasse.

Eigenschaften

Connection

Ruft den App-Einstellungsnamen ab, der die Azure Storage-Verbindungszeichenfolge enthält, oder legt diesen fest.

QueueName

Ruft den Namen der Warteschlange ab, an die gebunden werden soll.

Gilt für: