Skip to content

Latest commit

 

History

History
90 lines (56 loc) · 4.07 KB

File metadata and controls

90 lines (56 loc) · 4.07 KB

Azure Event Grid

Package Name NuGet Description
NLog.Extensions.AzureEventGrid NuGet Azure Event Grid

Queue Configuration

Syntax

<extensions>
  <add assembly="NLog.Extensions.AzureEventGrid" /> 
</extensions>

<targets>
  <target xsi:type="AzureEventGrid"
          name="String"
          layout="Layout"
          topic="Layout"
          cloudEventSource="Layout"
          gridEventSubject="Layout"
          eventType="Layout"
          contentType="Layout"
          dataSchema="Layout">
            <metadata name="mymeta" layout="mymetavalue" />   <!-- Multiple allowed -->
  </target>
</targets>

General Options

name - Name of the target.

layout - Event data-payload. Layout Required.

topic - Topic EndPoint Uri. Layout

cloudEventSource - Only for CloudEvent-format (Recommended event format) and specify context where event occurred. Layout

gridEventSubject - Only for GridEvent-format and specify resource path relative to the topic path. Layout

eventType - Type of the event. Ex. "Contoso.Items.ItemReceived". Layout

contentType - Content type of the data-payload. Layout

dataFormat - Format of the data-payload (Binary / Json). Default Binary. String

dataSchema - Schema version of the data-payload. Layout

Authentication Options

managedIdentityClientId - clientId for ManagedIdentityClientId on DefaultAzureCredentialOptions. Requires serviceUri.

managedIdentityResourceId - resourceId for ManagedIdentityResourceId on DefaultAzureCredentialOptions, do not use together with ManagedIdentityClientId. Requires serviceUri.

tenantIdentity - tenantId for DefaultAzureCredentialOptions. Requires serviceUri.

sharedAccessSignature - Access signature for AzureSasCredential authentication. Requires serviceUri.

accessKey - Key for AzureKeyCredential authentication. Requires serviceUri.

clientAuthId - clientId for ClientSecretCredential OAuth2 authentication. Requires tenantIdentity and clientAuthSecret.

clientAuthSecret - clientSecret for ClientSecretCredential OAuth2 authentication. Requires tenantIdentity and clientAuthId.

When DefaultAzureCredential is used for Azure Identity, then it can also resolve from environment variables:

  • AZURE_CLIENT_ID - For ManagedIdentityClientId / WorkloadIdentityClientId
  • AZURE_TENANT_ID - For TenantId

See also: Set up Your Environment for Authentication

Proxy Options

noProxy - Bypasses any system proxy and proxy in ProxyAddress when set to true.

proxyAddress - Address of the proxy server to use (e.g. http://proxyserver:8080).

proxyLogin - Login to use for the proxy server. Requires proxyPassword.

proxyPassword - Password to use for the proxy server. Requires proxyLogin.

useDefaultCredentialsForProxy - Uses the default credentials (System.Net.CredentialCache.DefaultCredentials) for the proxy server. Take precedence over proxyLogin and proxyPassword when set to true.

Retry Policy

taskTimeoutSeconds - How many seconds a Task is allowed to run before it is cancelled (Default 150 secs)

retryDelayMilliseconds - How many milliseconds to wait before next retry (Default 500ms, and will be doubled on each retry).

retryCount - How many attempts to retry the same Task, before it is aborted (Default 0)