Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents
1.0.0
Prefix Reserved
dotnet add package Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents --version 1.0.0
NuGet\Install-Package Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents -Version 1.0.0
<PackageReference Include="Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents" Version="1.0.0" />
paket add Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents --version 1.0.0
#r "nuget: Microsoft.Azure.Messaging.EventGrid.CloudNativeCloudEvents, 1.0.0"
// 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 Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Azure.Messaging.EventGrid (>= 4.6.0)
- CloudNative.CloudEvents (>= 2.0.0)
- CloudNative.CloudEvents.SystemTextJson (>= 2.0.0)
- Microsoft.Bcl.AsyncInterfaces (>= 5.0.0)
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 | 148,041 | 9/7/2021 |
1.0.0-beta.2 | 3,718 | 6/15/2021 |
1.0.0-beta.1 | 2,298 | 3/18/2021 |