Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents 1.0.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
.NET Standard 2.0
dotnet add package Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents --version 1.0.0
NuGet\Install-Package Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents --version 1.0.0
#r "nuget: Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents as a Cake Addin
#addin nuget:?package=Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents&version=1.0.0

// Install Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents as a Cake Tool
#tool nuget:?package=Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents&version=1.0.0

CloudNative CloudEvent support for Azure.Messaging.EventGrid library for .NET

This library can be used to enable publishing CloudNative CloudEvents using the Azure Event Grid library.

Getting started

Install the package

Install the client library from NuGet:

dotnet add package Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents --prerelease

Prerequisites

You must have an Azure subscription and an Azure resource group with a custom Event Grid topic or domain. Follow this step-by-step tutorial to register the Event Grid resource provider and create Event Grid topics using the Azure portal. There is a similar tutorial using Azure CLI.

Authenticate the client

In order for the client library to interact with a topic or domain, you will need the endpoint of the Event Grid topic and a credential, which can be created using the topic's access key.

You can find the endpoint for your Event Grid topic either in the Azure Portal or by using the Azure CLI snippet below.

az eventgrid topic show --name <your-resource-name> --resource-group <your-resource-group-name> --query "endpoint"

The access key can also be found through the portal, or by using the Azure CLI snippet below:

az eventgrid topic key list --name <your-resource-name> --resource-group <your-resource-group-name> --query "key1"
Creating and Authenticating EventGridPublisherClient

Once you have your access key and topic endpoint, you can create the publisher client as follows:

EventGridPublisherClient client = new EventGridPublisherClient(
    new Uri("<endpoint>"),
    new AzureKeyCredential("<access-key>"));

Key concepts

For information about general Event Grid concepts: Concepts in Azure Event Grid.

For detailed information about the Event Grid client library concepts: Event Grid Client Library

Examples

EventGridPublisherClient client = new EventGridPublisherClient(
        new Uri(TestEnvironment.CloudEventTopicHost),
        new AzureKeyCredential(TestEnvironment.CloudEventTopicKey));

var cloudEvent =
    new CloudEvent
    {
        Type = "record",
        Source = new Uri("http://www.contoso.com"),
        Data = "data"
    };
await client.SendCloudNativeCloudEventAsync(cloudEvent);

Troubleshooting

For troubleshooting information, see the Event Grid Client Library documentation.

Next steps

View more samples here for common usages of the library.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0 32,298 9/7/2021
1.0.0-beta.2 3,658 6/15/2021
1.0.0-beta.1 2,232 3/18/2021